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
.boolean
The default implementation returns an empty string.Gets the selected value.T[]
Gets the selected values of a multiple selection.int
hashCode()
boolean
isEmpty()
toString()
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 Details
-
DefaultSelection
-
-
Method Details
-
getSelectedValue
Description copied from interface:Selection
Gets the selected value. The method returnsnull
if this selectionis empty
.- Returns:
- The selected value, or
null
.
-
getSelectedValues
Description copied from interface:Selection
Gets the selected values of a multiple selection. The method returns an empty array if this selectionis empty
.- Specified by:
getSelectedValues
in interfaceSelection
- Overrides:
getSelectedValues
in classAbstractSelection
- Returns:
- The array of selected values.
-
isEmpty
public boolean isEmpty()- Specified by:
isEmpty
in interfaceSelection
- Overrides:
isEmpty
in classAbstractSelection
- Returns:
true
if this selection is empty.
-
getPresentationName
Description copied from class:AbstractSelection
The default implementation returns an empty string.- Specified by:
getPresentationName
in interfaceSelection
- Overrides:
getPresentationName
in classAbstractSelection
- Returns:
- An empty string.
-
createTransferable
Description copied from class:AbstractSelection
The default implementation returnsnull
.- Specified by:
createTransferable
in interfaceSelection
- Overrides:
createTransferable
in classAbstractSelection
- Parameters:
snapshot
- Iftrue
, the returnedTransferable
should hold a copy-of rather than a reference-to the selection.- Returns:
null
by default.
-
clone
Description copied from interface:Selection
Creates and returns a copy of this selection.- Specified by:
clone
in interfaceSelection
- Overrides:
clone
in classAbstractSelection
- Returns:
- A clone of this selection instance.
-
equals
-
hashCode
public int hashCode() -
toString
-