svn commit: r18324 - trunk/src: argouml-app/src/org/argouml/application/helpers argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/meta argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/model argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: bobtarling
Date: 2010-04-22 04:33:25-0700
New Revision: 18324

Removed:
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLEnumerationLiteralsListModel.java
Modified:
   trunk/src/argouml-app/src/org/argouml/application/helpers/ResourceLoaderWrapper.java
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/meta/panels.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:
Use standard mechanism for enumeration literals list so that we get control buttons

Modified: trunk/src/argouml-app/src/org/argouml/application/helpers/ResourceLoaderWrapper.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/application/helpers/ResourceLoaderWrapper.java?view=diff&pathrev=18324&r1=18323&r2=18324
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/application/helpers/ResourceLoaderWrapper.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/application/helpers/ResourceLoaderWrapper.java	2010-04-22 04:33:25-0700
@@ -402,7 +402,7 @@
         images.put("button.new-dependency", "Dependency");
         images.put("button.new-destroyaction", "DestroyAction");
         images.put("button.new-enumeration", "Enumeration");
-        images.put("button.new-enumeration-literal", "EnumerationLiteral");
+        images.put("button.new-enumerationliteral", "EnumerationLiteral");
         images.put("button.new-extension-point", "New Extension Point");
         images.put("button.new-extend", "Extend");
         images.put("button.new-exception", "Exception");

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=18324&r1=18323&r2=18324
==============================================================================
--- 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-04-22 04:33:25-0700
@@ -1196,7 +1196,7 @@
     <list name="specialization" type="GeneralizableElement" />
 	<separator />
     <list name="feature" type="org.omg.uml.foundation.core.Operation,org.omg.uml.behavioralelements.commonbehavior.Reception" label="label.operations" />
-	<list name="literal" type="EnumerationLiteral" label="label.literals" />
+	<list name="literal" type="org.omg.uml.foundation.core.EnumerationLiteral" label="label.literals" />
 
 	<debug />
     <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=18324&r1=18323&r2=18324
==============================================================================
--- 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-04-22 04:33:25-0700
@@ -78,6 +78,7 @@
         addGetterSetter("parameter", new ParameterGetterSetter());
         addGetterSetter("receiver", new ReceiverGetterSetter());
         addGetterSetter("sender", new SenderGetterSetter());
+        addGetterSetter("literal", new LiteralGetterSetter());
         addGetterSetter("body", new MethodExpressionGetterSetter());
         addGetterSetter("ownedElement", new OwnedElementGetterSetter());
         addGetterSetter("raisedSignal", new RaisedExceptionGetterSetter());
@@ -1698,6 +1699,31 @@
         }
     }
     
+    private class LiteralGetterSetter extends ListGetterSetter {
+        
+        public Collection getOptions(Object modelElement, String type) {
+            return Model.getFacade().getEnumerationLiterals(modelElement);
+        }
+      
+        public Object get(Object modelElement, String type) {
+            // not needed
+            return null;
+        }
+      
+        public void set(Object element, Object x) {
+            // not needed
+        }
+
+        public boolean isValidElement(Object element, String type) {
+          
+            return getOptions(element, type).contains(element);
+        }
+        
+        public Object getMetaType() {
+            return Model.getMetaTypes().getEnumerationLiteral();
+        }
+    }
+    
     private class ReceiverGetterSetter 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=18324&r1=18323&r2=18324
==============================================================================
--- 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-04-22 04:33:25-0700
@@ -107,8 +107,6 @@
             model = new UMLCreateActionClassifierListModel(modelElement);
         } else if ("link".equals(propName)) {
             model = new UMLAssociationLinkListModel(modelElement);
-        } else if ("literal".equals(propName)) {
-            model = new UMLEnumerationLiteralsListModel(modelElement);
         } else if ("outgoing".equals(propName)) {
             model = new UMLStateVertexOutgoingListModel(modelElement);
         } else if ("partition".equals(propName)) {

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

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

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.