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

    Modifier and Type
    Method
    Description
    Returns the first element in this selection, or null if the selection is empty.
    Returns an iterator over the elements of this selection.
    int
    Returns the number of elements selected in this selection.
    Returns the elements in this selection as an array.
    Returns the elements in this selection as a List.

    Methods inherited from interface org.eclipse.jface.viewers.ISelection

    isEmpty

    Methods inherited from interface java.lang.Iterable

    forEach, spliterator
  • Method Details

    • getFirstElement

      Object getFirstElement()
      Returns the first element in this selection, or null if the selection is empty.
      Returns:
      an element, or null if none
    • iterator

      Iterator iterator()
      Returns an iterator over the elements of this selection.
      Specified by:
      iterator in interface Iterable
      Returns:
      an iterator over the selected elements
    • 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 a List.
      Returns:
      the selected elements as a list