svn commit: r18138 - trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels: meta model ui

Bob Tarling <[email protected]>
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: bobtarling
Date: 2010-03-22 11:29:58-0700
New Revision: 18138

Removed:
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLExtendExtensionPointListModel.java
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLUseCaseExtensionPointListModel.java
Modified:
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/meta/panels.xml
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/meta/panels2.xml
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/model/GetterSetterManagerImpl.java
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/ListFactory.java

Log:
Allow extension point to be created in panels

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/meta/panels.xml
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/meta/panels.xml?view=diff&pathrev=18138&r1=18137&r2=18138
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/meta/panels.xml	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/meta/panels.xml	2010-03-22 11:29:58-0700
@@ -2404,8 +2404,7 @@
     <list name="feature" type="org.omg.uml.foundation.core.Attribute" label="label.attributes" />
     <list name="feature" type="org.omg.uml.foundation.core.Operation,org.omg.uml.behavioralelements.commonbehavior.Reception" label="label.operations" />
     <list name="association" type="Classifier" />
-    <list name="extensionPoint" type="ExtensionPoint" label="label.extension-points" />
-	
+    <list name="extensionPoint" type="org.omg.uml.behavioralelements.usecases.ExtensionPoint" label="label.extension-points" />
 	<debug />
 	<attribute name="visibility" type="VisibilityKind" />
     <attribute name="targetFlow" type="Flow" />
@@ -2528,7 +2527,7 @@
     <separator /> 
     <singlerow name="base" type="UseCase" />
     <singlerow name="extension" type="UseCase" />
-    <list name="extensionPoint" type="ExtensionPoint" label="label.extension-points" />    
+    <list name="extensionPoint" type="org.omg.uml.behavioralelements.usecases.ExtensionPoint" label="label.extension-points" />
     <separator />
     <textarea name="condition" type="BooleanExpression" />
     

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/meta/panels2.xml
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/meta/panels2.xml?view=diff&pathrev=18138&r1=18137&r2=18138
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/meta/panels2.xml	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/meta/panels2.xml	2010-03-22 11:29:58-0700
@@ -2345,8 +2345,7 @@
     <list name="feature" type="org.eclipse.uml2.uml.Property" label="label.attributes" />
     <list name="feature" type="org.eclipse.uml2.uml.Operation,org.eclipse.uml2.uml.Reception" label="label.operations" />
     <list name="association" type="Classifier" />
-    <list name="extensionPoint" type="ExtensionPoint" label="label.extension-points" />
-	
+    <list name="extensionPoint" type="org.eclipse.uml2.uml.ExtensionPoint" label="label.extension-points" />
 	<debug />
 	<attribute name="visibility" type="VisibilityKind" />
     <attribute name="targetFlow" type="Flow" />

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/model/GetterSetterManagerImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/model/GetterSetterManagerImpl.java?view=diff&pathrev=18138&r1=18137&r2=18138
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/model/GetterSetterManagerImpl.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/model/GetterSetterManagerImpl.java	2010-03-22 11:29:58-0700
@@ -70,6 +70,7 @@
         addGetterSetter("method", new MethodGetterSetter());
         addGetterSetter("message", new MessageGetterSetter());
         addGetterSetter("actualArgument", new ArgumentGetterSetter());
+        addGetterSetter("extensionPoint", new ExtensionPointGetterSetter());
     }
     
     /**
@@ -803,6 +804,42 @@
         }
     }
     
+    
+    private class ExtensionPointGetterSetter extends ListGetterSetter {
+        
+        /**
+         * Get all the extension points
+         * @param modelElement
+         * @param type
+         * @return
+         * @see org.argouml.core.propertypanels.model.GetterSetterManager.OptionGetterSetter#getOptions(java.lang.Object, java.lang.String)
+         */
+        public Collection getOptions(
+                final Object modelElement,
+                final String type) {
+            return Model.getFacade().getExtensionPoints(modelElement);
+        }
+      
+        public Object get(Object modelElement, String type) {
+            // not needed
+            return null;
+        }
+      
+        public void set(Object element, Object x) {
+            // not needed
+        }
+
+        protected boolean isValidElement(
+                final Object element,
+                final String type) {
+            return getOptions(element, type).contains(element);
+        }
+        
+        public Object getMetaType() {
+            return Model.getMetaTypes().getExtensionPoint();
+        }
+    }
+    
     private class ParameterGetterSetter extends ListGetterSetter {
         
         public Collection getOptions(Object modelElement, String type) {

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/ListFactory.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/ListFactory.java?view=diff&pathrev=18138&r1=18137&r2=18138
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/ListFactory.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/ListFactory.java	2010-03-22 11:29:58-0700
@@ -43,7 +43,6 @@
 import javax.swing.JList;
 
 import org.argouml.core.propertypanels.model.GetterSetterManager;
-import org.argouml.model.Model;
 
 /**
  * Creates the XML Property panels
@@ -70,8 +69,6 @@
             model = new UMLClassifierAssociationEndListModel(modelElement);
         } else if ("associationRole".equals(propName)) {
             model = new UMLAssociationAssociationRoleListModel(modelElement);
-//        } else if ("attribute".equals(propName)) {
-//            model = new UMLClassAttributeListModel(modelElement);
         } else if ("availableContents".equals(propName)) {
             model = new UMLClassifierRoleAvailableContentsListModel(modelElement);
         } else if ("availableFeature".equals(propName)) {
@@ -122,14 +119,6 @@
             model = new UMLUseCaseExtendListModel(modelElement);
         } else if ("extended_elements".equals(propName)) {
             model = new UMLExtendedElementsListModel(modelElement);
-        } else if ("extensionPoint".equals(propName)) {
-            if (Model.getFacade().isAUseCase(modelElement)) {
-                model = new UMLUseCaseExtensionPointListModel(modelElement, propName);
-            } else {
-                model = new UMLExtendExtensionPointListModel(modelElement, propName);
-            }
-//        } else if ("feature".equals(propName)) {
-//            model = new UMLClassifierFeatureListModel(modelElement);
         } else if ("generalization".equals(propName)) {
             model = new UMLGeneralizableElementGeneralizationListModel(modelElement);
         } else if ("include".equals(propName)) {

Removed: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLExtendExtensionPointListModel.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLExtendExtensionPointListModel.java?view=markup&pathrev=18137

Removed: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLUseCaseExtensionPointListModel.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLUseCaseExtensionPointListModel.java?view=markup&pathrev=18137

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

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.