Author: thn
Date: 2010-06-10 13:01:30-0700
New Revision: 18442
Modified:
trunk/src/argouml-app/src/org/argouml/uml/ui/foundation/extension_mechanisms/UMLTagDefinitionComboBoxModel.java
Log:
UML2: another small step towards tagged values
Modified: trunk/src/argouml-app/src/org/argouml/uml/ui/foundation/extension_mechanisms/UMLTagDefinitionComboBoxModel.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/ui/foundation/extension_mechanisms/UMLTagDefinitionComboBoxModel.java?view=diff&pathrev=18442&r1=18441&r2=18442
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/ui/foundation/extension_mechanisms/UMLTagDefinitionComboBoxModel.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/ui/foundation/extension_mechanisms/UMLTagDefinitionComboBoxModel.java 2010-06-10 13:01:30-0700
@@ -8,6 +8,7 @@
*
* Contributors:
* tfmorris
+ * Thomas Neustupny
*****************************************************************************
*
* Some portions of this file was previously release using the BSD License:
@@ -154,26 +155,33 @@
new TreeSet<Object>(new PathComparator());
Collection stereotypes = Model.getFacade().getStereotypes(element);
Project project = ProjectManager.getManager().getCurrentProject();
- for (Object model : project.getModels()) {
+ if (Model.getFacade().getUmlVersion().charAt(0) == '1') {
+ for (Object model : project.getModels()) {
+ // TODO: Won't our use of PathComparator take care of uniqueness?
+ addAllUniqueModelElementsFrom(availableTagDefs, paths,
+ Model.getModelManagementHelper().getAllModelElementsOfKind(
+ model,
+ Model.getMetaTypes().getTagDefinition()));
+ }
// TODO: Won't our use of PathComparator take care of uniqueness?
- addAllUniqueModelElementsFrom(availableTagDefs, paths,
- Model.getModelManagementHelper().getAllModelElementsOfKind(
- model,
+ addAllUniqueModelElementsFrom(availableTagDefs, paths, project
+ .getProfileConfiguration().findByMetaType(
Model.getMetaTypes().getTagDefinition()));
- }
- // TODO: Won't our use of PathComparator take care of uniqueness?
- addAllUniqueModelElementsFrom(availableTagDefs, paths, project
- .getProfileConfiguration().findByMetaType(
- Model.getMetaTypes().getTagDefinition()));
-
- List notValids = new ArrayList();
- for (Object tagDef : availableTagDefs) {
- Object owner = Model.getFacade().getOwner(tagDef);
- if (owner != null && !stereotypes.contains(owner)) {
- notValids.add(tagDef);
+
+ List notValids = new ArrayList();
+ for (Object tagDef : availableTagDefs) {
+ Object owner = Model.getFacade().getOwner(tagDef);
+ if (owner != null && !stereotypes.contains(owner)) {
+ notValids.add(tagDef);
+ }
+ }
+ availableTagDefs.removeAll(notValids);
+ } else {
+ // since UML2 it's easier: TDs only via stereotypes
+ for (Object st : stereotypes) {
+ availableTagDefs.addAll(Model.getFacade().getAttributes(st));
}
}
- availableTagDefs.removeAll(notValids);
return availableTagDefs;
}
------------------------------------------------------
http://argouml.tigris.org/ds/viewMessage.do?dsForumId=5905&dsMessageId=2619325
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.