public abstract class SafeAction extends AbstractAction
This is not generally a good practice - we are just using it as an excuse to not mess up code examples with exception handling code (gasp!). TODO: provide a background Runnable...
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 |
---|
SafeAction(String name)
Constructor
|
Modifier and Type | Method and Description |
---|---|
abstract void |
action(ActionEvent e)
Sub-classes (usually anonymous) must override this method instead of the usual ActionListener.actionPerformed(java.awt.event.ActionEvent)
|
void |
actionPerformed(ActionEvent e)
Calls the action(java.awt.event.ActionEvent) method
|
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
public SafeAction(String name)
name
- name for the associated controlpublic abstract void action(ActionEvent e) throws Throwable
e
- the action eventThrowable
- on errorpublic void actionPerformed(ActionEvent e)
e
- the action eventCopyright © 1996–2019 Geotools. All rights reserved.