Author: thn
Date: 2008-08-03 12:34:36-0700
New Revision: 15500
Modified:
trunk/src/argouml-app/src/org/argouml/i18n/dialog.properties
trunk/src/argouml-app/src/org/argouml/ui/ProjectBrowser.java
Log:
Issue 5278: failed to load project when a deactivated profile is not available
(no fix needed, just a better error message that helps the user to fix the problem)
Modified: trunk/src/argouml-app/src/org/argouml/i18n/dialog.properties
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/i18n/dialog.properties?view=diff&rev=15500&p1=trunk/src/argouml-app/src/org/argouml/i18n/dialog.properties&p2=trunk/src/argouml-app/src/org/argouml/i18n/dialog.properties&r1=15499&r2=15500
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/i18n/dialog.properties (original)
+++ trunk/src/argouml-app/src/org/argouml/i18n/dialog.properties 2008-08-03 12:34:36-0700
@@ -68,6 +68,11 @@
the problem as a bug by going to \
<a href="http://argouml.tigris.org/project_bugs.html">\
http://argouml.tigris.org/project_bugs.html</a>.
+dialog.error.xmi.reference.error = XMI reference error : {0} \n\
+ Please make sure that either this XMI file is listed in the profile tab of\n\
+ the edit->settings dialog, or a module containing this XMI as a profile\n\
+ is loaded (e.g. by putting the module jar file in the ext directory of\n\
+ your ArgoUML installation).
dialog.exception.link.report = Please report this problem at \
<a href="http://argouml.tigris.org/project_bugs.html">\
http://argouml.tigris.org/project_bugs.html</a>
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&rev=15500&p1=trunk/src/argouml-app/src/org/argouml/ui/ProjectBrowser.java&p2=trunk/src/argouml-app/src/org/argouml/ui/ProjectBrowser.java&r1=15499&r2=15500
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/ui/ProjectBrowser.java (original)
+++ trunk/src/argouml-app/src/org/argouml/ui/ProjectBrowser.java 2008-08-03 12:34:36-0700
@@ -88,6 +88,7 @@
import org.argouml.persistence.UmlVersionException;
import org.argouml.persistence.VersionException;
import org.argouml.persistence.XmiFormatException;
+import org.argouml.persistence.XmiReferenceException;
import org.argouml.taskmgmt.ProgressMonitor;
import org.argouml.ui.cmd.GenericArgoMenuBar;
import org.argouml.ui.targetmanager.TargetEvent;
@@ -1669,6 +1670,16 @@
"dialog.error.file.version.error",
new Object[] {ex.getMessage()}),
showUI, ex);
+ } catch (XmiReferenceException ex) {
+ // an error that can be corrected by the user, so no stack
+ // trace, but instead an explanation and a hint how to fix it
+ reportError(
+ pmw,
+ Translator.localize(
+ "dialog.error.xmi.reference.error",
+ new Object[] {ex.getMessage()}),
+ ex.toString(),
+ showUI);
} catch (XmiFormatException ex) {
reportError(
pmw,
@@ -1823,6 +1834,42 @@
}
/**
+ * Open a Message Dialog with an error message and an explanation. No
+ * stack trace, since it's not an application error, but a user issue.
+ *
+ * @param message the message to display.
+ * @param explanation the explanation to display.
+ * @param showUI true if an error message may be shown to the user,
+ * false if run in commandline mode
+ */
+ private void reportError(ProgressMonitor monitor, final String message,
+ final String explanation, boolean showUI) {
+ if (showUI) {
+ if (monitor != null) {
+ monitor.notifyMessage(
+ Translator.localize("dialog.error.title"),
+ explanation,
+ message);
+ } else {
+ SwingUtilities.invokeLater(new Runnable() {
+ public void run() {
+ JDialog dialog =
+ new ExceptionDialog(
+ ArgoFrame.getInstance(),
+ Translator.localize("dialog.error.title"),
+ explanation,
+ message);
+ dialog.setVisible(true);
+ }
+ });
+ }
+ } else {
+ reportError(monitor, message + "\n" + explanation + "\n\n",
+ showUI);
+ }
+ }
+
+ /**
* We should remove all open dialogs. They have as parent the
* ProjectBrowser. This is needed for the non-modal dialogs
* such as Find and Goto.
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.