Author: bobtarling
Date: 2010-07-21 07:21:33-0700
New Revision: 18544

Modified:
   
trunk/src/argouml-app/src/org/argouml/ui/ActionCreateContainedModelElement.java

Log:
Add an additional constructor that can take a property name

Modified: 
trunk/src/argouml-app/src/org/argouml/ui/ActionCreateContainedModelElement.java
Url: 
http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/ui/ActionCreateContainedModelElement.java?view=diff&pathrev=18544&r1=18543&r2=18544
==============================================================================
--- 
trunk/src/argouml-app/src/org/argouml/ui/ActionCreateContainedModelElement.java 
    (original)
+++ 
trunk/src/argouml-app/src/org/argouml/ui/ActionCreateContainedModelElement.java 
    2010-07-21 07:21:33-0700
@@ -53,7 +53,8 @@
 public class ActionCreateContainedModelElement
             extends AbstractActionNewModelElement {
 
-    private Object metaType; 
+    final private Object metaType; 
+    final private String property; 
 
     /**
      * Construct the action.
@@ -84,13 +85,34 @@
         super(menuDescr);
         
         metaType = theMetaType;
+        property = null;
+        
+        setTarget(target);
+    }
+
+    /**
+     * 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 ActionCreateContainedModelElement(
+            Object theMetaType, 
+            Object target,
+            String property,
+            String menuDescr) {
+        super(menuDescr);
+        
+        metaType = theMetaType;
+        this.property = property;
         
         setTarget(target);
     }
 
     public void actionPerformed(ActionEvent e) {            
-        Object newElement = Model.getUmlFactory().buildNode(metaType, 
-                getTarget());
+        Object newElement =
+            Model.getUmlFactory().buildNode(metaType, getTarget(), property);
             
         TargetManager.getInstance().setTarget(newElement);                
     }

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

To unsubscribe from this discussion, e-mail: 
[[email protected]].

Reply via email to