Class DefaultSelection<T>
java.lang.Object
com.bc.ceres.core.ExtensibleObject
com.bc.ceres.swing.selection.AbstractSelection
com.bc.ceres.swing.selection.support.DefaultSelection<T>
- All Implemented Interfaces:
Extensible,Selection,ClipboardOwner,Cloneable
A default implementation of the
Selection interface.- 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.booleanThe default implementation returns an empty string.Gets the selected value.T[]Gets the selected values of a multiple selection.inthashCode()booleanisEmpty()toString()Methods inherited from class com.bc.ceres.swing.selection.AbstractSelection
lostOwnershipMethods inherited from class com.bc.ceres.core.ExtensibleObject
getExtensionMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.bc.ceres.core.Extensible
getExtension
-
Constructor Details
-
DefaultSelection
-
-
Method Details
-
getSelectedValue
Description copied from interface:SelectionGets the selected value. The method returnsnullif this selectionis empty.- Returns:
- The selected value, or
null.
-
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- Overrides:
getSelectedValuesin classAbstractSelection- Returns:
- The array of selected values.
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceSelection- Overrides:
isEmptyin classAbstractSelection- Returns:
trueif this selection is empty.
-
getPresentationName
Description copied from class:AbstractSelectionThe default implementation returns an empty string.- Specified by:
getPresentationNamein interfaceSelection- Overrides:
getPresentationNamein classAbstractSelection- Returns:
- An empty string.
-
createTransferable
Description copied from class:AbstractSelectionThe default implementation returnsnull.- Specified by:
createTransferablein interfaceSelection- Overrides:
createTransferablein classAbstractSelection- Parameters:
snapshot- Iftrue, the returnedTransferableshould hold a copy-of rather than a reference-to the selection.- Returns:
nullby default.
-
clone
Description copied from interface:SelectionCreates and returns a copy of this selection.- Specified by:
clonein interfaceSelection- Overrides:
clonein classAbstractSelection- Returns:
- A clone of this selection instance.
-
equals
-
hashCode
public int hashCode() -
toString
-