Interface Selection

    • Field Detail

      • EMPTY

        static final Selection EMPTY
        An empty selection.
    • Method Detail

      • 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.