ARoad0.gDMak
Class ActionNewView

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

public class ActionNewView
extends javax.swing.AbstractAction
implements Singleton, SelectionDialogListener

An action that creates a new EPR or NoMore-NoLess view with the enter of its base objects by the user. The view name has the structure "view-domain/view-name". This class manages all the dialog boxes required for the user input, controls the inputs, invokes Gui2.Diagram.createEPtoResourceView() that creates the view through the call to gWork.ViewInBase_Facade and gWork.Rights.findRights(), then display the view in a new internal frame

See Also:
Serialized Form

Field Summary
private  javax.swing.JTextField copiedNameField_
           
private  java.awt.Dimension dimension_
           
(package private)  java.lang.Class[] ePRClassArray_
           
private  boolean forNoThanView_
           
private  javax.swing.JTextField groupField_
           
private static int INITIAL_CAPACITY
           
private static ActionNewView instance__
          the only instance of the class, following singleton pattern
private static java.lang.String lineSepar__
           
private  javax.swing.JTextField newNameField_
           
 
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 ActionNewView()
          with this private constructor, the compiler won't generate a default public constructor
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent ev)
          Manages the actions fired from the main menu, and display a dialog box.
 void createExtentedEPRView(ImmutableName _currentViewName, java.util.Set _l_BaseObject)
          Displays a dialog box to let the user enters the view name, when he has clicked on the 'New extended view' in a view, and creates the new view from the BaseObject list.
private  void createView(java.util.Map _validedObjectsSetMap)
          Invoked by handleSelectionDialog().
private  void displayView(ViewInBase _view)
          Called by createView() and by createExtendedEPRView().
static ActionNewView getInstance()
          only public method to get the unique instance
 void handleSelectionDialog(java.util.Map _validatedObjectsSetMap)
          Verifies the user choices (selected eligible parties, resources or virtual folders).
private  boolean showNameDialog(java.lang.String _title, javax.swing.JComponent _lastPanel)
          Displays a dialog box to let the user enters the view type and the view name.
private  void showSelectionDialog()
          Invoked by actionPerformed() to create a selection dialog for entering the user selection of eligible parties, resources or virtual folders.
 
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

instance__

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


INITIAL_CAPACITY

private static final int INITIAL_CAPACITY
See Also:
Constant Field Values

groupField_

private javax.swing.JTextField groupField_

newNameField_

private javax.swing.JTextField newNameField_

copiedNameField_

private javax.swing.JTextField copiedNameField_

dimension_

private java.awt.Dimension dimension_

forNoThanView_

private boolean forNoThanView_

ePRClassArray_

java.lang.Class[] ePRClassArray_

lineSepar__

private static java.lang.String lineSepar__
Constructor Detail

ActionNewView

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

Method Detail

getInstance

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

Returns:
ActionNewView, the unique instance

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent ev)
Manages the actions fired from the main menu, and display a dialog box. A control validates the user inputs (eligible parties and resources selection).

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

showSelectionDialog

private void showSelectionDialog()
Invoked by actionPerformed() to create a selection dialog for entering the user selection of eligible parties, resources or virtual folders. If the name component is null or empty, contains 'ArchitectureOfAcs' or is already known by the base, an error message is displayed. Calls DialogBox.showExplorerSelectionDialog(), which calls back handleSelectionDialog(). Calls createEPRView(). There is no control of space character at the end of the text entered by the user, nor control of the text size.


handleSelectionDialog

public void handleSelectionDialog(java.util.Map _validatedObjectsSetMap)
Verifies the user choices (selected eligible parties, resources or virtual folders). Called from DialogBox.showExplorerSelectionDialog() AFTER a click on an active button, even if the dialog is interrupted. Call createXXXView().

Specified by:
handleSelectionDialog in interface SelectionDialogListener
Parameters:
_validatedObjectsSetMap - Map where the key is a class implementing the BaseObject interface, the value is a List (not a JList) of objects that are instances of the key. Is null or empty if the dialog has been interrupted by the user.

createView

private void createView(java.util.Map _validedObjectsSetMap)
Invoked by handleSelectionDialog(). Includes in the NoThanViewInBase name, the ViewInBase_Facade.NOTHAN_VIEW_INDICATOR string value as a component before the last component. Creates the EPRViewInBase or NoThanViewInBase, and calls displayEPRView() to display its objects.

Parameters:
_validedObjectsSetMap - Map where, if it is not a NoThanViewInBase, the 2 keys are the classes ImmutableEligibleParty and ImmutableResource, the value is a List of objects instances of the key.

displayView

private void displayView(ViewInBase _view)
Called by createView() and by createExtendedEPRView().

Parameters:
_view - to display

createExtentedEPRView

public void createExtentedEPRView(ImmutableName _currentViewName,
                                  java.util.Set _l_BaseObject)
Displays a dialog box to let the user enters the view name, when he has clicked on the 'New extended view' in a view, and creates the new view from the BaseObject list.

Parameters:
_currentViewName - is the name of the current view from which an extended view is created
_l_BaseObject - is the list of the BaseObjects in the view.

showNameDialog

private boolean showNameDialog(java.lang.String _title,
                               javax.swing.JComponent _lastPanel)
Displays a dialog box to let the user enters the view type and the view name. Used by actionPerformed() and createExtentedEPRView(). Calls ACS_Facade.validateFrameName(). Updates groupField_ and newNameField_.

Parameters:
_title - of the dialog box
_lastPanel - contains the name of the copied view. May be null.
Returns:
true if the user has entered the data