public class StructuredSelection extends Object implements IStructuredSelection
IStructuredSelection interface,
suitable for instantiating.
This class is not intended to be subclassed.
| Modifier and Type | Field and Description |
|---|---|
static StructuredSelection |
EMPTY
The canonical empty selection.
|
| Constructor and Description |
|---|
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.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o)
Returns whether this structured selection is equal to the 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.
|
public static final StructuredSelection EMPTY
null.public StructuredSelection()
EMPTY which contains an empty selection singleton.EMPTYpublic StructuredSelection(Object[] elements)
elements - an array of elementspublic StructuredSelection(Object element)
null.element - the elementpublic StructuredSelection(List elements)
List.public boolean equals(Object o)
public Object getFirstElement()
IStructuredSelectionnull
if the selection is empty.getFirstElement in interface IStructuredSelectionnull if nonepublic boolean isEmpty()
ISelectionisEmpty in interface ISelectiontrue if this selection is empty,
and false otherwisepublic Iterator iterator()
IStructuredSelectioniterator in interface IStructuredSelectionpublic int size()
IStructuredSelectionsize in interface IStructuredSelectionpublic Object[] toArray()
IStructuredSelectiontoArray in interface IStructuredSelectionpublic List toList()
IStructuredSelectionList.toList in interface IStructuredSelectionGuidelines for using Eclipse APIs. Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.