Package org.eclipse.jface.viewers
Interface IStructuredSelection
-
- All Superinterfaces:
ISelection
,Iterable
- All Known Subinterfaces:
ITreeSelection
- All Known Implementing Classes:
StructuredSelection
,TreeSelection
public interface IStructuredSelection extends ISelection, Iterable
A selection containing elements.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Object
getFirstElement()
Returns the first element in this selection, ornull
if the 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 aList
.-
Methods inherited from interface org.eclipse.jface.viewers.ISelection
isEmpty
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
getFirstElement
Object getFirstElement()
Returns the first element in this selection, ornull
if the selection is empty.- Returns:
- an element, or
null
if none
-
iterator
Iterator iterator()
Returns an iterator over the elements of this selection.
-
size
int size()
Returns the number of elements selected in this selection.- Returns:
- the number of elements selected
-
toArray
Object[] toArray()
Returns the elements in this selection as an array.- Returns:
- the selected elements as an array
-
toList
List toList()
Returns the elements in this selection as aList
.- Returns:
- the selected elements as a list
-
-