ARoad0.gDMak
Class ActionNewResource

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by ARoad0.gDMak.ActionNewResource
All Implemented Interfaces:
NewBaseObjectListener, Singleton, java.awt.event.ActionListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.Action

public class ActionNewResource
extends javax.swing.AbstractAction
implements Singleton, NewBaseObjectListener

An action that creates a new resource when the user requests it in the beamer. createResource() is the main method, and it is invoked by the beamer PropertyEditors. The name has the structure 'IS-name :: ACS-name :: Resource-name'. This class manages all the dialog boxes required for the user input, controls the inputs, creates the resource in its ACS, then updates all the open frames in the GUI.

See Also:
Serialized Form

Field Summary
private static ActionNewResource instance__
          the only instance of the class, following singleton pattern
protected  BaseObject source_
          The value of the ACS which is the source.
 
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
 
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
private ActionNewResource()
          with this private constructor, the compiler won't generate a default public constructor
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent ev)
          NO USE.
 void createResource(java.lang.Object[] _l_fixedValue)
          Invoked by actionPerformed() or by CollectionPropertyEditor (from data in ACS/DirectoryImplBeanInfo classes) to create the resource.
static ActionNewResource getInstance()
          only public method to get the unique instance
 BaseObject getSource()
          Gets the value of the ACS.
 void handleNewBaseObject(BaseObject _obj)
          Called by BaseObjectHandler for createResource().
 
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
 

Field Detail

source_

protected BaseObject source_
The value of the ACS which is the source.


instance__

private static ActionNewResource instance__
the only instance of the class, following singleton pattern

Constructor Detail

ActionNewResource

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

Method Detail

getInstance

public static ActionNewResource getInstance()
only public method to get the unique instance

Returns:
ActionNewResource, the unique instance

getSource

public BaseObject getSource()
Gets the value of the ACS.

Specified by:
getSource in interface NewBaseObjectListener
Returns:
the source of the property.

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent ev)
NO USE. Manage the actions fired from the main menu, and display a dialog box.

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
ev - ActionEvent

createResource

public void createResource(java.lang.Object[] _l_fixedValue)
Invoked by actionPerformed() or by CollectionPropertyEditor (from data in ACS/DirectoryImplBeanInfo classes) to create the resource. Uses a BaseObjectHandler instance. Calls ACSFactoryUtilityImpl.getL_AcsAddonExtensionClassNames() and getEffectiveClassName().

Parameters:
_l_fixedValue - array of the arguments. _l_fixedValue[1] is always the ACS. They may be all Strings, all ImmutableNames or all BaseObjects, as arguments which has been chosen by the user or which are set in the BeanInfo. The value at the index 0 is the chosen value for the first argument, and so on. A value in the array is null if the argument for this index is not pre-defined. The size of the array may be inferior or superior to the number of arguments.

handleNewBaseObject

public void handleNewBaseObject(BaseObject _obj)
Called by BaseObjectHandler for createResource(). Add the associates, if any.

Specified by:
handleNewBaseObject in interface NewBaseObjectListener
Parameters:
_obj - is the Resource instance which has been created