public abstract class AbstractSelectionAction
extends javax.swing.AbstractAction
AbstractSelectionAction
acts on the selection of a target component.
By default, the action is disabled when the target component is disabled or has
no selection. If the target component is null, updateEnabled does nothing.
You can change this behavior by overriding method updateEnabled()
.
This action registers a WeakPropertyChangeListener
on the component.
Framework
The interfaces and classes listed below work together:
Contract: EditableComponent
, JTextComponent
.
Client: AbstractSelectionAction
,
DeleteAction
,
DuplicateAction
,
SelectAllAction
,
ClearSelectionAction
.
Modifier and Type | Field and Description |
---|---|
protected javax.swing.JComponent |
target
The target of the action or null if the action acts on the currently
focused component.
|
Constructor and Description |
---|
AbstractSelectionAction(javax.swing.JComponent target)
Creates a new instance which acts on the specified component.
|
Modifier and Type | Method and Description |
---|---|
protected void |
updateEnabled() |
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
protected javax.swing.JComponent target