[jbosstools-commits] JBoss Tools SVN: r6675 - trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views.
jbosstools-commits at lists.jboss.org
jbosstools-commits at lists.jboss.org
Tue Mar 4 05:12:41 EST 2008
Author: dgeraskov
Date: 2008-03-04 05:12:41 -0500 (Tue, 04 Mar 2008)
New Revision: 6675
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/KnownConfigurationsView.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1839
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/KnownConfigurationsView.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/KnownConfigurationsView.java 2008-03-03 20:39:41 UTC (rev 6674)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/KnownConfigurationsView.java 2008-03-04 10:12:41 UTC (rev 6675)
@@ -52,6 +52,8 @@
import org.hibernate.eclipse.console.actions.OpenMappingAction;
import org.hibernate.eclipse.console.viewers.xpl.MTreeViewer;
import org.hibernate.eclipse.console.workbench.xpl.AnyAdaptableLabelProvider;
+import org.hibernate.mapping.PersistentClass;
+import org.hibernate.mapping.Property;
import org.hibernate.util.StringHelper;
@@ -160,12 +162,15 @@
}
} else if (selection instanceof TreeSelection){
TreePath path = ((TreeSelection)selection).getPaths()[0];
+ Object first = path.getFirstSegment();
ConsoleConfiguration consoleConfiguration = (ConsoleConfiguration)(path.getSegment(0));
- try {
- OpenMappingAction.run(path, consoleConfiguration);
- } catch (Exception e) {
- HibernateConsolePlugin.getDefault().logErrorMessage("Can't find mapping file.", e);
- }
+ if (first instanceof PersistentClass || first.getClass() == Property.class){
+ try {
+ OpenMappingAction.run(path, consoleConfiguration);
+ } catch (Exception e) {
+ HibernateConsolePlugin.getDefault().logErrorMessage("Can't find mapping file.", e);
+ }
+ }
}
}
};
More information about the jbosstools-commits
mailing list