org.graffiti.plugin.gui
Class ExceptionHandlingAction

java.lang.Object
  extended by org.graffiti.plugin.gui.ExceptionHandlingAction
All Implemented Interfaces:
ActionListener, EventListener, Action

public class ExceptionHandlingAction
extends Object
implements Action

Wrapper class for actions to add exception handling to method actionPerformed

Version:
$Revision$ $Date$
Author:
Harald
See Also:
Action, ActionListener.actionPerformed(ActionEvent)

Field Summary
 
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
ExceptionHandlingAction(Action delegate)
          Creates an action with exception handling.
 
Method Summary
 void actionPerformed(ActionEvent event)
          Delegates to this wrapper's delegate action and catches all exceptions thrown while executing it.
 void addPropertyChangeListener(PropertyChangeListener listener)
          Delegates to the wrapped action instance.
 Object getValue(String key)
          Delegates to the wrapped action instance.
 boolean isEnabled()
          Delegates to the wrapped action instance.
 void putValue(String key, Object value)
          Delegates to the wrapped action instance.
 void removePropertyChangeListener(PropertyChangeListener listener)
          Delegates to the wrapped action instance.
 void setEnabled(boolean b)
          Delegates to the wrapped action instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExceptionHandlingAction

public ExceptionHandlingAction(Action delegate)
Creates an action with exception handling.

Parameters:
delegate - the action used for delegating method calls.
Method Detail

getValue

public Object getValue(String key)
Delegates to the wrapped action instance.

Specified by:
getValue in interface Action

actionPerformed

public void actionPerformed(ActionEvent event)
Delegates to this wrapper's delegate action and catches all exceptions thrown while executing it. Shows a message dialog with the exceptions detail message.

Specified by:
actionPerformed in interface ActionListener

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener listener)
Delegates to the wrapped action instance.

Specified by:
addPropertyChangeListener in interface Action

isEnabled

public boolean isEnabled()
Delegates to the wrapped action instance.

Specified by:
isEnabled in interface Action

putValue

public void putValue(String key,
                     Object value)
Delegates to the wrapped action instance.

Specified by:
putValue in interface Action

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener listener)
Delegates to the wrapped action instance.

Specified by:
removePropertyChangeListener in interface Action

setEnabled

public void setEnabled(boolean b)
Delegates to the wrapped action instance.

Specified by:
setEnabled in interface Action


Generated at 2012-05-30 11:00:36 PM CEST