org.xnap.commons.gui.action
Class AbstractXNapAction

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by org.xnap.commons.gui.action.AbstractXNapAction
All Implemented Interfaces:
ActionListener, Serializable, Cloneable, EventListener, Action
Direct Known Subclasses:
AbstractSelectionAction, AbstractSingleSelectionAction, AbstractToggleAction, ClearCompletionModelAction, ColorChooserPanel.ColorChooserAction, DirectoryChooser.HomeAction, EraseTextFieldAction, WhatsThisAction, WizardDialog.FinishAction, WizardDialog.NextAction, WizardDialog.PreviousAction

public abstract class AbstractXNapAction
extends AbstractAction

Provides an abstract action. All actions should inherit this class, since it provides a few convenience methods.

See Also:
Serialized Form

Field Summary
static String ICON_FILENAME
           
 
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
 
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON
 
Constructor Summary
AbstractXNapAction()
           
 
Method Summary
static Icon getIcon(AbstractButton button, String filename)
           
static void initialize(AbstractButton button, Action action)
           
 void setEnabledLater(boolean enabled)
          Enables/disables the action in the swing thread by calling SwingUtilities.invokeLater(java.lang.Runnable).
protected  String tr(String text)
          Convenience method for translating which can be used by subclasses.
protected  String tr(String text, Object... objects)
          See tr(String) and I18n.tr(String, Object[]).
 
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.awt.event.ActionListener
actionPerformed
 

Field Detail

ICON_FILENAME

public static final String ICON_FILENAME
See Also:
Constant Field Values
Constructor Detail

AbstractXNapAction

public AbstractXNapAction()
Method Detail

setEnabledLater

public void setEnabledLater(boolean enabled)
Enables/disables the action in the swing thread by calling SwingUtilities.invokeLater(java.lang.Runnable).

Parameters:
enabled - parameter passed to Action.setEnabled(boolean).

tr

protected String tr(String text)
Convenience method for translating which can be used by subclasses.

This works because subclasses are in their own package, so the right resource bundle can be chosen.


tr

protected String tr(String text,
                    Object... objects)
See tr(String) and I18n.tr(String, Object[]).


getIcon

public static Icon getIcon(AbstractButton button,
                           String filename)

initialize

public static void initialize(AbstractButton button,
                              Action action)


Copyright © 2004-2007 XNap Commons Team. All Rights Reserved.