svn commit: r14661 - trunk/src/argouml-app/src/org/argouml: persistence ui/explorer

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: bobtarling
Date: 2008-05-07 16:44:19-0700
New Revision: 14661

Modified:
   trunk/src/argouml-app/src/org/argouml/persistence/ProfileConfigurationFilePersister.java
   trunk/src/argouml-app/src/org/argouml/ui/explorer/ActionExportProfileXMI.java

Log:
Don't use our own deprecated API

Modified: trunk/src/argouml-app/src/org/argouml/persistence/ProfileConfigurationFilePersister.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/persistence/ProfileConfigurationFilePersister.java?view=diff&rev=14661&p1=trunk/src/argouml-app/src/org/argouml/persistence/ProfileConfigurationFilePersister.java&p2=trunk/src/argouml-app/src/org/argouml/persistence/ProfileConfigurationFilePersister.java&r1=14660&r2=14661
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/persistence/ProfileConfigurationFilePersister.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/persistence/ProfileConfigurationFilePersister.java	2008-05-07 16:44:19-0700
@@ -269,7 +269,10 @@
                                 + "</filename>");

                         w.println("\t\t\t<model>");

 

-                        printModelXMI(w, uprofile.getModel());

+                        final Collection profilePackages = 

+                            uprofile.getProfilePackages();

+                        final Object model = profilePackages.iterator().next();

+                        printModelXMI(w, model);

 

                         w.println("\t\t\t</model>");

                         w.println("\t\t</userDefined>");


Modified: trunk/src/argouml-app/src/org/argouml/ui/explorer/ActionExportProfileXMI.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/ui/explorer/ActionExportProfileXMI.java?view=diff&rev=14661&p1=trunk/src/argouml-app/src/org/argouml/ui/explorer/ActionExportProfileXMI.java&p2=trunk/src/argouml-app/src/org/argouml/ui/explorer/ActionExportProfileXMI.java&r1=14660&r2=14661
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/ui/explorer/ActionExportProfileXMI.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/ui/explorer/ActionExportProfileXMI.java	2008-05-07 16:44:19-0700
@@ -28,6 +28,7 @@
 import java.io.File;

 import java.io.FileWriter;

 import java.io.IOException;

+import java.util.Collection;

 

 import javax.swing.AbstractAction;

 import javax.swing.JFileChooser;

@@ -44,6 +45,7 @@
 import org.argouml.persistence.ProjectFileView;

 import org.argouml.persistence.UmlFilePersister;

 import org.argouml.profile.Profile;

+import org.argouml.profile.ProfileException;

 import org.argouml.util.ArgoFrame;

 

 /**

@@ -75,19 +77,25 @@
      * @param arg0

      * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)

      */

-    public void actionPerformed(ActionEvent arg0) {        

-        Object model = selectedProfile.getModel();

-        if (model != null) {

-            File destiny = getTargetFile();

-            if (destiny != null) {

-                try {

+    public void actionPerformed(ActionEvent arg0) {

+        try {

+            final Collection profilePackages = 

+                selectedProfile.getProfilePackages();

+            final Object model = profilePackages.iterator().next();

+            

+            if (model != null) {

+                File destiny = getTargetFile();

+                if (destiny != null) {

                     saveModel(destiny, model);

-                } catch (IOException e) {

-                    LOG.error("Exception", e);

-                } catch (UmlException e) {

-                    LOG.error("Exception", e);

                 }

             }

+        } catch (ProfileException e) {

+            // TODO: We should be giving the user more direct feedback

+            LOG.error("Exception", e);

+        } catch (IOException e) {

+            LOG.error("Exception", e);

+        } catch (UmlException e) {

+            LOG.error("Exception", e);

         }

     }
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.