org.argouml.uml.ui
Class AbstractActionAddModelElement2

java.lang.Object
  extended by UndoableAction
      extended by org.argouml.uml.ui.AbstractActionAddModelElement2
Direct Known Subclasses:
ActionAddAssociationSpecification, ActionAddClassifierRoleBase, ActionAddClientDependencyAction, ActionAddContextSignal, ActionAddCreateActionInstantiation, ActionAddEventAsDeferrableEvent, ActionAddEventAsTrigger, ActionAddExtendExtensionPoint, ActionAddInstanceClassifier, ActionAddMessagePredecessor, ActionAddSupplierDependencyAction

public abstract class AbstractActionAddModelElement2
extends UndoableAction

Abstract action that is the parent to all add actions that add the modelelements via the UMLAddDialog.

Since:
Oct 2, 2002

Constructor Summary
protected AbstractActionAddModelElement2()
          Construct an action to add a model element to some list.
  AbstractActionAddModelElement2(java.lang.String name)
          Construct a named action to add a model element to some list.
  AbstractActionAddModelElement2(java.lang.String name, javax.swing.Icon icon)
          Construct an action to add a model element to some list with the given name and icon.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
           
protected abstract  void doIt(java.util.Collection selected)
          The action that has to be done by ArgoUml after the user clicks ok in the UMLAddDialog.
protected abstract  java.util.List getChoices()
          Returns the choices the user has in the UMLAddDialog.
protected abstract  java.lang.String getDialogTitle()
          Returns the title of the dialog.
protected abstract  java.util.List getSelected()
          The modelelements already selected BEFORE the dialog is shown.
protected  java.lang.Object getTarget()
          Returns the UML model target.
 boolean isEnabled()
           
 boolean isExclusive()
          Returns the exclusive.
 boolean isMultiSelect()
          Returns the multiSelect.
 void setExclusive(boolean theExclusive)
          Sets the exclusive.
 void setMultiSelect(boolean theMultiSelect)
          Sets the multiSelect.
 void setTarget(java.lang.Object theTarget)
          Sets the UML model target.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractActionAddModelElement2

protected AbstractActionAddModelElement2()
Construct an action to add a model element to some list.


AbstractActionAddModelElement2

public AbstractActionAddModelElement2(java.lang.String name)
Construct a named action to add a model element to some list.

Parameters:
name - name for action

AbstractActionAddModelElement2

public AbstractActionAddModelElement2(java.lang.String name,
                                      javax.swing.Icon icon)
Construct an action to add a model element to some list with the given name and icon.

Parameters:
name - name for action
icon - icon for action
Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)

getChoices

protected abstract java.util.List getChoices()
Returns the choices the user has in the UMLAddDialog. The choices are depicted on the left side of the UMLAddDialog (sorry Arabic users) and can be moved via the buttons on the dialog to the right side. On the right side are the selected modelelements.

Returns:
List of choices

getSelected

protected abstract java.util.List getSelected()
The modelelements already selected BEFORE the dialog is shown.

Returns:
List of model elements

doIt

protected abstract void doIt(java.util.Collection selected)
The action that has to be done by ArgoUml after the user clicks ok in the UMLAddDialog.

Parameters:
selected - The choices the user has selected in the UMLAddDialog

isEnabled

public boolean isEnabled()

getTarget

protected java.lang.Object getTarget()
Returns the UML model target.

Returns:
UML ModelElement

setTarget

public void setTarget(java.lang.Object theTarget)
Sets the UML model target.

Parameters:
theTarget - The target to set

getDialogTitle

protected abstract java.lang.String getDialogTitle()
Returns the title of the dialog.

Returns:
String

isExclusive

public boolean isExclusive()
Returns the exclusive.

Returns:
boolean

isMultiSelect

public boolean isMultiSelect()
Returns the multiSelect.

Returns:
boolean

setExclusive

public void setExclusive(boolean theExclusive)
Sets the exclusive.

Parameters:
theExclusive - The exclusive to set

setMultiSelect

public void setMultiSelect(boolean theMultiSelect)
Sets the multiSelect.

Parameters:
theMultiSelect - The multiSelect to set


ArgoUML © 1996-2006ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook