Author: mdryakhlenkov
Date: 2007-10-10 12:41:37 -0400 (Wed, 10 Oct 2007)
New Revision: 4099
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/actions/OpenMappingAction.java
Log:
JBIDE-983: Objects on diagram must have context menu
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/actions/OpenMappingAction.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/actions/OpenMappingAction.java 2007-10-10
15:18:47 UTC (rev 4098)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/actions/OpenMappingAction.java 2007-10-10
16:41:37 UTC (rev 4099)
@@ -11,6 +11,8 @@
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.PartInitException;
import org.hibernate.console.ConsoleConfiguration;
+import org.hibernate.mapping.Collection;
+import org.hibernate.mapping.Map;
import org.hibernate.mapping.PersistentClass;
import org.hibernate.mapping.RootClass;
import org.hibernate.mapping.Subclass;
@@ -85,6 +87,18 @@
}
}
}
+
+ if (resource == null) {
+ Iterator �ollectionMappingsIterator =
consoleConfiguration.getConfiguration().getCollectionMappings();
+ while (�ollectionMappingsIterator.hasNext()) {
+ Collection elem = (Collection) �ollectionMappingsIterator.next();
+ Table collectionTable = elem.getCollectionTable();
+ if
(HibernateUtils.getTableName(collectionTable).equals(HibernateUtils.getTableName(table)))
{
+ PersistentClass owner = elem.getOwner();
+ resource = OpenFileActionUtils.getResource(consoleConfiguration, proj,
configXMLFile, owner);
+ }
+ }
+ }
} else if (selectedElement instanceof Subclass) {
Subclass rootClass = (Subclass)selectedElement;
resource = OpenFileActionUtils.getResource(consoleConfiguration, proj,
configXMLFile, rootClass);
Show replies by date