Interface Selection

All Superinterfaces:
ClipboardOwner, Cloneable, Extensible
All Known Subinterfaces:
FigureSelection
All Known Implementing Classes:
AbstractSelection, DefaultFigureSelection, DefaultSelection

public interface Selection extends ClipboardOwner, Cloneable, Extensible
Represents a selection of zero, one or more items, e.g. the selected entries of a table, nodes of a tree view or figures of a drawing.

This interface may be implemented by clients.

Selections should always be implemented as imutable objects.

Since:
Ceres 0.10
  • Field Details

    • EMPTY

      static final Selection EMPTY
      An empty selection.
  • Method Details

    • getPresentationName

      String getPresentationName()
      Returns a localized, human-readable description of this selection, suitable for use in a change log or menu entry, for example.
      Returns:
      A presentation name for this selection.
    • isEmpty

      boolean isEmpty()
      Returns:
      true if this selection is empty.
    • getSelectedValue

      Object getSelectedValue()
      Gets the selected value. The method returns null if this selection is empty.
      Returns:
      The selected value, or null.
    • getSelectedValues

      Object[] getSelectedValues()
      Gets the selected values of a multiple selection. The method returns an empty array if this selection is empty.
      Returns:
      The array of selected values.
    • createTransferable

      Transferable createTransferable(boolean snapshot)
      Creates a transferable representation of this selection.
      Parameters:
      snapshot - If true, the returned Transferable should hold a copy-of rather than a reference-to the selection.
      Returns:
      A transferable representation of this selection or null if this is not possible.
    • clone

      Selection clone()
      Creates and returns a copy of this selection.
      Returns:
      A clone of this selection instance.