Poseidon for UMLTM
  UMLdoc
 PREV  CLASSIFIER    NEXT  CLASSIFIER     FRAMES    NO FRAMES      
SUMMARY:   INNER | ATTR | ASSOC | CONSTR | METHOD     DETAIL:   INNER | ATTR | ASSOC | CONSTR | METHOD     DIAGRAMS:   COLLAB | SEQ | STATE | ACTIV

com.gentleware.services.swingx

Class XAbstractAction

com.gentleware.services.swingx.XAbstractAction
All known Subclassifier:
DiagramAction , GlobalAction , ProjectAction


public class XAbstractAction


A specialized implementation of AbstractAction, that knows how to create action instances from properties held in ResourceBundles.

Properties will also automatically be updated whenever the current locale changes.

Created: 10.02.2003 10:56:44


 Attribute Summary
public static String  MNEMONIC_INDEX
The key used for storing an int key code to be used as the diplayed mnemonic index for the action. 
public static String  SELECTED_PROPERTY
 
public static String  TOGGLE_ACTION_KEY
 
private static Collection  _allActions
 
private boolean  _selected
 
private static boolean  _staticInitDone
 
arrow_up
 

 Association Summary
private Localizer.Listener  _localeListener
Handle a change of the locale (language/country): Update all actions (texts, mnemonics, ...)  
private ResourceId  _resourceId
 
arrow_up
 

 Constructor Summary
public   XAbstractAction(ResourceId resourceId)
Create a new XAbstractAction instance  
arrow_up
 

 Method Summary
public void   actionPerformed(ActionEvent event)
Perform the work the action is supposed to do. 
public boolean   displayInMenu(JMenuItem menuItem)
Tests, if the action should be displayed in the given menu. 
public void   doAfterConfigureAction()
Called after the locale was changed, to update any action-specific values. 
public static XAbstractAction   getActionForType(Class actionClass)
 
public static Collection   getAllActions()
 
public String   getName()
 
public ResourceId   getResourceId()
 
public final boolean   isEnabled()
This is just to ensure that isEnabled() is not overridden in subclasses. 
public boolean   isSelected()
 
public void   itemStateChanged(ItemEvent e)
 
public void   setResourceId(ResourceId resourceId)
 
public void   setSelected(boolean selected)
 
private static void   staticInit()
This could be done with a static initializer, but the XAbstractAction class loading can occur very early and Services might not be initialized at that moment. 
public static void   updateAllEnabled()
Update the enabled state of all action instances. 
public void   updateEnabled()
Subclasses may override this method to update the enabled status of the action (by calling setEnabled()). 
arrow_up
 

Tagged Values
static false
gentleware-imported-line-number 27
gentleware-imported-package-statement-line-number 5
 

 Attribute Detail

MNEMONIC_INDEX

public static String MNEMONIC_INDEX

The key used for storing an int key code to be used as the diplayed mnemonic index for the action. (This should be defined in Action interface...)  
arrow_up


SELECTED_PROPERTY

public static String SELECTED_PROPERTY

arrow_up


TOGGLE_ACTION_KEY

public static String TOGGLE_ACTION_KEY

arrow_up


_allActions

private static Collection _allActions

arrow_up


_selected

private boolean _selected

arrow_up


_staticInitDone

private static boolean _staticInitDone

arrow_up
 Association Detail

_localeListener

private Localizer.Listener _localeListener

Handle a change of the locale (language/country): Update all actions (texts, mnemonics, ...)  
arrow_up


_resourceId

private ResourceId _resourceId

arrow_up
 Constructor Detail

XAbstractAction

public com.gentleware.services.swingx.XAbstractAction XAbstractAction(ResourceId resourceId)


Create a new XAbstractAction instance  
Parameters:
resourceId - specified the resource bundle and key that contains the properties of the action.
Returns:
arrow_up
 Method Detail

actionPerformed

public void actionPerformed(ActionEvent event)


Perform the work the action is supposed to do.  
Parameters:
event -
arrow_up


displayInMenu

public boolean displayInMenu(JMenuItem menuItem)


Tests, if the action should be displayed in the given menu. Should be overwritten, if subclasses should not be displayed due to the internal state of their instances.  
Parameters:
menuItem - The menu to test this action for.
Returns:
true
arrow_up


doAfterConfigureAction

public void doAfterConfigureAction()


Called after the locale was changed, to update any action-specific values.  
arrow_up


getActionForType

public static XAbstractAction getActionForType(Class actionClass)

Parameters:
actionClass -
Returns:
arrow_up


getAllActions

public static Collection getAllActions()

Returns:
all XAbstractAction instances - BEWARE: This is a 'live' collection. Removing an action causes updateAllEnabled() to no longer update this action.
arrow_up


getName

public String getName()

Returns:
arrow_up


getResourceId

public ResourceId getResourceId()

Returns:
arrow_up


isEnabled

public final boolean isEnabled()


This is just to ensure that isEnabled() is not overridden in subclasses. THE CORRECT WAY TO HANDLE ENABLED STATE IS TO OVERWRITE updateEnabled() AND CALL setEnabled(boolean) FROM THERE!  
Returns:
arrow_up


isSelected

public boolean isSelected()

Returns:
arrow_up


itemStateChanged

public void itemStateChanged(ItemEvent e)

Parameters:
e -
arrow_up


setResourceId

public void setResourceId(ResourceId resourceId)

Parameters:
resourceId -
arrow_up


setSelected

public void setSelected(boolean selected)

Parameters:
selected -
arrow_up


staticInit

private static void staticInit()


This could be done with a static initializer, but the XAbstractAction class loading can occur very early and Services might not be initialized at that moment. So defer the access to Services until an instance of XAbstractAction is really instantiated.  
arrow_up


updateAllEnabled

public static void updateAllEnabled()


Update the enabled state of all action instances.  
arrow_up


updateEnabled

public void updateEnabled()


Subclasses may override this method to update the enabled status of the action (by calling setEnabled()).  
arrow_up
Created  2004 - 12 - 1

    Poseidon for UMLTM
  UMLdoc
 PREV  CLASSIFIER    NEXT  CLASSIFIER     FRAMES    NO FRAMES      
SUMMARY:   INNER | ATTR | ASSOC | CONSTR | METHOD     DETAIL:   INNER | ATTR | ASSOC | CONSTR | METHOD     DIAGRAMS:   COLLAB | SEQ | STATE | ACTIV

Generated with Poseidon for UMLTM.
Poseidon is a registered trademark of Gentleware AG in Germany, USA and other countries. Copyright 2003-2004 Gentleware AG, Schanzenstr. 70, 20357 Hamburg, Germany. All Rights Reserved.

UML is a trademark or registered trademark of Object Management Group, Inc. in the U.S. and other countries.