Author: mdryakhlenkov
Date: 2007-10-11 11:27:55 -0400 (Thu, 11 Oct 2007)
New Revision: 4119
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/VisualEditor.java
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/model/OrmShape.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OpenFileActionUtils.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/VisualEditor.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/VisualEditor.java 2007-10-11
14:08:55 UTC (rev 4118)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/VisualEditor.java 2007-10-11
15:27:55 UTC (rev 4119)
@@ -10,7 +10,6 @@
******************************************************************************/
package org.jboss.tools.hibernate.ui.veditor.editors;
-import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
@@ -33,10 +32,7 @@
import org.eclipse.ui.actions.ActionFactory;
import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
import org.hibernate.console.ConsoleConfiguration;
-import org.hibernate.mapping.DependantValue;
-import org.hibernate.mapping.Property;
import org.hibernate.mapping.RootClass;
-import org.hibernate.mapping.Table;
import org.jboss.tools.hibernate.ui.veditor.editors.actions.OpenMappingAction;
import org.jboss.tools.hibernate.ui.veditor.editors.actions.OpenSourceAction;
import org.jboss.tools.hibernate.ui.veditor.editors.model.ModelElement;
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-11
14:08:55 UTC (rev 4118)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/actions/OpenMappingAction.java 2007-10-11
15:27:55 UTC (rev 4119)
@@ -63,9 +63,11 @@
}
} else {
if (rootClass instanceof SpecialRootClass) {
- resource = OpenFileActionUtils.getResource(consoleConfiguration, proj,
configXMLFile,
- ((SpecialRootClass)rootClass).getProperty().getPersistentClass()
- );
+ PersistentClass src =
((SpecialRootClass)rootClass).getProperty().getPersistentClass();
+ while (src instanceof SpecialRootClass) {
+ src = ((SpecialRootClass)src).getProperty().getPersistentClass();
+ }
+ resource = OpenFileActionUtils.getResource(consoleConfiguration, proj,
configXMLFile, src);
}
}
}
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/OrmShape.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/OrmShape.java 2007-10-11
14:08:55 UTC (rev 4118)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/OrmShape.java 2007-10-11
15:27:55 UTC (rev 4119)
@@ -170,12 +170,14 @@
public Shape getChild(Property ormElement) {
Shape shape = null;
- Iterator iter = getChildren().iterator();
- while (iter.hasNext()) {
- Shape child = (Shape)iter.next();
- Object childElement = child.getOrmElement();
- if (childElement instanceof Property &&
ormElement.getName().equals(((Property)childElement).getName())) {
- return child;
+ if (ormElement != null) {
+ Iterator iter = getChildren().iterator();
+ while (iter.hasNext()) {
+ Shape child = (Shape)iter.next();
+ Object childElement = child.getOrmElement();
+ if (childElement instanceof Property &&
ormElement.getName().equals(((Property)childElement).getName())) {
+ return child;
+ }
}
}
return shape;
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OpenFileActionUtils.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OpenFileActionUtils.java 2007-10-11
14:08:55 UTC (rev 4118)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OpenFileActionUtils.java 2007-10-11
15:27:55 UTC (rev 4119)
@@ -149,10 +149,10 @@
return true;
}
}
+ }
- if (getElements(doc, HTConstants.HIBERNATE_TAG_TABLE, table.getName()).hasNext()) {
- return true;
- }
+ if (getElements(doc, HTConstants.HIBERNATE_TAG_TABLE, table.getName()).hasNext()) {
+ return true;
}
return false;