ARoad0.gDMak
Class ActionUtilities

java.lang.Object
  extended by ARoad0.gDMak.ActionUtilities
All Implemented Interfaces:
Singleton

public class ActionUtilities
extends java.lang.Object
implements Singleton

An utility class that closes the main frame of a base object, analyzes the ActionEvent fired to an AbstractAction, and manages the dialog to choose a closing and a saving of the base object. Used by ActionCloseXXX and SimplePropertyEditor classes.

Since:
0.5.1

Field Summary
private  ACSFactoryImpl factory_
           
private static ActionUtilities instance__
           
private  java.lang.Class internalFrameClass_
           
 
Constructor Summary
private ActionUtilities()
          with this private constructor, the compiler won't generate a default public constructor
 
Method Summary
(package private)  java.lang.Object[] analyzeActionEvent(java.awt.event.ActionEvent _ev)
          Analyzes an ActionEvent fired to actionPerformed() in an AbstractAction class, to extract the main information.
 ACSFactoryImpl getACSFactory()
          Called by ActionOpenBeamer
static ActionUtilities getInstance()
          constructor()
 void registerACSTreeListenerInGroup(ImmutableGroupID _grp)
          This method registers all the relevant ACSTreeBaseListeners to listen the 'l_Members' events.
 void setACSFactory(ACSFactoryImpl _factory)
          ActionNewACSyst calls this method to store the current ACSFactory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instance__

private static ActionUtilities instance__

internalFrameClass_

private java.lang.Class internalFrameClass_

factory_

private ACSFactoryImpl factory_
Constructor Detail

ActionUtilities

private ActionUtilities()
with this private constructor, the compiler won't generate a default public constructor

Method Detail

getInstance

public static ActionUtilities getInstance()
constructor()

Returns:
ActionUtilities

registerACSTreeListenerInGroup

public void registerACSTreeListenerInGroup(ImmutableGroupID _grp)
This method registers all the relevant ACSTreeBaseListeners to listen the 'l_Members' events. Called by ActionCopy.handleNewBaseObject().

Parameters:
_grp - is the group which may fire 'l_Members' events

setACSFactory

public void setACSFactory(ACSFactoryImpl _factory)
ActionNewACSyst calls this method to store the current ACSFactory.

Parameters:
_factory - to store. May be null.

getACSFactory

public ACSFactoryImpl getACSFactory()
Called by ActionOpenBeamer

Returns:
_factory is currently used for an ACS creation. May be null.

analyzeActionEvent

java.lang.Object[] analyzeActionEvent(java.awt.event.ActionEvent _ev)
Analyzes an ActionEvent fired to actionPerformed() in an AbstractAction class, to extract the main information. Called by ActionClose, ActionSave, ActionRemove, ActionOpenBeamer, ActionExportRTF, ActionExportPNG. Analyzes the ActionEvent fired from the main menu, and also coming from an ACS, the beamer, the structure, a view main or a 'See why' JInternalFrame. The returned base object cannot be closed. Call TreeManager.analyzeSelectedNodeInExplorer() if it is a node in the explorer, and analyzeSelectedNodeInStructure() for the structure.

Parameters:
_ev - ActionEvent
Returns:
Object[] of three objects: 0- String type of the base object associated to the ActionEvent ("acs", "acsrun", "resource", "actor", "groupid", "userid", "aclentry", "view", "beamer", "metaright", "acsright", "structure" or "" if it is an another selected node) - may be null 1- ImmutableName of the base object - may be null 2- JComponent open main component (JInternalFrame or JPanel) of the base object - may be null Return {null,null,null} if no frame is selected, or a no-workable frame, or if the selected node in the explorer is not workable.