org.geotools.swing.action
Class SafeAction

Object
  extended by AbstractAction
      extended by SafeAction
All Implemented Interfaces:
ActionListener, Serializable, Cloneable, EventListener, Action

public abstract class SafeAction
extends AbstractAction

A safe version of AbstractAction that will log any problems encountered.

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...

See Also:
Serialized Form
Module:
modules/unsupported/swing (gt-swing.jar)

Field Summary
 
Fields inherited from class AbstractAction
changeSupport, enabled
 
Fields inherited from interface Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON
 
Constructor Summary
SafeAction(String name)
          Constructor
 
Method Summary
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
 
Methods inherited from class AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
 
Methods inherited from class Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SafeAction

public SafeAction(String name)
Constructor

Parameters:
name - name for the associated control
Method Detail

action

public abstract void action(ActionEvent e)
                     throws Throwable
Sub-classes (usually anonymous) must override this method instead of the usual ActionListener.actionPerformed(java.awt.event.ActionEvent)

Parameters:
e - the action event
Throws:
Throwable - on error

actionPerformed

public void actionPerformed(ActionEvent e)
Calls the action(java.awt.event.ActionEvent) method

Parameters:
e - the action event


Copyright © 1996-2009 Geotools. All Rights Reserved.