svn commit: r18816 - trunk/src/argouml-app/src/org/argouml/ui/ProjectBrowser.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: tfmorris
Date: 2010-10-27 08:51:09-0700
New Revision: 18816

Modified:
   trunk/src/argouml-app/src/org/argouml/ui/ProjectBrowser.java

Log:
Return project to caller on load

Modified: trunk/src/argouml-app/src/org/argouml/ui/ProjectBrowser.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/ui/ProjectBrowser.java?view=diff&pathrev=18816&r1=18815&r2=18816
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/ui/ProjectBrowser.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/ui/ProjectBrowser.java	2010-10-27 08:51:09-0700
@@ -1523,7 +1523,26 @@
         LoadSwingWorker worker = new LoadSwingWorker(file, showUI);
         worker.start();
     }
-    	
+
+    /**
+     * Loads the project file and opens all kinds of error message windows
+     * if it doesn't work for some reason. In those cases it preserves
+     * the old project.
+     *
+     * @param file the file to open.
+     * @param showUI true if an error message may be shown to the user,
+     *               false if run in commandline mode
+     * @param pmw       the ProgressMonitor to be updated;  
+     *                          if not needed, use null 
+     * @return true if the file was successfully opened
+     * 
+     * TODO: Separate this into a Swing specific class - tfm
+     */
+    public boolean loadProject(File file, boolean showUI, 
+            ProgressMonitor pmw) {
+        return (loadProject2(file, showUI, pmw) != null);
+    }
+    
     /**
      * Loads the project file and opens all kinds of error message windows
      * if it doesn't work for some reason. In those cases it preserves
@@ -1538,7 +1557,7 @@
      * 
      * TODO: Separate this into a Swing specific class - tfm
      */
-    public boolean loadProject(File file, boolean showUI, 
+    public Project loadProject2(File file, boolean showUI, 
             ProgressMonitor pmw) {
         LOG.info("Loading project.");
 
@@ -1750,7 +1769,10 @@
                 }
             }
         }
-        return success;
+        if (!success) {
+            return null;
+        }
+        return project;
     }
 
     /**

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

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.