com.japisoft.framework.dialog.actions
Class AbstractDialogAction

java.lang.Object
  extended byjavax.swing.AbstractAction
      extended bycom.japisoft.framework.dialog.actions.AbstractDialogAction
All Implemented Interfaces:
javax.swing.Action, java.awt.event.ActionListener, java.lang.Cloneable, DialogAction, java.util.EventListener, java.io.Serializable
Direct Known Subclasses:
CancelAction, DialogActionProxy, OKAction, StopAction, StoringLocationAction

public abstract class AbstractDialogAction
extends javax.swing.AbstractAction
implements DialogAction

Version:
1.0
Author:
(c) 2004 JAPISoft / http://www.japisoft.com
See Also:
Serialized Form

Field Summary
 
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
AbstractDialogAction(int id)
          Create a new action with this id
AbstractDialogAction(int id, boolean bundleMode)
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
           
 int getActionId()
           
protected  java.lang.String getBundledName()
           
protected  java.lang.String getLabel(java.lang.String name, java.lang.String def)
           
 boolean isForDialogFooter()
           
 boolean isSpecial()
           
protected  void prepareBundleValues()
          Called once for reading properties from bundle
protected  void prepareStaticValues()
          Called once for setting label, tooltip ...
 void setActionDelegate(java.awt.event.ActionListener delegate)
           
 void setForDialogFooter(boolean forFooter)
          This is a property for not adding the action inside the dialog footer
 void setSpecial(boolean specialMode)
          Update the action status.
 
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 javax.swing.Action
addPropertyChangeListener, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
 

Constructor Detail

AbstractDialogAction

public AbstractDialogAction(int id)
Create a new action with this id

Parameters:
id -

AbstractDialogAction

public AbstractDialogAction(int id,
                            boolean bundleMode)
Parameters:
id - a new action id
bundleMode - decide to reset the label and name with a property file
Method Detail

prepareStaticValues

protected void prepareStaticValues()
Called once for setting label, tooltip ...


prepareBundleValues

protected void prepareBundleValues()
Called once for reading properties from bundle


getBundledName

protected java.lang.String getBundledName()
Returns:
the name of the bundle for internationalization

getLabel

protected java.lang.String getLabel(java.lang.String name,
                                    java.lang.String def)
Returns:
a label from the resource bundle or the default one

getActionId

public int getActionId()
Specified by:
getActionId in interface DialogAction
Returns:
an unique action ID

setActionDelegate

public void setActionDelegate(java.awt.event.ActionListener delegate)

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

setForDialogFooter

public void setForDialogFooter(boolean forFooter)
This is a property for not adding the action inside the dialog footer


isForDialogFooter

public boolean isForDialogFooter()
Specified by:
isForDialogFooter in interface DialogAction
Returns:
true if the action is for the footer.

isSpecial

public boolean isSpecial()
Specified by:
isSpecial in interface DialogAction
Returns:
true if this is a specific action that must appear on the left part

setSpecial

public void setSpecial(boolean specialMode)
Update the action status. If true, the action will be on the left part of the footer