Author: vyemialyanchyk
Date: 2009-06-10 08:48:06 -0400 (Wed, 10 Jun 2009)
New Revision: 15852
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenMappingAction.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4417 - if file not found - add error message box
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenMappingAction.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenMappingAction.java 2009-06-10
12:16:29 UTC (rev 15851)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenMappingAction.java 2009-06-10
12:48:06 UTC (rev 15852)
@@ -15,6 +15,7 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.FindReplaceDocumentAdapter;
import org.eclipse.jface.text.IRegion;
@@ -144,11 +145,13 @@
editorPart = OpenSourceAction.run(consoleConfig, selection, fullyQualifiedName);
}
}
- else {
- String out =
NLS.bind(HibernateConsoleMessages.OpenMappingAction_mapping_for_not_found, selection);
- throw new FileNotFoundException(out);
- }
}
+ if (editorPart == null) {
+ final String title = HibernateConsoleMessages.OpenMappingAction_open_mapping_file;
+ final String msg =
NLS.bind(HibernateConsoleMessages.OpenMappingAction_mapping_for_not_found, selection);
+ MessageDialog.openError(null, title, msg);
+ throw new FileNotFoundException(msg);
+ }
return editorPart;
}
@@ -177,8 +180,10 @@
}
}
if (editorPart == null) {
- String out =
NLS.bind(HibernateConsoleMessages.OpenMappingAction_mapping_file_for_property_not_found,
compositeProperty.getNodeName());
- throw new FileNotFoundException(out);
+ final String title = HibernateConsoleMessages.OpenMappingAction_open_mapping_file;
+ final String msg =
NLS.bind(HibernateConsoleMessages.OpenMappingAction_mapping_file_for_property_not_found,
compositeProperty.getNodeName());
+ MessageDialog.openError(null, title, msg);
+ throw new FileNotFoundException(msg);
}
return editorPart;
}