Author: dgeraskov
Date: 2008-03-21 05:44:04 -0400 (Fri, 21 Mar 2008)
New Revision: 7056
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/OpenSourceAction.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1559
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 2008-03-21
09:24:26 UTC (rev 7055)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenMappingAction.java 2008-03-21
09:44:04 UTC (rev 7056)
@@ -61,18 +61,20 @@
public void run() {
IStructuredSelection sel = getStructuredSelection();
- if (sel instanceof TreeSelection){
- TreePath path = ((TreeSelection)sel).getPaths()[0];
- ConsoleConfiguration consoleConfiguration =
(ConsoleConfiguration)(path.getSegment(0));
- try {
- run(path, consoleConfiguration);
- } catch (JavaModelException e) {
- HibernateConsolePlugin.getDefault().logErrorMessage("Can't find mapping
file.", e);
- } catch (PartInitException e) {
- HibernateConsolePlugin.getDefault().logErrorMessage("Can't open mapping
file.", e);
- } catch (FileNotFoundException e) {
- HibernateConsolePlugin.getDefault().logErrorMessage("Can't find mapping
file.", e);
- }
+ if (sel instanceof TreeSelection){
+ for (int i = 0; i < ((TreeSelection)sel).getPaths().length; i++) {
+ TreePath path = ((TreeSelection)sel).getPaths()[i];
+ ConsoleConfiguration consoleConfiguration =
(ConsoleConfiguration)(path.getSegment(0));
+ try {
+ run(path, consoleConfiguration);
+ } catch (JavaModelException e) {
+ HibernateConsolePlugin.getDefault().logErrorMessage("Can't find mapping
file.", e);
+ } catch (PartInitException e) {
+ HibernateConsolePlugin.getDefault().logErrorMessage("Can't open mapping
file.", e);
+ } catch (FileNotFoundException e) {
+ HibernateConsolePlugin.getDefault().logErrorMessage("Can't find mapping
file.", e);
+ }
+ }
}
}
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenSourceAction.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenSourceAction.java 2008-03-21
09:24:26 UTC (rev 7055)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenSourceAction.java 2008-03-21
09:44:04 UTC (rev 7056)
@@ -50,33 +50,35 @@
public void run() {
IStructuredSelection sel = getStructuredSelection();
if (sel instanceof TreeSelection){
- TreePath path = ((TreeSelection)sel).getPaths()[0];
- Object lastSegment = path.getLastSegment();
- PersistentClass persClass = getPersistentClass(lastSegment);
- ConsoleConfiguration consoleConfiguration =
(ConsoleConfiguration)(path.getSegment(0));
- IJavaProject proj = ProjectUtils.findJavaProject(consoleConfiguration);
-
- String fullyQualifiedName = null;
- if (lastSegment instanceof Property){
- Object prevSegment = path.getParentPath().getLastSegment();
- if (prevSegment instanceof Property
- && ((Property)prevSegment).isComposite()){
- fullyQualifiedName =((Component)((Property)
prevSegment).getValue()).getComponentClassName();
+ for (int i = 0; i < ((TreeSelection)sel).getPaths().length; i++) {
+ TreePath path = ((TreeSelection)sel).getPaths()[i];
+ Object lastSegment = path.getLastSegment();
+ PersistentClass persClass = getPersistentClass(lastSegment);
+ ConsoleConfiguration consoleConfiguration =
(ConsoleConfiguration)(path.getSegment(0));
+ IJavaProject proj = ProjectUtils.findJavaProject(consoleConfiguration);
+
+ String fullyQualifiedName = null;
+ if (lastSegment instanceof Property){
+ Object prevSegment = path.getParentPath().getLastSegment();
+ if (prevSegment instanceof Property
+ && ((Property)prevSegment).isComposite()){
+ fullyQualifiedName =((Component)((Property)
prevSegment).getValue()).getComponentClassName();
+ }
}
- }
- if (fullyQualifiedName == null && persClass != null){
- fullyQualifiedName = persClass.getClassName();
- }
+ if (fullyQualifiedName == null && persClass != null){
+ fullyQualifiedName = persClass.getClassName();
+ }
- try {
- run(lastSegment, proj, fullyQualifiedName);
- } catch (JavaModelException e) {
- HibernateConsolePlugin.getDefault().logErrorMessage("Can't find source
file.", e);
- } catch (PartInitException e) {
- HibernateConsolePlugin.getDefault().logErrorMessage("Can't open source
file.", e);
- } catch (FileNotFoundException e) {
- HibernateConsolePlugin.getDefault().logErrorMessage("Can't find source
file.", e);
- }
+ try {
+ run(lastSegment, proj, fullyQualifiedName);
+ } catch (JavaModelException e) {
+ HibernateConsolePlugin.getDefault().logErrorMessage("Can't find source
file.", e);
+ } catch (PartInitException e) {
+ HibernateConsolePlugin.getDefault().logErrorMessage("Can't open source
file.", e);
+ } catch (FileNotFoundException e) {
+ HibernateConsolePlugin.getDefault().logErrorMessage("Can't find source
file.", e);
+ }
+ }
}
}