Package com.bc.ceres.swing.selection
Interface SelectionContext
- All Superinterfaces:
Extensible
,SelectionChangeEmitter
,SelectionSource
- All Known Subinterfaces:
FigureEditor
- All Known Implementing Classes:
AbstractSelectionContext
,ComboBoxSelectionContext
,DefaultFigureEditor
,DefaultSelectionContext
,FigureSelectionContext
,ListSelectionContext
,TableSelectionContext
,TreeSelectionContext
A selection context is a
selection source
with additional capabilities, e.g. insert, delete and select all.
It can be seen as the environment in which selections reside and originate,
e.g. a GUI table, list, tree, or a drawing of figures.
This interface may be directly implemented by clients, although it is advised
to extend AbstractSelectionContext
,
since this interface may evolve in the future.
- Since:
- Ceres 0.10
-
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
canInsert
(Transferable contents) Tests whether the current contents (e.g.boolean
void
Deletes the current selection.void
insert
(Transferable transferable) Inserts a selection represented by the givenTransferable
into this context.void
Selects all items.void
setSelection
(Selection selection) Sets a new selection.Methods inherited from interface com.bc.ceres.core.Extensible
getExtension
Methods inherited from interface com.bc.ceres.swing.selection.SelectionChangeEmitter
addSelectionChangeListener, getSelectionChangeListeners, removeSelectionChangeListener
Methods inherited from interface com.bc.ceres.swing.selection.SelectionSource
getSelection
-
Method Details
-
setSelection
Sets a new selection.- Parameters:
selection
- The new selection.
-
canInsert
Tests whether the current contents (e.g. from clipboard, drag and drop) can be inserted into this selection context.- Parameters:
contents
- The contents.- Returns:
true
if the given contents can be inserted into this context.- See Also:
-
insert
Inserts a selection represented by the givenTransferable
into this context.- Parameters:
transferable
- The transferable object.- Throws:
IOException
- if an I/O error occursUnsupportedFlavorException
- See Also:
-
canDeleteSelection
boolean canDeleteSelection()- Returns:
true
if the current selection can be deleted.- See Also:
-
deleteSelection
void deleteSelection()Deletes the current selection.- See Also:
-
canSelectAll
boolean canSelectAll()- Returns:
true
if all items can be selected.- See Also:
-
selectAll
void selectAll()Selects all items.- See Also:
-