svn commit: r17456 - trunk/src/argouml-app/src/org/argouml: kernel ui

Thomas Neustupny <[email protected]>
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: thn
Date: 2009-11-05 12:19:17-0800
New Revision: 17456

Modified:
   trunk/src/argouml-app/src/org/argouml/kernel/ProfileConfiguration.java
   trunk/src/argouml-app/src/org/argouml/ui/SettingsTabProfile.java

Log:
allow profiles to have no profiles applied, make this the default
(i.e. the default profiles are not applied when creating a profile project)

Modified: trunk/src/argouml-app/src/org/argouml/kernel/ProfileConfiguration.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/kernel/ProfileConfiguration.java?view=diff&pathrev=17456&r1=17455&r2=17456
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/kernel/ProfileConfiguration.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/kernel/ProfileConfiguration.java	2009-11-05 12:19:17-0800
@@ -93,8 +93,11 @@
         super(EXTENSION, project);
         List c = project.getUserDefinedModelList();
         Object m = c.isEmpty() ? null : c.get(0);
-        for (Profile p : ProfileFacade.getManager().getDefaultProfiles()) {
-            addProfile(p, m);
+        if (project.getProjectType() != Project.PROFILE_PROJECT) {
+            // a profile initially has no applied profiles, we go bottom-up
+            for (Profile p : ProfileFacade.getManager().getDefaultProfiles()) {
+                addProfile(p, m);
+            }
         }
 
         updateStrategies();

Modified: trunk/src/argouml-app/src/org/argouml/ui/SettingsTabProfile.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/ui/SettingsTabProfile.java?view=diff&pathrev=17456&r1=17455&r2=17456
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/ui/SettingsTabProfile.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/ui/SettingsTabProfile.java	2009-11-05 12:19:17-0800
@@ -53,6 +53,7 @@
 import org.argouml.configuration.Configuration;
 import org.argouml.i18n.Translator;
 import org.argouml.kernel.ProfileConfiguration;
+import org.argouml.model.Model;
 import org.argouml.profile.Profile;
 import org.argouml.profile.ProfileException;
 import org.argouml.profile.ProfileFacade;
@@ -338,7 +339,8 @@
                 Profile selected = (Profile) modelUsd.getElementAt(defaultList
                         .getSelectedIndex());
                 
-                if (selected == ProfileFacade.getManager().getUMLProfile()) {
+                if (selected == ProfileFacade.getManager().getUMLProfile()
+                        && Model.getFacade().getUmlVersion().charAt(0) != '1') {
                     JOptionPane.showMessageDialog(this, Translator
                             .localize("tab.profiles.cantremoveuml"));
                 } else {

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

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.