svn commit: r18262 - branches/BRANCH_0_30_x: . src/argouml-app src/argouml-app/tests/org/argouml/profile src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/meta src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: linus
Date: 2010-04-14 13:53:39-0700
New Revision: 18262

Modified:
   branches/BRANCH_0_30_x/   (props changed)
   branches/BRANCH_0_30_x/src/argouml-app/   (props changed)
   branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/profile/   (props changed)
   branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/meta/panels.xml
   branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/ListFactory.java
   branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/RowSelector.java
   branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/SingleListFactory.java
   branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLModelElementListModel.java
   branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLStateDoActivityListModel.java
   branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLStateExitListModel.java

Log:
Merging rev 18208 from trunk for Issue: 6041.

Modified: branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/meta/panels.xml
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/meta/panels.xml?view=diff&pathrev=18262&r1=18261&r2=18262
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/meta/panels.xml	(original)
+++ branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/meta/panels.xml	2010-04-14 13:53:39-0700
@@ -2891,10 +2891,10 @@
   </panel>
   <panel name="CompositeState">
     <text name="name" type="Name" />
-	<singlerow name="container" type="CompositeState" />    
+	<singlerow name="container" type="CompositeState" />
     <singlerow name="entry" type="org.omg.uml.behavioralelements.commonbehavior.CallAction,org.omg.uml.behavioralelements.commonbehavior.CreateAction,org.omg.uml.behavioralelements.commonbehavior.DestroyAction,org.omg.uml.behavioralelements.commonbehavior.ReturnAction,org.omg.uml.behavioralelements.commonbehavior.SendAction,org.omg.uml.behavioralelements.commonbehavior.TerminateAction,org.omg.uml.behavioralelements.commonbehavior.UninterpretedAction,org.omg.uml.behavioralelements.commonbehavior.ActionSequence" />
-    <list name="exit" type="Action" />
-    <list name="doActivity" type="Action" label="label.do-activity" />
+    <singlerow name="exit" type="org.omg.uml.behavioralelements.commonbehavior.CallAction,org.omg.uml.behavioralelements.commonbehavior.CreateAction,org.omg.uml.behavioralelements.commonbehavior.DestroyAction,org.omg.uml.behavioralelements.commonbehavior.ReturnAction,org.omg.uml.behavioralelements.commonbehavior.SendAction,org.omg.uml.behavioralelements.commonbehavior.TerminateAction,org.omg.uml.behavioralelements.commonbehavior.UninterpretedAction,org.omg.uml.behavioralelements.commonbehavior.ActionSequence" />
+    <singlerow name="doActivity" type="org.omg.uml.behavioralelements.commonbehavior.CallAction,org.omg.uml.behavioralelements.commonbehavior.CreateAction,org.omg.uml.behavioralelements.commonbehavior.DestroyAction,org.omg.uml.behavioralelements.commonbehavior.ReturnAction,org.omg.uml.behavioralelements.commonbehavior.SendAction,org.omg.uml.behavioralelements.commonbehavior.TerminateAction,org.omg.uml.behavioralelements.commonbehavior.UninterpretedAction,org.omg.uml.behavioralelements.commonbehavior.ActionSequence" label="label.do-activity" />
     <separator />
     <list name="outgoing" type="Transition" />
     <list name="incoming" type="Transition" />
@@ -3033,8 +3033,8 @@
     <text name="name" type="Name" />
     <singlerow name="container" type="CompositeState" />
     <singlerow name="entry" type="org.omg.uml.behavioralelements.commonbehavior.CallAction,org.omg.uml.behavioralelements.commonbehavior.CreateAction,org.omg.uml.behavioralelements.commonbehavior.DestroyAction,org.omg.uml.behavioralelements.commonbehavior.ReturnAction,org.omg.uml.behavioralelements.commonbehavior.SendAction,org.omg.uml.behavioralelements.commonbehavior.TerminateAction,org.omg.uml.behavioralelements.commonbehavior.UninterpretedAction,org.omg.uml.behavioralelements.commonbehavior.ActionSequence" />
-    <list name="exit" type="Action" />
-    <list name="doActivity" type="Action" label="label.do-activity" />
+    <singlerow name="exit" type="org.omg.uml.behavioralelements.commonbehavior.CallAction,org.omg.uml.behavioralelements.commonbehavior.CreateAction,org.omg.uml.behavioralelements.commonbehavior.DestroyAction,org.omg.uml.behavioralelements.commonbehavior.ReturnAction,org.omg.uml.behavioralelements.commonbehavior.SendAction,org.omg.uml.behavioralelements.commonbehavior.TerminateAction,org.omg.uml.behavioralelements.commonbehavior.UninterpretedAction,org.omg.uml.behavioralelements.commonbehavior.ActionSequence" />
+    <singlerow name="doActivity" type="org.omg.uml.behavioralelements.commonbehavior.CallAction,org.omg.uml.behavioralelements.commonbehavior.CreateAction,org.omg.uml.behavioralelements.commonbehavior.DestroyAction,org.omg.uml.behavioralelements.commonbehavior.ReturnAction,org.omg.uml.behavioralelements.commonbehavior.SendAction,org.omg.uml.behavioralelements.commonbehavior.TerminateAction,org.omg.uml.behavioralelements.commonbehavior.UninterpretedAction,org.omg.uml.behavioralelements.commonbehavior.ActionSequence" label="label.do-activity" />
     <list name="deferrableEvent" type="org.omg.uml.behavioralelements.statemachines.CallEvent,org.omg.uml.behavioralelements.statemachines.ChangeEvent,org.omg.uml.behavioralelements.statemachines.SignalEvent,org.omg.uml.behavioralelements.statemachines.TimeEvent" label="label.deferrable" />
     <list name="outgoing" type="Transition" />
     <list name="incoming" type="Transition" />    
@@ -3072,8 +3072,8 @@
     <singlerow name="container" type="CompositeState" />
     <combo name="submachine" type="StateMachine" />
     <singlerow name="entry" type="org.omg.uml.behavioralelements.commonbehavior.CallAction,org.omg.uml.behavioralelements.commonbehavior.CreateAction,org.omg.uml.behavioralelements.commonbehavior.DestroyAction,org.omg.uml.behavioralelements.commonbehavior.ReturnAction,org.omg.uml.behavioralelements.commonbehavior.SendAction,org.omg.uml.behavioralelements.commonbehavior.TerminateAction,org.omg.uml.behavioralelements.commonbehavior.UninterpretedAction,org.omg.uml.behavioralelements.commonbehavior.ActionSequence" />
-    <list name="exit" type="Action" />
-    <list name="doActivity" type="Action" label="label.do-activity" />
+    <singlerow name="exit" type="org.omg.uml.behavioralelements.commonbehavior.CallAction,org.omg.uml.behavioralelements.commonbehavior.CreateAction,org.omg.uml.behavioralelements.commonbehavior.DestroyAction,org.omg.uml.behavioralelements.commonbehavior.ReturnAction,org.omg.uml.behavioralelements.commonbehavior.SendAction,org.omg.uml.behavioralelements.commonbehavior.TerminateAction,org.omg.uml.behavioralelements.commonbehavior.UninterpretedAction,org.omg.uml.behavioralelements.commonbehavior.ActionSequence" />
+    <singlerow name="doActivity" type="org.omg.uml.behavioralelements.commonbehavior.CallAction,org.omg.uml.behavioralelements.commonbehavior.CreateAction,org.omg.uml.behavioralelements.commonbehavior.DestroyAction,org.omg.uml.behavioralelements.commonbehavior.ReturnAction,org.omg.uml.behavioralelements.commonbehavior.SendAction,org.omg.uml.behavioralelements.commonbehavior.TerminateAction,org.omg.uml.behavioralelements.commonbehavior.UninterpretedAction,org.omg.uml.behavioralelements.commonbehavior.ActionSequence" label="label.do-activity" />
     <separator />
     <list name="outgoing" type="Transition" />
     <list name="incoming" type="Transition" />

Modified: branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/ListFactory.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/ListFactory.java?view=diff&pathrev=18262&r1=18261&r2=18262
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/ListFactory.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/ListFactory.java	2010-04-14 13:53:39-0700
@@ -97,14 +97,6 @@
             model = new UMLStereotypeTagDefinitionListModel(modelElement);
         } else if ("deployedComponent".equals(propName)) {
             model = new UMLNodeDeployedComponentListModel(modelElement);
-        } else if ("doActivity".equals(propName)) {
-            model = new UMLStateDoActivityListModel(modelElement);
-            JList l = new UMLStateDoActivityList((UMLModelElementListModel) model);
-            list = new OldScrollList(l);
-        } else if ("exit".equals(propName)) {
-            model = new UMLStateExitListModel(modelElement);
-            JList l = new UMLStateExitList((UMLModelElementListModel) model);
-            list = new OldScrollList(l);
         } else if ("extend".equals(propName)) {
             model = new UMLUseCaseExtendListModel(modelElement);
         } else if ("extended_elements".equals(propName)) {

Modified: branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/RowSelector.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/RowSelector.java?view=diff&pathrev=18262&r1=18261&r2=18262
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/RowSelector.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/RowSelector.java	2010-04-14 13:53:39-0700
@@ -251,13 +251,16 @@
         Object metaType = null;
         List metaTypes = null;
         final Action addAction;
-
+        List<Action> newActions = null;
+        
         if (model instanceof UMLModelElementListModel) {
             // Temporary until SimpleListModel is used for all
             target = ((UMLModelElementListModel) model).getTarget();
             metaType = ((UMLModelElementListModel) model).getMetaType();
             scroll = new OldScrollList(model, 1);
             readonly = Model.getModelManagementHelper().isReadOnly(target);
+            metaTypes = null;
+            newActions = ((UMLModelElementListModel) model).getNewActions();
         } else if (model instanceof org.argouml.core.propertypanels.ui.SimpleListModel) {
             target = ((org.argouml.core.propertypanels.ui.SimpleListModel) model).getUmlElement();
             metaType = ((org.argouml.core.propertypanels.ui.SimpleListModel) model).getMetaType();
@@ -335,6 +338,11 @@
                         actions.add(createAction);
                     }
                 }
+                
+                if (newActions != null) {
+                    actions.addAll(newActions);
+                }
+                
                 if (!actions.isEmpty()) {
                     PopupToolBoxButton tb = new PopupToolBoxButton(actions.get(0), actions.size(), 1, true);
                     for (Action action : actions) {

Modified: branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/SingleListFactory.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/SingleListFactory.java?view=diff&pathrev=18262&r1=18261&r2=18262
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/SingleListFactory.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/SingleListFactory.java	2010-04-14 13:53:39-0700
@@ -39,7 +39,6 @@
 
 import javax.swing.DefaultListModel;
 import javax.swing.JComponent;
-
 import org.argouml.core.propertypanels.model.GetterSetterManager;
 import org.argouml.model.Model;
 
@@ -114,6 +113,10 @@
             model = new UMLTemplateParameterTemplateListModel(modelElement, propName);
         } else if ("parameter".equals(propName)) {
             model = new UMLTemplateParameterParameterListModel(modelElement, propName);
+        } else if ("exit".equals(propName)) {
+            model = new UMLStateExitListModel(modelElement);
+        } else if ("doActivity".equals(propName)) {
+            model = new UMLStateDoActivityListModel(modelElement);
         }
         
         if (model == null) {

Modified: branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLModelElementListModel.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLModelElementListModel.java?view=diff&pathrev=18262&r1=18261&r2=18262
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLModelElementListModel.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLModelElementListModel.java	2010-04-14 13:53:39-0700
@@ -42,6 +42,7 @@
 import java.beans.PropertyChangeListener;
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.Iterator;
 import java.util.List;
 
@@ -741,4 +742,8 @@
     public AbstractActionRemoveElement getRemoveAction() {
         return removeAction;
     }
+    
+    public List<Action> getNewActions() {
+    	return Collections.emptyList();
+    }
 }

Modified: branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLStateDoActivityListModel.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLStateDoActivityListModel.java?view=diff&pathrev=18262&r1=18261&r2=18262
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLStateDoActivityListModel.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLStateDoActivityListModel.java	2010-04-14 13:53:39-0700
@@ -38,7 +38,17 @@
 
 package org.argouml.core.propertypanels.ui;
 
+import java.awt.event.ActionEvent;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.swing.Action;
+
+import org.apache.log4j.Logger;
+import org.argouml.core.propertypanels.ui.UMLStateExitListModel.ActionCreateContainedExitAction;
 import org.argouml.model.Model;
+import org.argouml.ui.targetmanager.TargetManager;
+import org.argouml.uml.ui.AbstractActionNewModelElement;
 import org.argouml.uml.ui.UMLModelElementListModel2;
 
 /**
@@ -46,7 +56,21 @@
  * @author [email protected]
  */
 class UMLStateDoActivityListModel extends UMLModelElementListModel {
+	
+	private static final Logger LOG = Logger.getLogger(UMLStateExitListModel.class);
 
+    private final Object[] metaTypes = new Object[] {
+            Model.getMetaTypes().getCallAction(),
+            Model.getMetaTypes().getCreateAction(),
+            Model.getMetaTypes().getDestroyAction(),
+            Model.getMetaTypes().getReturnAction(),
+            Model.getMetaTypes().getSendAction(),
+            Model.getMetaTypes().getTerminateAction(),
+            Model.getMetaTypes().getUninterpretedAction(),
+            Model.getMetaTypes().getActionSequence()
+        };
+    	
+	
     /**
      * Constructor for UMLStateDoActivityListModel.
      */
@@ -71,5 +95,89 @@
         return element == Model.getFacade().getDoActivity(getTarget());
     }
 
+    public List<Action> getNewActions() {
+    	ArrayList<Action> newActions = new ArrayList<Action>();
+    	for (Object meta : metaTypes) {
+            final String label =
+                "button.new-" + Model.getMetaTypes().getName(meta).toLowerCase();
+            final Action createAction = new ActionCreateContainedExitAction(
+                    meta,
+                    getTarget(),
+                    label);
+            newActions.add(createAction);
+    	}
+    	return newActions;
+    }
+    
+    
+    /**
+     * An action to create a model element to be contained by the 
+     * target model element.
+     *
+     * @author Scott Roberts
+     */
+    public class ActionCreateContainedExitAction
+                extends AbstractActionNewModelElement {
+
+        private Object metaType; 
 
-}
+        /**
+         * Construct the action.
+         * 
+         * @param theMetaType the element to be created
+         * @param target the container that will own the new element
+         */
+        public ActionCreateContainedExitAction(
+                Object theMetaType, 
+                Object target) {
+            this(theMetaType, target,
+                    "button.new-"
+                    + Model.getMetaTypes().getName(theMetaType).toLowerCase());
+        }
+        
+        
+        /**
+         * Construct the action.
+         * 
+         * @param theMetaType the element to be created
+         * @param target the container that will own the new element
+         * @param menuDescr the description for the menu item label.
+         */
+        public ActionCreateContainedExitAction(
+                Object theMetaType, 
+                Object target,
+                String menuDescr) {
+            super(menuDescr);
+            
+            metaType = theMetaType;
+            
+            setTarget(target);
+        }
+
+        public void actionPerformed(ActionEvent e) {            
+            Object t = getTarget();
+            Object action = null;
+            if (Model.getMetaTypes().getCallAction() == metaType) {
+                action = Model.getCommonBehaviorFactory().createCallAction();
+            } else if (Model.getMetaTypes().getCreateAction() == metaType) {
+                action = Model.getCommonBehaviorFactory().createCreateAction();
+            } else if (Model.getMetaTypes().getReturnAction() == metaType) {
+                action = Model.getCommonBehaviorFactory().createReturnAction();
+            } else if (Model.getMetaTypes().getDestroyAction() == metaType) {
+                action = Model.getCommonBehaviorFactory().createDestroyAction();
+            } else if (Model.getMetaTypes().getSendAction() == metaType) {
+                action = Model.getCommonBehaviorFactory().createSendAction();
+            } else if (Model.getMetaTypes().getTerminateAction() == metaType) {
+                action = Model.getCommonBehaviorFactory().createTerminateAction();
+            } else if (Model.getMetaTypes().getUninterpretedAction() == metaType) {
+                action = Model.getCommonBehaviorFactory().createUninterpretedAction();
+            } else if (Model.getMetaTypes().getActionSequence() == metaType) {
+                action = Model.getCommonBehaviorFactory().createActionSequence();
+            } else {
+            	throw new IllegalStateException(metaType + " not recognised as an Action");
+            }
+            Model.getStateMachinesHelper().setDoActivity(t, action);
+            TargetManager.getInstance().setTarget(action);
+        }
+    }
+}
\ No newline at end of file

Modified: branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLStateExitListModel.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLStateExitListModel.java?view=diff&pathrev=18262&r1=18261&r2=18262
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLStateExitListModel.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLStateExitListModel.java	2010-04-14 13:53:39-0700
@@ -38,15 +38,37 @@
 
 package org.argouml.core.propertypanels.ui;
 
+import java.awt.event.ActionEvent;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.swing.Action;
+
+import org.apache.log4j.Logger;
 import org.argouml.model.Model;
-import org.argouml.uml.ui.UMLModelElementListModel2;
+import org.argouml.ui.targetmanager.TargetManager;
+import org.argouml.uml.ui.AbstractActionNewModelElement;
 
 /**
  * @since Dec 14, 2002
  * @author [email protected]
  */
 class UMLStateExitListModel extends UMLModelElementListModel {
+	
+	private static final Logger LOG = Logger.getLogger(UMLStateExitListModel.class);
 
+    private final Object[] metaTypes = new Object[] {
+        Model.getMetaTypes().getCallAction(),
+        Model.getMetaTypes().getCreateAction(),
+        Model.getMetaTypes().getDestroyAction(),
+        Model.getMetaTypes().getReturnAction(),
+        Model.getMetaTypes().getSendAction(),
+        Model.getMetaTypes().getTerminateAction(),
+        Model.getMetaTypes().getUninterpretedAction(),
+        Model.getMetaTypes().getActionSequence()
+    };
+	
+	
     /**
      * Constructor for UMLStateExitListModel.
      */
@@ -58,7 +80,7 @@
     /*
      * @see org.argouml.uml.ui.UMLModelElementListModel2#buildModelList()
      */
-    protected void buildModelList() {
+    public void buildModelList() {
         removeAllElements();
         addElement(Model.getFacade().getExit(getTarget()));
     }
@@ -66,8 +88,97 @@
     /*
      * @see org.argouml.uml.ui.UMLModelElementListModel2#isValidElement(Object)
      */
-    protected boolean isValidElement(Object element) {
+    public boolean isValidElement(Object element) {
         return element == Model.getFacade().getExit(getTarget());
     }
+    
+    public List<Object> getMetaTypes() {
+    	return null;
+    }
 
+    public List<Action> getNewActions() {
+    	ArrayList<Action> newActions = new ArrayList<Action>();
+    	for (Object meta : metaTypes) {
+            final String label =
+                "button.new-" + Model.getMetaTypes().getName(meta).toLowerCase();
+            final Action createAction = new ActionCreateContainedExitAction(
+                    meta,
+                    getTarget(),
+                    label);
+            newActions.add(createAction);
+    	}
+    	return newActions;
+    }
+    
+    
+    /**
+     * An action to create a model element to be contained by the 
+     * target model element.
+     *
+     * @author Scott Roberts
+     */
+    public class ActionCreateContainedExitAction
+                extends AbstractActionNewModelElement {
+
+        private Object metaType; 
+
+        /**
+         * Construct the action.
+         * 
+         * @param theMetaType the element to be created
+         * @param target the container that will own the new element
+         */
+        public ActionCreateContainedExitAction(
+                Object theMetaType, 
+                Object target) {
+            this(theMetaType, target,
+                    "button.new-"
+                    + Model.getMetaTypes().getName(theMetaType).toLowerCase());
+        }
+        
+        
+        /**
+         * Construct the action.
+         * 
+         * @param theMetaType the element to be created
+         * @param target the container that will own the new element
+         * @param menuDescr the description for the menu item label.
+         */
+        public ActionCreateContainedExitAction(
+                Object theMetaType, 
+                Object target,
+                String menuDescr) {
+            super(menuDescr);
+            
+            metaType = theMetaType;
+            
+            setTarget(target);
+        }
+
+        public void actionPerformed(ActionEvent e) {            
+            Object t = getTarget();
+            Object action = null;
+            if (Model.getMetaTypes().getCallAction() == metaType) {
+                action = Model.getCommonBehaviorFactory().createCallAction();
+            } else if (Model.getMetaTypes().getCreateAction() == metaType) {
+                action = Model.getCommonBehaviorFactory().createCreateAction();
+            } else if (Model.getMetaTypes().getReturnAction() == metaType) {
+                action = Model.getCommonBehaviorFactory().createReturnAction();
+            } else if (Model.getMetaTypes().getDestroyAction() == metaType) {
+                action = Model.getCommonBehaviorFactory().createDestroyAction();
+            } else if (Model.getMetaTypes().getSendAction() == metaType) {
+                action = Model.getCommonBehaviorFactory().createSendAction();
+            } else if (Model.getMetaTypes().getTerminateAction() == metaType) {
+                action = Model.getCommonBehaviorFactory().createTerminateAction();
+            } else if (Model.getMetaTypes().getUninterpretedAction() == metaType) {
+                action = Model.getCommonBehaviorFactory().createUninterpretedAction();
+            } else if (Model.getMetaTypes().getActionSequence() == metaType) {
+                action = Model.getCommonBehaviorFactory().createActionSequence();
+            } else {
+            	throw new IllegalStateException(metaType + " not recognised as an Action");
+            }
+            Model.getStateMachinesHelper().setExit(t, action);
+            TargetManager.getInstance().setTarget(action);
+        }
+    }
 }

------------------------------------------------------
http://argouml.tigris.org/ds/viewMessage.do?dsForumId=5905&dsMessageId=2582807

To unsubscribe from this discussion, e-mail: [[email protected]].
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.