svn commit: r15204 - branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels: panel ui xml

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: penyaskito
Date: 2008-07-08 08:05:11-0700
New Revision: 15204

Added:
   branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/ActionAddStereotypeBaseClass.java   (contents, props changed)
   branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/ActionDeleteStereotypeBaseClass.java   (contents, props changed)
   branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLExtendedElementsListModel.java   (contents, props changed)
   branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLStereotypeBaseClassListModel.java   (contents, props changed)
   branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLStereotypeTagDefinitionListModel.java   (contents, props changed)
   branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/xml/Stereotype.xml   (contents, props changed)
Modified:
   branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/panel/UIFactory.java

Log:
A panel for Stereotype.

Modified: branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/panel/UIFactory.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/panel/UIFactory.java?view=diff&rev=15204&p1=branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/panel/UIFactory.java&p2=branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/panel/UIFactory.java&r1=15203&r2=15204
==============================================================================
--- branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/panel/UIFactory.java	(original)
+++ branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/panel/UIFactory.java	2008-07-08 08:05:11-0700
@@ -27,6 +27,7 @@
 import java.awt.Dimension;
 import java.io.InputStream;
 
+import javax.swing.DefaultListCellRenderer;
 import javax.swing.JComboBox;
 import javax.swing.JComponent;
 import javax.swing.JLabel;
@@ -36,18 +37,22 @@
 import javax.swing.border.TitledBorder;
 
 import org.apache.log4j.Logger;
+import org.argouml.core.propertypanels.ui.ActionAddStereotypeBaseClass;
+import org.argouml.core.propertypanels.ui.ActionDeleteStereotypeBaseClass;
 import org.argouml.core.propertypanels.ui.UMLClassifierPackageImportsListModel;
 import org.argouml.core.propertypanels.ui.UMLDefaultValueExpressionModel;
 import org.argouml.core.propertypanels.ui.UMLExpressionModel3;
 import org.argouml.core.propertypanels.ui.UMLExpressionPanel;
+import org.argouml.core.propertypanels.ui.UMLExtendedElementsListModel;
 import org.argouml.core.propertypanels.ui.UMLInitialValueExpressionModel;
 import org.argouml.core.propertypanels.ui.UMLMultiplicityPanel;
+import org.argouml.core.propertypanels.ui.UMLStereotypeBaseClassListModel;
+import org.argouml.core.propertypanels.ui.UMLStereotypeTagDefinitionListModel;
 import org.argouml.core.propertypanels.xml.XMLPropertyPanelsData;
 import org.argouml.core.propertypanels.xml.XMLPropertyPanelsDataRecord;
 import org.argouml.core.propertypanels.xml.XMLPropertyPanelsHandler;
 import org.argouml.i18n.Translator;
 import org.argouml.model.Model;
-import org.argouml.uml.ui.PropPanel;
 import org.argouml.uml.ui.ScrollList;
 import org.argouml.uml.ui.UMLCheckBox2;
 import org.argouml.uml.ui.UMLComboBox2;
@@ -338,6 +343,31 @@
             list = new ScrollList(new UMLLinkedList(model, 
                     true, false));
         }
+        else if ("tag_definitions".equals(prop.getName())) {
+            model = new UMLStereotypeTagDefinitionListModel();
+            model.setTarget(target);
+            list = new ScrollList(new UMLLinkedList(model,
+                    true, false));
+        }
+        else if ("base_class".equals(prop.getName())) {
+            model = new UMLStereotypeBaseClassListModel();
+            model.setTarget(target);
+            UMLMutableLinkedList l = new UMLMutableLinkedList(
+                    new UMLStereotypeBaseClassListModel(), 
+                    new ActionAddStereotypeBaseClass(),
+                    null,
+                    new ActionDeleteStereotypeBaseClass(),
+                    true);
+            l.setCellRenderer(new DefaultListCellRenderer());
+            list = new ScrollList(l
+                   );
+        }
+        else if ("extended_elements".equals(prop.getName())) {
+            model = new UMLExtendedElementsListModel();
+            model.setTarget(target);
+            list = new ScrollList( new UMLLinkedList(model, 
+                    true, true));
+        }
 
         if (list != null) {
             String name = prop.getName();

Added: branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/ActionAddStereotypeBaseClass.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/ActionAddStereotypeBaseClass.java?view=auto&rev=15204
==============================================================================
--- (empty file)
+++ branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/ActionAddStereotypeBaseClass.java	2008-07-08 08:05:11-0700
@@ -0,0 +1,118 @@
+// $Id$
+// Copyright (c) 2008 The Regents of the University of California. All
+// Rights Reserved. Permission to use, copy, modify, and distribute this
+// software and its documentation without fee, and without a written
+// agreement is hereby granted, provided that the above copyright notice
+// and this paragraph appear in all copies. This software program and
+// documentation are copyrighted by The Regents of the University of
+// California. The software program and documentation are supplied "AS
+// IS", without any accompanying services from The Regents. The Regents
+// does not warrant that the operation of the program will be
+// uninterrupted or error-free. The end-user understands that the program
+// was developed for research purposes and is advised not to rely
+// exclusively on the program for any reason. IN NO EVENT SHALL THE
+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY
+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+package org.argouml.core.propertypanels.ui;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Set;
+
+import org.argouml.i18n.Translator;
+import org.argouml.model.Model;
+import org.argouml.uml.ui.AbstractActionAddModelElement2;
+
+/**
+ * The Action to add a baseclass to the stereotype.
+ *
+ * @author Michiel
+ */
+public class ActionAddStereotypeBaseClass extends AbstractActionAddModelElement2 {
+
+    private List<String> metaClasses;
+    
+    public ActionAddStereotypeBaseClass() {
+        super();
+        initMetaClasses();
+    }
+    
+    /**
+     * Initialize the meta-classes list. <p>
+     * 
+     * All this code is necessary to be independent of 
+     * model repository implementation, 
+     * i.e. to ensure that we have a 
+     * sorted list of strings.
+     */
+    void initMetaClasses() {
+        Collection<String> tmpMetaClasses = 
+            Model.getCoreHelper().getAllMetatypeNames();
+        if (tmpMetaClasses instanceof List) {
+            metaClasses = (List<String>) tmpMetaClasses;
+        } else {
+            metaClasses = new LinkedList<String>(tmpMetaClasses);
+        }
+        try {
+            Collections.sort(metaClasses);
+        } catch (UnsupportedOperationException e) {
+            // We got passed an unmodifiable List.  Copy it and sort the result
+            metaClasses = new LinkedList<String>(tmpMetaClasses);
+            Collections.sort(metaClasses);
+        }
+    }
+    
+    @Override
+    protected List<String> getChoices() {
+        return Collections.unmodifiableList(metaClasses);
+    }
+
+    @Override
+    protected String getDialogTitle() {
+        return Translator.localize("dialog.title.add-baseclasses");
+    }
+
+    @Override
+    protected List<String> getSelected() {
+        List<String> result = new ArrayList<String>();
+        if (Model.getFacade().isAStereotype(getTarget())) {
+            Collection<String> bases = 
+                Model.getFacade().getBaseClasses(getTarget());
+            result.addAll(bases);
+        }
+        return result;
+    }
+
+    @Override
+    protected void doIt(Collection selected) {
+        Object stereo = getTarget();
+        Set<Object> oldSet = new HashSet<Object>(getSelected());
+        Set toBeRemoved = new HashSet<Object>(oldSet);
+
+        for (Object o : selected) {
+            if (oldSet.contains(o)) {
+                toBeRemoved.remove(o);
+            } else {
+                Model.getExtensionMechanismsHelper()
+                        .addBaseClass(stereo, o);
+            }
+        }
+        for (Object o : toBeRemoved) {
+            Model.getExtensionMechanismsHelper().removeBaseClass(stereo, o);
+        }
+    }
+    
+}

Added: branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/ActionDeleteStereotypeBaseClass.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/ActionDeleteStereotypeBaseClass.java?view=auto&rev=15204
==============================================================================
--- (empty file)
+++ branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/ActionDeleteStereotypeBaseClass.java	2008-07-08 08:05:11-0700
@@ -0,0 +1,57 @@
+// $Id$
+// Copyright (c) 2008 The Regents of the University of California. All
+// Rights Reserved. Permission to use, copy, modify, and distribute this
+// software and its documentation without fee, and without a written
+// agreement is hereby granted, provided that the above copyright notice
+// and this paragraph appear in all copies. This software program and
+// documentation are copyrighted by The Regents of the University of
+// California. The software program and documentation are supplied "AS
+// IS", without any accompanying services from The Regents. The Regents
+// does not warrant that the operation of the program will be
+// uninterrupted or error-free. The end-user understands that the program
+// was developed for research purposes and is advised not to rely
+// exclusively on the program for any reason. IN NO EVENT SHALL THE
+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY
+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+package org.argouml.core.propertypanels.ui;
+
+import java.awt.event.ActionEvent;
+
+import org.argouml.i18n.Translator;
+import org.argouml.model.Model;
+import org.argouml.uml.ui.AbstractActionRemoveElement;
+import org.tigris.gef.undo.UndoManager;
+
+/**
+ * The Action to remove a baseclass from a stereotype.
+ *
+ * @author Michiel
+ */
+public class ActionDeleteStereotypeBaseClass extends AbstractActionRemoveElement {
+
+    public ActionDeleteStereotypeBaseClass() {
+        super(Translator.localize("menu.popup.remove"));
+    }
+
+    @Override
+    public void actionPerformed(ActionEvent e) {
+        UndoManager.getInstance().startChain();
+        Object baseclass = getObjectToRemove();
+        if (baseclass != null) {
+            Object st = getTarget();
+            if (Model.getFacade().isAStereotype(st)) {
+                Model.getExtensionMechanismsHelper().removeBaseClass(st,
+                        baseclass);
+            }
+        }
+    }
+}
\ No newline at end of file

Added: branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLExtendedElementsListModel.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLExtendedElementsListModel.java?view=auto&rev=15204
==============================================================================
--- (empty file)
+++ branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLExtendedElementsListModel.java	2008-07-08 08:05:11-0700
@@ -0,0 +1,63 @@
+// $Id$
+// Copyright (c) 2006 The Regents of the University of California. All
+// Rights Reserved. Permission to use, copy, modify, and distribute this
+// software and its documentation without fee, and without a written
+// agreement is hereby granted, provided that the above copyright notice
+// and this paragraph appear in all copies. This software program and
+// documentation are copyrighted by The Regents of the University of
+// California. The software program and documentation are supplied "AS
+// IS", without any accompanying services from The Regents. The Regents
+// does not warrant that the operation of the program will be
+// uninterrupted or error-free. The end-user understands that the program
+// was developed for research purposes and is advised not to rely
+// exclusively on the program for any reason. IN NO EVENT SHALL THE
+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY
+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+package org.argouml.core.propertypanels.ui;
+
+import org.argouml.model.Model;
+import org.argouml.uml.ui.UMLModelElementListModel2;
+
+/**
+ * The model for the list of extended elements of a stereotype.
+ * 
+ * @author michiel
+ */
+public class UMLExtendedElementsListModel
+    extends UMLModelElementListModel2 {
+    
+    /**
+     * Constructor for UMLExtendedElementsListModel.
+     */
+    public UMLExtendedElementsListModel() {
+        super("extendedElement");
+    }
+    
+    /*
+     * @see org.argouml.uml.ui.UMLModelElementListModel2#buildModelList()
+     */
+    protected void buildModelList() {
+        if (getTarget() != null) {
+            setAllElements(Model.getFacade().getExtendedElements(getTarget()));
+        }
+    }
+    
+    /*
+     * @see org.argouml.uml.ui.UMLModelElementListModel2#isValidElement(Object)
+     */
+    protected boolean isValidElement(Object element) {
+        return Model.getFacade().isAModelElement(element)
+            && Model.getFacade().getExtendedElements(getTarget())
+                .contains(element);
+    }
+
+}
\ No newline at end of file

Added: branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLStereotypeBaseClassListModel.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLStereotypeBaseClassListModel.java?view=auto&rev=15204
==============================================================================
--- (empty file)
+++ branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLStereotypeBaseClassListModel.java	2008-07-08 08:05:11-0700
@@ -0,0 +1,66 @@
+// $Id$
+// Copyright (c) 2008 The Regents of the University of California. All
+// Rights Reserved. Permission to use, copy, modify, and distribute this
+// software and its documentation without fee, and without a written
+// agreement is hereby granted, provided that the above copyright notice
+// and this paragraph appear in all copies. This software program and
+// documentation are copyrighted by The Regents of the University of
+// California. The software program and documentation are supplied "AS
+// IS", without any accompanying services from The Regents. The Regents
+// does not warrant that the operation of the program will be
+// uninterrupted or error-free. The end-user understands that the program
+// was developed for research purposes and is advised not to rely
+// exclusively on the program for any reason. IN NO EVENT SHALL THE
+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY
+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+package org.argouml.core.propertypanels.ui;
+
+import java.util.Collections;
+import java.util.LinkedList;
+
+import org.argouml.model.Model;
+import org.argouml.uml.ui.UMLModelElementListModel2;
+
+/**
+ * The list model for the BaseClasses of the stereotype.
+ *
+ * @author Michiel
+ */
+public class UMLStereotypeBaseClassListModel extends UMLModelElementListModel2 {
+
+    /**
+     * Construct the model, listen to changes of "baseClass".
+     */
+    public UMLStereotypeBaseClassListModel() {
+        super("baseClass");
+    }
+
+    @Override
+    protected void buildModelList() {
+        removeAllElements();
+        if (Model.getFacade().isAStereotype(getTarget())) {
+            // keep them sorted
+            LinkedList<String> lst = new LinkedList<String>(
+                    Model.getFacade().getBaseClasses(getTarget()));
+            Collections.sort(lst);
+            addAll(lst);
+        }
+    }
+
+    @Override
+    protected boolean isValidElement(Object element) {
+        if (Model.getFacade().isAStereotype(element)) {
+            return true;
+        }
+        return false;
+    }
+}
\ No newline at end of file

Added: branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLStereotypeTagDefinitionListModel.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLStereotypeTagDefinitionListModel.java?view=auto&rev=15204
==============================================================================
--- (empty file)
+++ branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/ui/UMLStereotypeTagDefinitionListModel.java	2008-07-08 08:05:11-0700
@@ -0,0 +1,66 @@
+// $Id$
+// Copyright (c) 1996-2006 The Regents of the University of California. All
+// Rights Reserved. Permission to use, copy, modify, and distribute this
+// software and its documentation without fee, and without a written
+// agreement is hereby granted, provided that the above copyright notice
+// and this paragraph appear in all copies.  This software program and
+// documentation are copyrighted by The Regents of the University of
+// California. The software program and documentation are supplied "AS
+// IS", without any accompanying services from The Regents. The Regents
+// does not warrant that the operation of the program will be
+// uninterrupted or error-free. The end-user understands that the program
+// was developed for research purposes and is advised not to rely
+// exclusively on the program for any reason.  IN NO EVENT SHALL THE
+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY
+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+package org.argouml.core.propertypanels.ui;
+
+import org.argouml.model.Model;
+import org.argouml.uml.ui.UMLModelElementListModel2;
+
+/**
+ * The model for the list of TagDefinitions of a stereotype.
+ *
+ * @author [email protected]
+ * @since Oct 11, 2005
+ */
+public class UMLStereotypeTagDefinitionListModel
+    extends UMLModelElementListModel2 {
+
+    /**
+     * Constructor for UMLStereotypeTagDefinitionListModel.
+     */
+    public UMLStereotypeTagDefinitionListModel() {
+        super("definedTag");
+        // TODO: Add referenceValue for tagged values 
+        // which have a non-primitive type
+    }
+
+    /*
+     * @see org.argouml.uml.ui.UMLModelElementListModel2#buildModelList()
+     */
+    protected void buildModelList() {
+        if (getTarget() != null) {
+            setAllElements(Model.getFacade().getTagDefinitions(getTarget()));
+        }
+    }
+
+    /*
+     * @see org.argouml.uml.ui.UMLModelElementListModel2#isValidElement(Object)
+     */
+    protected boolean isValidElement(Object element) {
+        return Model.getFacade().isATagDefinition(element)
+            && Model.getFacade().getTagDefinitions(getTarget())
+            	.contains(element);
+    }
+
+}

Added: branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/xml/Stereotype.xml
Url: http://argouml.tigris.org/source/browse/argouml/branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/xml/Stereotype.xml?view=auto&rev=15204
==============================================================================
--- (empty file)
+++ branches/xmlpropertypanels-penyaskito-soc08/argouml-core-propertypanels-scratch/src/org/argouml/core/propertypanels/xml/Stereotype.xml	2008-07-08 08:05:11-0700
@@ -0,0 +1,18 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<panel>
+	<text name='name' />
+	<combo name='namespace' />
+	<optionbox name='visibility' />
+	<checkgroup name='modifiers'>
+		<checkbox name='abstract' />
+		<checkbox name='leaf' />
+		<checkbox name='root' />
+	</checkgroup>
+	<separator />
+	<list name="client_dependency" />
+	<list name="supplier_dependency" />
+	<list name="tag_definitions" />
+	<separator />
+	<list name='base_class' />
+	<list name='extended_elements' />
+</panel>
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.