svn commit: r15107 - trunk/src/argouml-app/src/org/argouml/uml/ui/ActionSaveGraphics.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: tfmorris
Date: 2008-06-29 11:51:13-0700
New Revision: 15107

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

Log:
Issue 5178 - Implement status events for project loads.  Extend status bar to listen to status events as well as help events.

Modified: trunk/src/argouml-app/src/org/argouml/uml/ui/ActionSaveGraphics.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/ui/ActionSaveGraphics.java?view=diff&rev=15107&p1=trunk/src/argouml-app/src/org/argouml/uml/ui/ActionSaveGraphics.java&p2=trunk/src/argouml-app/src/org/argouml/uml/ui/ActionSaveGraphics.java&r1=15106&r2=15107
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/ui/ActionSaveGraphics.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/ui/ActionSaveGraphics.java	2008-06-29 11:51:13-0700
@@ -36,17 +36,19 @@
 
 import org.apache.log4j.Logger;
 import org.argouml.application.api.CommandLineInterface;
+import org.argouml.application.events.ArgoEventPump;
+import org.argouml.application.events.ArgoEventTypes;
+import org.argouml.application.events.ArgoStatusEvent;
 import org.argouml.application.helpers.ResourceLoaderWrapper;
 import org.argouml.configuration.Configuration;
 import org.argouml.i18n.Translator;
 import org.argouml.kernel.Project;
 import org.argouml.kernel.ProjectManager;
 import org.argouml.ui.ExceptionDialog;
-import org.argouml.ui.ProjectBrowser;
 import org.argouml.util.ArgoFrame;
 import org.argouml.util.SuffixFilter;
-import org.tigris.gef.base.SaveGraphicsAction;
 import org.tigris.gef.base.Diagram;
+import org.tigris.gef.base.SaveGraphicsAction;
 import org.tigris.gef.util.Util;
 
 
@@ -177,8 +179,9 @@
         }
 
         if (useUI) {
-            ProjectBrowser.getInstance().showStatus(
-                            "Writing " + theFile + "...");
+            updateStatus(Translator.localize(
+                    "statusmsg.bar.save-graphics-status-writing",
+                    new Object[] {theFile}));
         }
 	if (theFile.exists() && useUI) {
 	    int response = JOptionPane.showConfirmDialog(
@@ -201,10 +204,18 @@
             fo.close();
         }
         if (useUI) {
-            ProjectBrowser.getInstance().showStatus("Wrote " + theFile);
+            updateStatus(Translator.localize(
+                    "statusmsg.bar.save-graphics-status-wrote", 
+                    new Object[] {theFile}));
         }
 	return true;
     }
+    
+    private void updateStatus(String status) {
+        ArgoEventPump.fireEvent(
+                new ArgoStatusEvent(ArgoEventTypes.STATUS_TEXT,
+                this, status));
+    }
 
 
     /**
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.