Package com.bc.ceres.swing.actions
Class AbstractSelectionAction
- java.lang.Object
-
- javax.swing.AbstractAction
-
- com.bc.ceres.swing.actions.AbstractSystemAction
-
- com.bc.ceres.swing.actions.AbstractSelectionAction
-
- All Implemented Interfaces:
SelectionChangeListener,ActionListener,Serializable,Cloneable,EventListener,Action
- Direct Known Subclasses:
CopyAction,CutAction,DeleteAction,PasteAction,SelectAllAction
public abstract class AbstractSelectionAction extends AbstractSystemAction implements SelectionChangeListener
An abstract base class for generic actions which depend and operate on the current selection abstraction.- Since:
- Ceres 0.10
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
-
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractSelectionAction(SelectionManager selectionManager, String name, KeyStroke acceleratorKey, String iconResource)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ClipboardgetClipboard()SelectiongetSelection()SelectionContextgetSelectionContext()booleanisExecutable()Checks if a selection context exists.voidselectionChanged(SelectionChangeEvent event)A selection change occurred.voidselectionContextChanged(SelectionChangeEvent event)Called if a selection context change occurred.-
Methods inherited from class com.bc.ceres.swing.actions.AbstractSystemAction
actionPerformed, execute, loadIcon, updateState
-
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
-
-
-
Constructor Detail
-
AbstractSelectionAction
protected AbstractSelectionAction(SelectionManager selectionManager, String name, KeyStroke acceleratorKey, String iconResource)
-
-
Method Detail
-
selectionChanged
public void selectionChanged(SelectionChangeEvent event)
Description copied from interface:SelectionChangeListenerA selection change occurred.- Specified by:
selectionChangedin interfaceSelectionChangeListener- Parameters:
event- The selection event.
-
selectionContextChanged
public void selectionContextChanged(SelectionChangeEvent event)
Description copied from interface:SelectionChangeListenerCalled if a selection context change occurred.- Specified by:
selectionContextChangedin interfaceSelectionChangeListener- Parameters:
event- The selection event.
-
isExecutable
public boolean isExecutable()
Checks if a selection context exists. Overrides should first test the return value ofsuper.isExecutable().- Specified by:
isExecutablein classAbstractSystemAction- Returns:
true, if so.
-
getSelection
public Selection getSelection()
-
getSelectionContext
public SelectionContext getSelectionContext()
-
getClipboard
public Clipboard getClipboard()
-
-