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 TypeMethodDescriptionbooleanbooleancanInsert(Transferable contents) Tests whether the current contents (e.g.booleanvoidDeletes the current selection.voidinsert(Transferable transferable) Inserts a selection represented by the givenTransferableinto this context.voidSelects all items.voidsetSelection(Selection selection) Sets a new selection.Methods inherited from interface com.bc.ceres.core.Extensible
getExtensionMethods inherited from interface com.bc.ceres.swing.selection.SelectionChangeEmitter
addSelectionChangeListener, getSelectionChangeListeners, removeSelectionChangeListenerMethods 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:
trueif the given contents can be inserted into this context.- See Also:
-
insert
Inserts a selection represented by the givenTransferableinto this context.- Parameters:
transferable- The transferable object.- Throws:
IOException- if an I/O error occursUnsupportedFlavorException- See Also:
-
canDeleteSelection
boolean canDeleteSelection()- Returns:
trueif the current selection can be deleted.- See Also:
-
deleteSelection
void deleteSelection()Deletes the current selection.- See Also:
-
canSelectAll
boolean canSelectAll()- Returns:
trueif all items can be selected.- See Also:
-
selectAll
void selectAll()Selects all items.- See Also:
-