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
public class DefaultSelection<T> extends AbstractSelection
A default implementation of theSelectioninterface.- Since:
- Ceres 0.10
-
-
Constructor Summary
Constructors Constructor Description DefaultSelection(T... selectedValues)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DefaultSelection<T>clone()Creates and returns a copy of this selection.TransferablecreateTransferable(boolean snapshot)The default implementation returnsnull.booleanequals(Object o)StringgetPresentationName()The default implementation returns an empty string.TgetSelectedValue()Gets the selected value.T[]getSelectedValues()Gets the selected values of a multiple selection.inthashCode()booleanisEmpty()StringtoString()-
Methods inherited from class com.bc.ceres.swing.selection.AbstractSelection
lostOwnership
-
Methods inherited from class com.bc.ceres.core.ExtensibleObject
getExtension
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.bc.ceres.core.Extensible
getExtension
-
-
-
-
Constructor Detail
-
DefaultSelection
public DefaultSelection(T... selectedValues)
-
-
Method Detail
-
getSelectedValue
public T getSelectedValue()
Description copied from interface:SelectionGets the selected value. The method returnsnullif this selectionis empty.- Returns:
- The selected value, or
null.
-
getSelectedValues
public T[] 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
public String getPresentationName()
Description copied from class:AbstractSelectionThe default implementation returns an empty string.- Specified by:
getPresentationNamein interfaceSelection- Overrides:
getPresentationNamein classAbstractSelection- Returns:
- An empty string.
-
createTransferable
public Transferable createTransferable(boolean snapshot)
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
public DefaultSelection<T> 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.
-
-