Package com.bc.ceres.swing.selection
Interface Selection
- All Superinterfaces:
ClipboardOwner
,Cloneable
,Extensible
- All Known Subinterfaces:
FigureSelection
- All Known Implementing Classes:
AbstractSelection
,DefaultFigureSelection
,DefaultSelection
Represents a selection of zero, one or more items, e.g. the selected entries of a table,
nodes of a tree view or figures of a drawing.
This interface may be implemented by clients.
Selections should always be implemented as imutable objects.
- Since:
- Ceres 0.10
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionclone()
Creates and returns a copy of this selection.createTransferable
(boolean snapshot) Creates a transferable representation of this selection.Returns a localized, human-readable description of this selection, suitable for use in a change log or menu entry, for example.Gets the selected value.Object[]
Gets the selected values of a multiple selection.boolean
isEmpty()
Methods inherited from interface java.awt.datatransfer.ClipboardOwner
lostOwnership
Methods inherited from interface com.bc.ceres.core.Extensible
getExtension
-
Field Details
-
EMPTY
An empty selection.
-
-
Method Details
-
getPresentationName
String getPresentationName()Returns a localized, human-readable description of this selection, suitable for use in a change log or menu entry, for example.- Returns:
- A presentation name for this selection.
-
isEmpty
boolean isEmpty()- Returns:
true
if this selection is empty.
-
getSelectedValue
Object getSelectedValue()Gets the selected value. The method returnsnull
if this selectionis empty
.- Returns:
- The selected value, or
null
.
-
getSelectedValues
Object[] getSelectedValues()Gets the selected values of a multiple selection. The method returns an empty array if this selectionis empty
.- Returns:
- The array of selected values.
-
createTransferable
Creates a transferable representation of this selection.- Parameters:
snapshot
- Iftrue
, the returnedTransferable
should hold a copy-of rather than a reference-to the selection.- Returns:
- A transferable representation of this selection or
null
if this is not possible.
-
clone
Selection clone()Creates and returns a copy of this selection.- Returns:
- A clone of this selection instance.
-