svn commit: r18691 - trunk/src/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-08-27 17:41:40-0700
New Revision: 18691

Modified:
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLActivityGraphContextComboBoxModel.java
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLAssociationRoleBaseComboBoxModel.java
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLCallActionOperationComboBoxModel.java
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLCallEventOperationComboBoxModel.java
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLCollaborationRepresentedClassifierComboBoxModel.java
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLCollaborationRepresentedOperationComboBoxModel.java
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLComboBoxModel.java
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLComponentInstanceClassifierComboBoxModel.java
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLGeneralizationPowertypeComboBoxModel.java
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLLinkAssociationComboBoxModel.java
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLMessageActivatorComboBoxModel.java
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLMetaClassComboBoxModel.java
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLMethodSpecificationComboBoxModel.java
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLModelElementNamespaceComboBoxModel.java
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLMultiplicityPanel.java
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLSignalComboBoxModel.java
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLStateMachineContextComboBoxModel.java
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLStructuralFeatureTypeComboBoxModel.java
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLStubStateComboBoxModel.java
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLSubmachineStateComboBoxModel.java
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLTemplateParameterDefaultElementComboBoxModel.java
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLTemplateParameterParameterComboBoxModel.java
   trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLTransitionTriggerComboBoxModel.java

Log:
Make the target immutable on combo boxes

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLActivityGraphContextComboBoxModel.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLActivityGraphContextComboBoxModel.java?view=diff&pathrev=18691&r1=18690&r2=18691
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLActivityGraphContextComboBoxModel.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLActivityGraphContextComboBoxModel.java	2010-08-27 17:41:40-0700
@@ -67,8 +67,7 @@
      * Constructor for UMLStateMachineContextListModel.
      */
     public UMLActivityGraphContextComboBoxModel(String propertyName, final Object target) {
-        super(propertyName, false);
-        setTarget(target);
+        super(target, propertyName, false);
     }
 
     /*

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLAssociationRoleBaseComboBoxModel.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLAssociationRoleBaseComboBoxModel.java?view=diff&pathrev=18691&r1=18690&r2=18691
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLAssociationRoleBaseComboBoxModel.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLAssociationRoleBaseComboBoxModel.java	2010-08-27 17:41:40-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:
@@ -69,8 +69,7 @@
     public UMLAssociationRoleBaseComboBoxModel(
             final String propertyName,
             final Object target) {
-        super(propertyName, true);
-        setTarget(target);
+        super(target, propertyName, true);
     }
 
     /*

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLCallActionOperationComboBoxModel.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLCallActionOperationComboBoxModel.java?view=diff&pathrev=18691&r1=18690&r2=18691
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLCallActionOperationComboBoxModel.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLCallActionOperationComboBoxModel.java	2010-08-27 17:41:40-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:
@@ -65,8 +65,7 @@
     public UMLCallActionOperationComboBoxModel(
             final String propertyName,
             final Object target) {
-        super(propertyName, true);
-        setTarget(target);
+        super(target, propertyName, true);
     }
 
     /**

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLCallEventOperationComboBoxModel.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLCallEventOperationComboBoxModel.java?view=diff&pathrev=18691&r1=18690&r2=18691
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLCallEventOperationComboBoxModel.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLCallEventOperationComboBoxModel.java	2010-08-27 17:41:40-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:
@@ -60,8 +60,7 @@
     public UMLCallEventOperationComboBoxModel(
             final String propertyName,
             final Object target) {
-        super(propertyName, true);
-        setTarget(target);
+        super(target, propertyName, true);
     }
 
     /*

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLCollaborationRepresentedClassifierComboBoxModel.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLCollaborationRepresentedClassifierComboBoxModel.java?view=diff&pathrev=18691&r1=18690&r2=18691
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLCollaborationRepresentedClassifierComboBoxModel.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLCollaborationRepresentedClassifierComboBoxModel.java	2010-08-27 17:41:40-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:
@@ -55,7 +55,7 @@
  * The ComboBox model for the represented classifier 
  * of a collaboration.
  * 
- * @author michiel
+ * @author Michiel van der Wulp
  */
 class UMLCollaborationRepresentedClassifierComboBoxModel
     extends  UMLComboBoxModel {
@@ -66,8 +66,7 @@
     public UMLCollaborationRepresentedClassifierComboBoxModel(
             final String propertyName,
             final Object target) {
-        super(propertyName, true);
-        setTarget(target);
+        super(target, propertyName, true);
     }
     
     /*

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLCollaborationRepresentedOperationComboBoxModel.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLCollaborationRepresentedOperationComboBoxModel.java?view=diff&pathrev=18691&r1=18690&r2=18691
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLCollaborationRepresentedOperationComboBoxModel.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLCollaborationRepresentedOperationComboBoxModel.java	2010-08-27 17:41:40-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:
@@ -61,7 +61,7 @@
     extends  UMLComboBoxModel {
     
     /**
-     * 
+     * The UID
      */
     private static final long serialVersionUID = -501052343770609804L;
 
@@ -71,8 +71,7 @@
     public UMLCollaborationRepresentedOperationComboBoxModel(
             final String propertyName,
             final Object target) {
-        super(propertyName, true);
-        setTarget(target);
+        super(target, propertyName, true);
     }
     
     /*

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLComboBoxModel.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLComboBoxModel.java?view=diff&pathrev=18691&r1=18690&r2=18691
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLComboBoxModel.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLComboBoxModel.java	2010-08-27 17:41:40-0700
@@ -1,6 +1,6 @@
 /* $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
@@ -72,6 +72,11 @@
 abstract class UMLComboBoxModel extends AbstractListModel
         implements PropertyChangeListener, ComboBoxModel, PopupMenuListener {
 
+    /**
+     * The UID
+     */
+    private static final long serialVersionUID = 6038919811554379037L;
+
     private static final Logger LOG = Logger.getLogger(UMLComboBoxModel.class);
 
     /**
@@ -84,7 +89,7 @@
     /**
      * The target of the comboboxmodel. This is some UML modelelement
      */
-    private Object comboBoxTarget = null;
+    private Object target = null;
 
     /**
      * The list with objects that should be shown in the combobox.
@@ -149,16 +154,41 @@
      *            clear the attribute.
      * @throws IllegalArgumentException if one of the arguments is null
      */
-    public UMLComboBoxModel(String name, boolean clearable) {
+    public UMLComboBoxModel(Object target, String name, boolean clearable) {
         super();
         if (name == null || name.equals("")) {
             throw new IllegalArgumentException("A property name must be provided");
         }
+        if (target == null) {
+            throw new IllegalArgumentException("Target cannot be null");
+        }
         // It would be better if we didn't need the container to get
         // the target. This constructor can have zero parameters as
         // soon as we improve targetChanged.
         isClearable = clearable;
         propertySetName = name;
+        modelValid = false;
+            
+        /* Add new listeners: */
+        this.target = target;
+        Model.getPump().addModelEventListener(this, target,
+                propertySetName);
+        // Allow listening to other elements:
+        addOtherModelEventListeners(target);
+        
+        buildingModel = true;
+        buildMinimalModelList();
+        // Do not set buildingModel = false here, 
+        // otherwise the action for selection is performed.
+        setSelectedItem(external2internal(getSelectedModelElement()));
+        buildingModel = false;
+
+        if (getSize() > 0) {
+            fireIntervalAdded(this, 0, getSize() - 1);
+        }
+        if (getSelectedItem() != null && isClearable) {
+            addElement(CLEARED); // makes sure we can select 'none'
+        }
     }
 
     public final void propertyChange(final PropertyChangeEvent pve) {
@@ -314,7 +344,7 @@
      * @return  the ModelElement
      */
     protected Object getTarget() {
-        return comboBoxTarget;
+        return target;
     }
 
     /**
@@ -395,18 +425,18 @@
      * 
      * @param theNewTarget the target
      */
-    protected void setTarget(Object theNewTarget) {
+    final protected void setTarget(Object theNewTarget) {
         assert (getTarget() == null);
         assert (theNewTarget != null);
         modelValid = false;
         LOG.debug("setTarget target :  " + theNewTarget);
             
         /* Add new listeners: */
-        comboBoxTarget = theNewTarget;
-        Model.getPump().addModelEventListener(this, comboBoxTarget,
+        target = theNewTarget;
+        Model.getPump().addModelEventListener(this, target,
                 propertySetName);
         // Allow listening to other elements:
-        addOtherModelEventListeners(comboBoxTarget);
+        addOtherModelEventListeners(target);
         
         buildingModel = true;
         buildMinimalModelList();
@@ -424,9 +454,9 @@
     }
     
     public void removeModelEventListener() {
-        Model.getPump().removeModelEventListener(this, comboBoxTarget,
+        Model.getPump().removeModelEventListener(this, target,
                 propertySetName);
-        removeOtherModelEventListeners(comboBoxTarget);
+        removeOtherModelEventListeners(target);
     }
 
     

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLComponentInstanceClassifierComboBoxModel.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLComponentInstanceClassifierComboBoxModel.java?view=diff&pathrev=18691&r1=18690&r2=18691
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLComponentInstanceClassifierComboBoxModel.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLComponentInstanceClassifierComboBoxModel.java	2010-08-27 17:41:40-0700
@@ -39,8 +39,7 @@
     public UMLComponentInstanceClassifierComboBoxModel(
             final String propertyName,
             final Object target) {
-        super(propertyName, true);
-        setTarget(target);
+        super(target, propertyName, true);
     }
     
     /*

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLGeneralizationPowertypeComboBoxModel.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLGeneralizationPowertypeComboBoxModel.java?view=diff&pathrev=18691&r1=18690&r2=18691
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLGeneralizationPowertypeComboBoxModel.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLGeneralizationPowertypeComboBoxModel.java	2010-08-27 17:41:40-0700
@@ -7,7 +7,7 @@
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *    bobtarling
+ *    Bob Tarling
  *****************************************************************************
  *
  * Some portions of this file was previously release using the BSD License:
@@ -75,10 +75,9 @@
     public UMLGeneralizationPowertypeComboBoxModel(
             final String propertyName,
             final Object target) {
-        super(propertyName, true);
+        super(target, propertyName, true);
         Model.getPump().addClassModelEventListener(this,
                 Model.getMetaTypes().getNamespace(), "ownedElement");
-        setTarget(target);
     }
 
     /*

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLLinkAssociationComboBoxModel.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLLinkAssociationComboBoxModel.java?view=diff&pathrev=18691&r1=18690&r2=18691
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLLinkAssociationComboBoxModel.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLLinkAssociationComboBoxModel.java	2010-08-27 17:41:40-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:
@@ -67,8 +67,7 @@
     public UMLLinkAssociationComboBoxModel(
             final String propertyName,
             final Object target) {
-        super(propertyName, true);
-        setTarget(target);
+        super(target, propertyName, true);
     }
 
     /*

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLMessageActivatorComboBoxModel.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLMessageActivatorComboBoxModel.java?view=diff&pathrev=18691&r1=18690&r2=18691
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLMessageActivatorComboBoxModel.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLMessageActivatorComboBoxModel.java	2010-08-27 17:41:40-0700
@@ -60,8 +60,16 @@
     public UMLMessageActivatorComboBoxModel(
             final String propertyName,
             final Object target) {
-        super(propertyName, false);
-        setTarget(target);
+        super(target, propertyName, false);
+        if (Model.getFacade().isAMessage(target)) {
+            interaction = Model.getFacade().getInteraction(target);
+            if (interaction != null) {
+                Model.getPump().addModelEventListener(
+                    this,
+                    interaction,
+                    "message");
+            }
+        }
     }
 
     /*
@@ -100,24 +108,6 @@
         return null;
     }
     
-    /*
-     * @see org.argouml.uml.ui.UMLComboBoxModel#setTarget(java.lang.Object)
-     */
-    protected void setTarget(Object target) {
-        assert (getTarget() == null);
-        
-        super.setTarget(target);
-        if (Model.getFacade().isAMessage(target)) {
-            interaction = Model.getFacade().getInteraction(target);
-            if (interaction != null) {
-                Model.getPump().addModelEventListener(
-                    this,
-                    interaction,
-                    "message");
-            }
-        }
-    }
-    
     public Action getAction() {
         return null;
     }

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLMetaClassComboBoxModel.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLMetaClassComboBoxModel.java?view=diff&pathrev=18691&r1=18690&r2=18691
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLMetaClassComboBoxModel.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLMetaClassComboBoxModel.java	2010-08-27 17:41:40-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:
@@ -36,7 +36,6 @@
 // CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
 // UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 
-// $header$
 package org.argouml.core.propertypanels.ui;
 
 import java.awt.event.ActionEvent;
@@ -73,7 +72,7 @@
     public UMLMetaClassComboBoxModel(
             final String propertyName,
             final Object target) {
-        super(propertyName, true);
+        super(target, propertyName, true);
         
         Collection<String> tmpMetaClasses =
                 Model.getCoreHelper().getAllMetatypeNames();
@@ -91,7 +90,6 @@
             metaClasses = new LinkedList<String>(tmpMetaClasses);
             Collections.sort(metaClasses);
         }
-        setTarget(target);
     }
 
     /*

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLMethodSpecificationComboBoxModel.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLMethodSpecificationComboBoxModel.java?view=diff&pathrev=18691&r1=18690&r2=18691
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLMethodSpecificationComboBoxModel.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLMethodSpecificationComboBoxModel.java	2010-08-27 17:41:40-0700
@@ -1,6 +1,6 @@
 /* $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
@@ -32,8 +32,7 @@
     public UMLMethodSpecificationComboBoxModel(
             final String propertyName,
             final Object target) {
-        super("specification", false);
-        setTarget(target);
+        super(target, "specification", false);
         Model.getPump().addClassModelEventListener(this,
                 Model.getMetaTypes().getOperation(), "method");
     }

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLModelElementNamespaceComboBoxModel.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLModelElementNamespaceComboBoxModel.java?view=diff&pathrev=18691&r1=18690&r2=18691
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLModelElementNamespaceComboBoxModel.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLModelElementNamespaceComboBoxModel.java	2010-08-27 17:41:40-0700
@@ -77,11 +77,10 @@
     public UMLModelElementNamespaceComboBoxModel(
             final String propertyName,
             final Object target) {
-        super("namespace", true);
+        super(target, "namespace", true);
         assert (target != null);
         Model.getPump().addClassModelEventListener(this,
                 Model.getMetaTypes().getNamespace(), "ownedElement");
-        setTarget(target);
     }
 
     /*

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=18691&r1=18690&r2=18691
==============================================================================
--- 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-27 17:41:40-0700
@@ -62,6 +62,10 @@
  */
 class UMLMultiplicityPanel extends JPanel implements ItemListener {
 
+    /**
+     * The UID
+     */
+    private static final long serialVersionUID = -3087728411434482078L;
     private MultiplicityComboBox multiplicityComboBox;
     private MultiplicityCheckBox checkBox;
     private MultiplicityComboBoxModel multiplicityComboBoxModel;
@@ -84,7 +88,7 @@
         super(new BorderLayout());
         
         multiplicityComboBoxModel =
-            new MultiplicityComboBoxModel(propertyName);
+            new MultiplicityComboBoxModel(target, propertyName);
         
         checkBox = new MultiplicityCheckBox();
         multiplicityComboBox =
@@ -95,7 +99,8 @@
         multiplicityComboBox.addItemListener(this);
         add(checkBox, BorderLayout.WEST);
         add(multiplicityComboBox, BorderLayout.CENTER);
-        setTarget(target);
+        multiplicityComboBox.setTarget(target);
+        checkBox.setTarget(target);
     }
     
     /**
@@ -143,18 +148,6 @@
     }
     
     /**
-     * Sets the target.
-     * @param target
-     */
-    public void setTarget(Object target) {
-        if (getTarget() != target) {
-            multiplicityComboBoxModel.setTarget(target);
-            multiplicityComboBox.setTarget(target);
-            checkBox.setTarget(target);
-        }
-    }
-
-    /**
      * An editable and searchable combobox to edit the multiplicity attribute of
      * some modelelement.
      *
@@ -227,8 +220,10 @@
          *
          * @param propertySetName the name of the property set
          */
-        public MultiplicityComboBoxModel(String propertySetName) {
-            super(propertySetName, false);
+        public MultiplicityComboBoxModel(
+        	final Object target,
+        	final String propertySetName) {
+            super(target, propertySetName, false);
         }
     
         /*

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLSignalComboBoxModel.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLSignalComboBoxModel.java?view=diff&pathrev=18691&r1=18690&r2=18691
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLSignalComboBoxModel.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLSignalComboBoxModel.java	2010-08-27 17:41:40-0700
@@ -1,13 +1,13 @@
-/* $Id: UMLReceptionSignalComboBoxModel.java 17890 2010-01-12 21:21:00Z linus $
+/* $Id: UMLSignalComboBoxModel.java 17890 2010-01-12 21:21:00Z linus $
  *****************************************************************************
- * 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:
@@ -65,10 +65,9 @@
     public UMLSignalComboBoxModel(
         final String propertyName,
         final Object target) {
-        super(propertyName, false);
+        super(target, propertyName, false);
         Model.getPump().addClassModelEventListener(this,
                 Model.getMetaTypes().getNamespace(), propertyName);
-        setTarget(target);
     }
 
     /*

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLStateMachineContextComboBoxModel.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLStateMachineContextComboBoxModel.java?view=diff&pathrev=18691&r1=18690&r2=18691
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLStateMachineContextComboBoxModel.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLStateMachineContextComboBoxModel.java	2010-08-27 17:41:40-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:
@@ -69,8 +69,7 @@
      * Constructor for UMLStateMachineContextListModel.
      */
     public UMLStateMachineContextComboBoxModel(String propertyName, final Object target) {
-        super(propertyName, false);
-        setTarget(target);
+        super(target, propertyName, false);
     }
 
     /*

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLStructuralFeatureTypeComboBoxModel.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLStructuralFeatureTypeComboBoxModel.java?view=diff&pathrev=18691&r1=18690&r2=18691
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLStructuralFeatureTypeComboBoxModel.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLStructuralFeatureTypeComboBoxModel.java	2010-08-27 17:41:40-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:
@@ -73,8 +73,7 @@
     public UMLStructuralFeatureTypeComboBoxModel(
             final String propertyName,
             final Object target) {
-        super(propertyName, true); // Allow null
-        setTarget(target);
+        super(target, propertyName, true); // Allow null
     }
 
     /*

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLStubStateComboBoxModel.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLStubStateComboBoxModel.java?view=diff&pathrev=18691&r1=18690&r2=18691
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLStubStateComboBoxModel.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLStubStateComboBoxModel.java	2010-08-27 17:41:40-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:
@@ -64,8 +64,7 @@
     public UMLStubStateComboBoxModel(
             final String propertyName,
             final Object target) {
-        super(propertyName, true);
-        setTarget(target);
+        super(target, propertyName, true);
     }
 
     /*

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLSubmachineStateComboBoxModel.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLSubmachineStateComboBoxModel.java?view=diff&pathrev=18691&r1=18690&r2=18691
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLSubmachineStateComboBoxModel.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLSubmachineStateComboBoxModel.java	2010-08-27 17:41:40-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:
@@ -65,8 +65,7 @@
     public UMLSubmachineStateComboBoxModel(
             final String propertyName,
             final Object target) {
-        super(propertyName, true);
-        setTarget(target);
+        super(target, propertyName, true);
     }
 
     /*

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLTemplateParameterDefaultElementComboBoxModel.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLTemplateParameterDefaultElementComboBoxModel.java?view=diff&pathrev=18691&r1=18690&r2=18691
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLTemplateParameterDefaultElementComboBoxModel.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLTemplateParameterDefaultElementComboBoxModel.java	2010-08-27 17:41:40-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:
@@ -66,8 +66,7 @@
     public UMLTemplateParameterDefaultElementComboBoxModel(
             final String propertyName,
             final Object target) {
-        super(propertyName, true); // Allow null
-        setTarget(target);
+        super(target, propertyName, true); // Allow null
     }
 
     /*

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLTemplateParameterParameterComboBoxModel.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLTemplateParameterParameterComboBoxModel.java?view=diff&pathrev=18691&r1=18690&r2=18691
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLTemplateParameterParameterComboBoxModel.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLTemplateParameterParameterComboBoxModel.java	2010-08-27 17:41:40-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:
@@ -69,8 +69,7 @@
      * Constructor for UMLStructuralFeatureTypeComboBoxModel.
      */
     public UMLTemplateParameterParameterComboBoxModel(Object target) {
-        super("parameter", true); // Allow null
-        setTarget(target);
+        super(target, "parameter", true); // Allow null
     }
 
     /*

Modified: trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLTransitionTriggerComboBoxModel.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLTransitionTriggerComboBoxModel.java?view=diff&pathrev=18691&r1=18690&r2=18691
==============================================================================
--- trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLTransitionTriggerComboBoxModel.java	(original)
+++ trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLTransitionTriggerComboBoxModel.java	2010-08-27 17:41:40-0700
@@ -28,12 +28,11 @@
 public class UMLTransitionTriggerComboBoxModel extends UMLComboBoxModel {
 
     public UMLTransitionTriggerComboBoxModel(
-        final String propertyName,
-        final Object target) {
-        super(propertyName, false);
+            final String propertyName,
+            final Object target) {
+        super(target, propertyName, false);
         Model.getPump().addClassModelEventListener(this,
                 Model.getMetaTypes().getNamespace(), "ownedElement");
-        setTarget(target);
     }
     
     @SuppressWarnings("unchecked")

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

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.