Class AbstractSelection

    • Constructor Detail

      • AbstractSelection

        protected AbstractSelection()
    • Method Detail

      • getSelectedValues

        public Object[] getSelectedValues()
        Description copied from interface: Selection
        Gets the selected values of a multiple selection. The method returns an empty array if this selection is empty.
        Specified by:
        getSelectedValues in interface Selection
        Returns:
        The array of selected values.
      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in interface Selection
        Returns:
        true if this selection is empty.
      • getPresentationName

        public String getPresentationName()
        The default implementation returns an empty string.
        Specified by:
        getPresentationName in interface Selection
        Returns:
        An empty string.
      • createTransferable

        public Transferable createTransferable​(boolean snapshot)
        The default implementation returns null.
        Specified by:
        createTransferable in interface Selection
        Parameters:
        snapshot - If true, the returned Transferable should hold a copy-of rather than a reference-to the selection.
        Returns:
        null by default.
      • lostOwnership

        public void lostOwnership​(Clipboard clipboard,
                                  Transferable contents)
        Notifies this object that it is no longer the clipboard owner. This method will be called when another application or another object within this application asserts ownership of the clipboard.

        The default implementation does nothing.

        Specified by:
        lostOwnership in interface ClipboardOwner
        Parameters:
        clipboard - the clipboard that is no longer owned
        contents - the contents which this owner had placed on the clipboard
      • clone

        public AbstractSelection clone()
        Description copied from interface: Selection
        Creates and returns a copy of this selection.
        Specified by:
        clone in interface Selection
        Overrides:
        clone in class Object
        Returns:
        A clone of this selection instance.