Author: bobtarling
Date: 2011-05-17 02:23:41-0700
New Revision: 19447
Modified:
trunk/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/model/GetterSetterManagerImpl.java
Log:
Only look for classifiers in the model when listing classifiers for InstanceSpecification
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=19447&r1=19446&r2=19447
==============================================================================
--- 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 2011-05-17 02:23:41-0700
@@ -32,9 +32,11 @@
import org.argouml.i18n.Translator;
import org.argouml.kernel.Command;
import org.argouml.kernel.NonUndoableCommand;
+import org.argouml.kernel.ProfileConfiguration;
import org.argouml.kernel.Project;
import org.argouml.kernel.ProjectManager;
import org.argouml.model.Model;
+import org.argouml.model.ModelManagementHelper;
import org.argouml.profile.Profile;
import org.argouml.profile.ProfileException;
import org.argouml.ui.targetmanager.TargetManager;
@@ -2109,26 +2111,34 @@
List list = new ArrayList();
// Get all classifiers in our model
- // TODO: We need the property panels to have some reference to the
- // project they belong to instead of using deprecated functionality
+ // TODO: We need the property panels to have some reference to
+ // the project they belong to instead of using deprecated
+ // functionality
Project p = ProjectManager.getManager().getCurrentProject();
Object model = p.getRoot();
list.addAll(Model.getModelManagementHelper()
- .getAllModelElementsOfKindWithModel(model, Model.getMetaTypes().getClassifier()));
-
+ .getAllModelElementsOfKindWithModel(
+ model, Model.getMetaTypes().getClassifier()));
+ final ProfileConfiguration profileConfiguration =
+ p.getProfileConfiguration();
+ final ModelManagementHelper mmh =
+ Model.getModelManagementHelper();
+ final Object classifierMetaType =
+ Model.getMetaTypes().getClassifier();
// Get all classifiers in all top level packages of all profiles
- for (Profile profile : p.getProfileConfiguration().getProfiles()) {
- try {
- for (Object topPackage : profile.getProfilePackages()) {
- list.addAll(Model.getModelManagementHelper()
- .getAllModelElementsOfKindWithModel(topPackage,
- Model.getMetaTypes().getClassifier()));
- }
- } catch (ProfileException e) {
- // TODO: We need to rethrow this as some other exception
- // type but that is too much change for the moment.
- LOG.error("Exception", e);
- }
+ for (Profile profile : profileConfiguration.getProfiles()) {
+ try {
+ for (Object topPackage : profile.getProfilePackages()) {
+ if (Model.getFacade().isAModel(topPackage)) {
+ list.addAll(mmh.getAllModelElementsOfKindWithModel(
+ topPackage, classifierMetaType));
+ }
+ }
+ } catch (ProfileException e) {
+ // TODO: We need to rethrow this as some other exception
+ // type but that is too much change for the moment.
+ LOG.error("Exception", e);
+ }
}
return list;
}
@@ -2147,7 +2157,7 @@
@Override
protected void doIt(Collection selected) {
- Model.getCommonBehaviorHelper().setClassifiers(getTarget(), selected);
+ Model.getCommonBehaviorHelper().setClassifiers(getTarget(), selected);
}
}
------------------------------------------------------
http://argouml.tigris.org/ds/viewMessage.do?dsForumId=5905&dsMessageId=2738510
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.