public abstract class BasicAction extends AbstractAction
changeSupport, enabled
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 and Description |
---|
BasicAction(String name,
Icon icon,
String descrip)
Constructor with icon.
|
BasicAction(String name,
String descrip)
Constructor without icon.
|
Modifier and Type | Method and Description |
---|---|
static BasicAction |
create(String name,
Icon icon,
String descrip,
java.util.function.Consumer<ActionEvent> perform)
Convenience method to create an Action with a lambda to define the
actionPerformed behaviour.
|
Component |
getEventWindow(ActionEvent evt)
Returns the window from which this action was invoked.
|
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
actionPerformed
public BasicAction(String name, String descrip)
name
- action name (NAME property)descrip
- action description (SHORT_DESCRIPTION property),
used as tooltip textpublic Component getEventWindow(ActionEvent evt)
evt
- event to check the window forpublic static BasicAction create(String name, Icon icon, String descrip, java.util.function.Consumer<ActionEvent> perform)
name
- action name (NAME property)icon
- action icon (SMALL_ICON property)descrip
- action description (SHORT_DESCRIPTION property),
used as tooltip textperform
- provides actionPerformed
behaviourCopyright © 2003-2025 CCLRC: Council for the Central Laboratory of the Research Councils. All Rights Reserved.