svn commit: r18694 - trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLMultiplicityPanel.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: bobtarling
Date: 2010-08-28 01:49:06-0700
New Revision: 18694

Modified:
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLMultiplicityPanel.java

Log:
The combo and checkbox control their own state

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLMultiplicityPanel.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLMultiplicityPanel.java?view=diff&pathrev=18694&r1=18693&r2=18694
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLMultiplicityPanel.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLMultiplicityPanel.java	2010-08-28 01:49:06-0700
@@ -1,13 +1,13 @@
 /* $Id$
  *****************************************************************************
- * Copyright (c) 2009 Contributors - see below
+ * Copyright (c) 2009-2010 Contributors - see below
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *    bobtarling
+ *    Bob Tarling
  *****************************************************************************
  *
  * Some portions of this file was previously release using the BSD License:
@@ -103,7 +103,6 @@
         multiplicityComboBox.addItemListener(this);
         add(checkBox, BorderLayout.WEST);
         add(multiplicityComboBox, BorderLayout.CENTER);
-        multiplicityComboBox.setTarget(target);
     }
     
     /**
@@ -165,13 +164,19 @@
         private static final long serialVersionUID = -5860730478954634611L;
 
         /**
-         * Constructor for UMLMultiplicityComboBox2.
-         * @param arg0 the combobox model
+         * Constructor for MultiplicityComboBox.
+         * @param arg0 the model
          * @param selectAction the action
          */
-        public MultiplicityComboBox(UMLComboBoxModel model,
+        public MultiplicityComboBox(
+        	MultiplicityComboBoxModel model,
                 Action selectAction) {
             super(model, selectAction);
+            final Object target = model.getTarget();
+	    final boolean exists =
+		(Model.getFacade().getMultiplicity(target) != null);
+	    setEnabled(exists);
+	    setEditable(exists);
         }
 
         /**
@@ -201,14 +206,6 @@
                 getEditor().setItem(getSelectedItem());
             }
         }
-
-	public void setTarget(Object target) {
-	    boolean exists = (target != null 
-	        && Model.getFacade().getMultiplicity(target) != null);
-	    multiplicityComboBox.setEnabled(exists);
-	    multiplicityComboBox.setEditable(exists);
-	    checkBox.setSelected(exists);
-	}
     }
     
     
@@ -219,6 +216,11 @@
         extends UMLComboBoxModel {
 
         /**
+	 * The UID
+	 */
+	private static final long serialVersionUID = 1096137101625304715L;
+
+	/**
          * Constructor for UMLMultiplicityComboBoxModel.
          *
          * @param propertySetName the name of the property set

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

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.