Package com.bc.ceres.swing.selection
Class AbstractSelection
java.lang.Object
com.bc.ceres.core.ExtensibleObject
com.bc.ceres.swing.selection.AbstractSelection
- All Implemented Interfaces:
Extensible,Selection,ClipboardOwner,Cloneable
- Direct Known Subclasses:
DefaultSelection
A handy base class for implementations of the
Selection interface.
Clients only need to implement Selection.getSelectedValue()
for single selection modes. For multiple selections,
getSelectedValues() will need to be overridden.
- Since:
- Ceres 0.10
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()Creates and returns a copy of this selection.createTransferable(boolean snapshot) The default implementation returnsnull.The default implementation returns an empty string.Object[]Gets the selected values of a multiple selection.booleanisEmpty()voidlostOwnership(Clipboard clipboard, Transferable contents) Notifies this object that it is no longer the clipboard owner.Methods inherited from class com.bc.ceres.core.ExtensibleObject
getExtensionMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.bc.ceres.core.Extensible
getExtensionMethods inherited from interface com.bc.ceres.swing.selection.Selection
getSelectedValue
-
Constructor Details
-
AbstractSelection
protected AbstractSelection()
-
-
Method Details
-
getSelectedValues
Description copied from interface:SelectionGets the selected values of a multiple selection. The method returns an empty array if this selectionis empty.- Specified by:
getSelectedValuesin interfaceSelection- Returns:
- The array of selected values.
-
isEmpty
public boolean isEmpty() -
getPresentationName
The default implementation returns an empty string.- Specified by:
getPresentationNamein interfaceSelection- Returns:
- An empty string.
-
createTransferable
The default implementation returnsnull.- Specified by:
createTransferablein interfaceSelection- Parameters:
snapshot- Iftrue, the returnedTransferableshould hold a copy-of rather than a reference-to the selection.- Returns:
nullby default.
-
lostOwnership
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:
lostOwnershipin interfaceClipboardOwner- Parameters:
clipboard- the clipboard that is no longer ownedcontents- the contents which this owner had placed on the clipboard
-
clone
Description copied from interface:SelectionCreates and returns a copy of this selection.
-