ARoad0.Gui1
Class BaseObjectMapPropertyEditor

java.lang.Object
  extended by ARoad0.Gui1.SimplePropertyEditor
      extended by ARoad0.Gui1.StringMapPropertyEditor
          extended by ARoad0.Gui1.BaseObjectMapPropertyEditor
All Implemented Interfaces:
CommonPropertyEditor, NewBaseObjectListener, SelectionDialogListener, MVC_Controller, MVC_View, java.awt.event.ActionListener, java.beans.PropertyChangeListener, java.beans.PropertyEditor, java.util.EventListener, javax.swing.event.ListSelectionListener
Direct Known Subclasses:
RightMapPropertyEditor

public class BaseObjectMapPropertyEditor
extends StringMapPropertyEditor

This class is responsible for displaying, by the mean of panels, a modifiable property map of a gBase JavaBean, for which the type is a Map or a Map. The keys may be very structured strings. It completes CollectionPropertyEditor and StringMapPropertyEditor. CollectionPropertyEditor handles more complex types but handles maps only as collections of values. StringMapPropertyEditor is for all-String maps. The updating is never done through a write method or a 'choiceMethodForNew' in the property descriptor, but through 'add/remove' methods defined in the property descriptor. This class is a type of merging of CollectionPropertyEditor, for the buttons handling, and its super class StringMapPropertyEditor, for the map handling. To set the ImmutableNames as items in the map values, the property descriptor uses the parameter 'selectedTypeInGroup' which defines the type of the BaseObject to select in the explorer for adding a new item in a map value.

This class is specified by the BeanInfo classes for the property descriptors of ResourceImpl and ACSFactoryImpl. It is called by Gui1.BeamerManager.addPropertyEditor().


Field Summary
 
Fields inherited from class ARoad0.Gui1.StringMapPropertyEditor
addMethod_, boundComponentTwo_, keyScrollPane_, keysModel_, keysUpdateInMap_, limitedValuesMethod_, maxKeySize_, maxValueSize_, propertyTypeInGroup_, removeMethod_, selectedTypeInGroup_, valueScrollPane_, valuesModel_
 
Fields inherited from class ARoad0.Gui1.SimplePropertyEditor
boundComponent_, displayName_, EMPTY_INSTANCE, EMPTY_OBJECT, INITIAL_CAPACITY, isRestrictedArgument_, listeners_, propertyDescriptor_, propertyType_, readMethod_, source_, sourceBeanInfo_, writeMethod_
 
Fields inherited from interface ARoad0.Gui1.CommonPropertyEditor
BOOLEAN_FIELD_DIMENSION, BOOLEAN_NAME_DIMENSION, BUTTON_DIMENSION, BUTTON_DIMENSION_2, BUTTON_DIMENSION_3, COLOMN_DIMENSION, COMBOBOX_FIELD_DIMENSION, EMPTY_FIELD_DIMENSION, HEIGHT_DIMENSION, INT_EMPTY_FIELD_DIMENSION, INT_FIELD_DIMENSION, LIST_HEIGHT_DIMENSION, LIST_WIDTH_DIMENSION, MAP_NAME_WIDTH_DIMENSION, NAME_DIMENSION, NAME_MAP_DIMENSION, NAME_WIDTH_DIMENSION, NAME_WIDTH_DIMENSION_2, NO_BUTTON_FIELD_DIMENSION, NO_BUTTON_WIDTH_DIMENSION, ONE_BUTTON_FIELD_DIMENSION, THREE_BUTTONS_FIELD_DIMENSION, TWO_BUTTONS_FIELD_DIMENSION
 
Constructor Summary
BaseObjectMapPropertyEditor()
          Constructor FOR USE ONLY through the valueOf() method, EMPTY_INSTANCE and the subclasses.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent _evt)
          Manages the events fired by the buttons 'New' and 'Delete' for the map keys, and 'See', 'Previous', 'Select', 'Remove' for the map values, in the JPanel displayed by getCustomEditor().
 void finalizeForProcess()
          Finalizes the instance; the call is reserved to BeamerManager.
 void handleSelectionDialog(java.util.Map _validatedObjectsSetMap)
          Called by DialogBox.showExplorerSelectionDialog() for actionPerformed(), when a value has to be selected in the explorer through the button 'Select'.
 java.lang.String toString()
          Get the values of variables for the instance.
static CommonPropertyEditor valueOf(BaseObject _source, java.beans.PropertyDescriptor _propertyDescriptor)
          Factory method to use when a BaseObjectMapPropertyEditor is delegating to us.
 
Methods inherited from class ARoad0.Gui1.StringMapPropertyEditor
addKeyElement, addRestrictedValueElements, addValueElements, changeDimensions, getAsText, getCustomEditor, getMaximumValuesListSize, propertyChange, removeValueElements, setAsText, setKeysModel, setPanelDimension, setValue, setValuesModel, valueChanged, viewElement
 
Methods inherited from class ARoad0.Gui1.SimplePropertyEditor
addPropertyChangeListener, getButtonsDisplaying, getDisplayName, getJavaInitializationString, getKnownValuesForNewElement, getNameFromDetailledName, getPreferedSizeForEditing, getPropertyDescriptor, getPropertyType, getRestrictedValues, getSource, getTags, getValue, getWriteMethod, handleNewBaseObject, isPaintable, paintValue, removePropertyChangeListener, setListPanelDimension, setVerticalButtonsInEditor, supportsCustomEditor, viewOneElement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BaseObjectMapPropertyEditor

BaseObjectMapPropertyEditor()
Constructor FOR USE ONLY through the valueOf() method, EMPTY_INSTANCE and the subclasses.

Method Detail

valueOf

public static CommonPropertyEditor valueOf(BaseObject _source,
                                           java.beans.PropertyDescriptor _propertyDescriptor)
                                    throws java.lang.NullPointerException,
                                           ProcessError
Factory method to use when a BaseObjectMapPropertyEditor is delegating to us. It constructs the read method for the property, from the BeanInfo information. The property must be a map of Strings as keys, and a BaseObject array or an ImmutableNames array as values. Overrides the StringMapPropertyEditor method and calls it. Called by BeamerManager.addPropertyEditor() and by RightMapPropertyEditor.

Parameters:
_source - owning the property.
_propertyDescriptor - is the descriptor of the property
Returns:
a BaseObjectMapPropertyEditor instance
Throws:
java.lang.NullPointerException - if _source or _displayName is null
ProcessError - if BeanInfo and PropertyDecriptor calls fail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent _evt)
Manages the events fired by the buttons 'New' and 'Delete' for the map keys, and 'See', 'Previous', 'Select', 'Remove' for the map values, in the JPanel displayed by getCustomEditor(). Calls DialogBox.showExplorerSelectionDialog() and addRestrictedBaseObjectValueElement(). Overrides the super method, and calls its methods for the buttons 'New', 'Delete', 'Remove'. Called by RightMapPropertyEditor.

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Overrides:
actionPerformed in class StringMapPropertyEditor
Parameters:
_evt - is the event fired by a button

handleSelectionDialog

public void handleSelectionDialog(java.util.Map _validatedObjectsSetMap)
Called by DialogBox.showExplorerSelectionDialog() for actionPerformed(), when a value has to be selected in the explorer through the button 'Select'. Since the value type is ImmutableName, this method operates the the conversion. Used by the subclass RightMapPropertyEditor. Call StringMapPropertyEditor.addValueElements().

Specified by:
handleSelectionDialog in interface SelectionDialogListener
Overrides:
handleSelectionDialog in class SimplePropertyEditor
Parameters:
_validatedObjectsSetMap - with one element, where - the key is selectedTypeInGroup_, - the value is a List of one selected object. May be null or empty if the user cancels the operation.

toString

public java.lang.String toString()
Get the values of variables for the instance.

Overrides:
toString in class StringMapPropertyEditor
Returns:
source, propertyName and listeners (if they have toString() methods).

finalizeForProcess

public void finalizeForProcess()
Finalizes the instance; the call is reserved to BeamerManager.

Specified by:
finalizeForProcess in interface CommonPropertyEditor
Overrides:
finalizeForProcess in class StringMapPropertyEditor