ARoad0.gDMak
Class ActionCopy

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

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

An action that copies a view in a new instance with a new name, and saves it then opens it.

See Also:
Serialized Form

Field Summary
private static java.lang.String currentDir__
           
protected  Directory dirToCopy_
          The object to copy, only if it is a Directory.
private static java.lang.String fileSepar__
           
protected  GroupID groupToCopy_
          The object to copy, only if it is a GroupID.
protected static int INITIAL_CAPACITY
           
private static ActionCopy instance__
           
private static java.lang.String lineSepar__
           
protected  BaseObject source_
          The value of the copy source.
private static java.lang.String userDir__
           
 
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 ActionCopy()
          with this private constructor, the compiler won't generate a default public constructor
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent _ev)
          Copies the selected frame object.
 void copyACSorView(ImmutableName _name)
          For a view only, copies, saves and opens it.
static ActionCopy getInstance()
          constructor()
 BaseObject getSource()
          Gets the value of the copy source.
 void handleNewBaseObject(BaseObject _obj)
          This method is called from actionPerformed().
 
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

INITIAL_CAPACITY

protected static final int INITIAL_CAPACITY
See Also:
Constant Field Values

instance__

private static ActionCopy instance__

currentDir__

private static java.lang.String currentDir__

userDir__

private static java.lang.String userDir__

fileSepar__

private static java.lang.String fileSepar__

lineSepar__

private static java.lang.String lineSepar__

dirToCopy_

protected Directory dirToCopy_
The object to copy, only if it is a Directory.


groupToCopy_

protected GroupID groupToCopy_
The object to copy, only if it is a GroupID.


source_

protected BaseObject source_
The value of the copy source.

Constructor Detail

ActionCopy

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

Method Detail

getInstance

public static ActionCopy getInstance()
constructor()


getSource

public BaseObject getSource()
Gets the value of the copy source.

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

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent _ev)
Copies the selected frame object. No action if another user dialog is currently open. Manages the actions fired from: - from 'View Copy' in the main menu when, in the explorer, an object is selected A control validates the selected frame or node by verifying if it is associated to a right object.

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

copyACSorView

public void copyACSorView(ImmutableName _name)
For a view only, copies, saves and opens it.

Parameters:
_name - of the ACS or view

handleNewBaseObject

public void handleNewBaseObject(BaseObject _obj)
This method is called from actionPerformed(). It is active only for GroupIDImpl and DirectoryImpl copy: - when _obj is a GroupIDImpl, calls BaseUtilityImpl.copyGroupMembers() to copy all the direct and indirect groupToCopy_ members, then registers the current ACSTreeBaseListenerImpls as listeners for the 'l_Members' bound property of each GroupID, and to register all the groupToCopy_ GroupIDMembers in _obj. - when _obj is a DirectoryImpl, to copy all the children and children of children with the standard copy() method of the Copyable interface.

Called by BaseObjectHandler for actionPerformed().

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