|
Eclipse Platform Release 3.6 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.jface.viewers.StructuredSelection
public class StructuredSelection
A concrete implementation of the IStructuredSelection interface,
suitable for instantiating.
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(java.util.List elements)
Creates a structured selection from the given List. |
|
StructuredSelection(java.util.List elements,
IElementComparer comparer)
Creates a structured selection from the given List and
element comparer. |
|
StructuredSelection(java.lang.Object element)
Creates a structured selection containing a single object. |
|
StructuredSelection(java.lang.Object[] elements)
Creates a structured selection from the given elements. |
|
| Method Summary | |
|---|---|
boolean |
equals(java.lang.Object o)
Returns whether this structured selection is equal to the given object. |
java.lang.Object |
getFirstElement()
Returns the first element in this selection, or null
if the selection is empty. |
boolean |
isEmpty()
Returns whether this selection is empty. |
java.util.Iterator |
iterator()
Returns an iterator over the elements of this selection. |
int |
size()
Returns the number of elements selected in this selection. |
java.lang.Object[] |
toArray()
Returns the elements in this selection as an array. |
java.util.List |
toList()
Returns the elements in this selection as a List. |
java.lang.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.
EMPTYpublic StructuredSelection(java.lang.Object[] elements)
null.
elements - an array of elementspublic StructuredSelection(java.lang.Object element)
null.
element - the elementpublic StructuredSelection(java.util.List elements)
List.
elements - list of selected elements
public StructuredSelection(java.util.List elements,
IElementComparer comparer)
List and
element comparer. If an element comparer is provided, it will be used to
determine equality between structured selection objects provided that
they both are based on the same (identical) comparer. See bug
elements - list of selected elementscomparer - the comparer, or null| Method Detail |
|---|
public boolean equals(java.lang.Object o)
equals in class java.lang.Objecto - the other object
true if they are equal, and false otherwisepublic java.lang.Object getFirstElement()
IStructuredSelectionnull
if the selection is empty.
getFirstElement in interface IStructuredSelectionnull if nonepublic boolean isEmpty()
ISelection
isEmpty in interface ISelectiontrue if this selection is empty,
and false otherwisepublic java.util.Iterator iterator()
IStructuredSelection
iterator in interface IStructuredSelectionpublic int size()
IStructuredSelection
size in interface IStructuredSelectionpublic java.lang.Object[] toArray()
IStructuredSelection
toArray in interface IStructuredSelectionpublic java.util.List toList()
IStructuredSelectionList.
Note In the default implementation of IStructuredSelection.toList() in
StructuredSelection the returned list is not a copy of the elements of the
receiver and modifying it will modify the contents of the selection.
toList in interface IStructuredSelectionpublic java.lang.String toString()
toString in class java.lang.Object
|
Eclipse Platform Release 3.6 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Guidelines for using Eclipse APIs.
Copyright (c) Eclipse contributors and others 2000, 2010. All rights reserved.