|
Eclipse Platform 2.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.eclipse.jface.viewers.StructuredSelection
A concrete implementation of the IStructuredSelection
interface,
suitable for instantiating or subclassing.
This class is not intended to be subclassed.
Field Summary | |
static StructuredSelection |
EMPTY
The canonical empty selection. |
Constructor Summary | |
StructuredSelection()
Creates a new empty selection. |
|
StructuredSelection(List elements)
Creates a structured selection from the given List . |
|
StructuredSelection(Object element)
Creates a structured selection containing a single object. |
|
StructuredSelection(Object[] elements)
Creates a structured selection from the given elements. |
Method Summary | |
boolean |
equals(Object o)
Returns whether this structured selection is equal to given object. |
Object |
getFirstElement()
Returns the first element in this selection, or null
if the selection is empty. |
boolean |
isEmpty()
Returns whether this selection is empty. |
Iterator |
iterator()
Returns an iterator over the elements of this selection. |
int |
size()
Returns the number of elements selected in this selection. |
Object[] |
toArray()
Returns the elements in this selection as an array. |
List |
toList()
Returns the elements in this selection as a List . |
String |
toString()
Internal method which returns a string representation of this selection suitable for debug purposes only. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final StructuredSelection EMPTY
null
.
Constructor Detail |
public StructuredSelection()
EMPTY
which contains an empty selection singleton.
EMPTY
public StructuredSelection(Object[] elements)
elements
- an array of elementspublic StructuredSelection(Object element)
null
.
element
- the elementpublic StructuredSelection(List elements)
List
.
Method Detail |
public boolean equals(Object o)
equals
in class Object
o
- the other object
true
if they are equal, and false
otherwisepublic Object getFirstElement()
IStructuredSelection
null
if the selection is empty.
getFirstElement
in interface IStructuredSelection
null
if nonepublic boolean isEmpty()
ISelection
isEmpty
in interface ISelection
true
if this selection is empty,
and false
otherwisepublic Iterator iterator()
IStructuredSelection
iterator
in interface IStructuredSelection
public int size()
IStructuredSelection
size
in interface IStructuredSelection
public Object[] toArray()
IStructuredSelection
toArray
in interface IStructuredSelection
public List toList()
IStructuredSelection
List
.
toList
in interface IStructuredSelection
public String toString()
toString
in class Object
|
Eclipse Platform 2.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |