Author: dazarov
Date: 2007-07-20 11:48:56 -0400 (Fri, 20 Jul 2007)
New Revision: 2564
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/ExpandeableShapeEditPart.java
Log:
http://jira.jboss.com/jira/browse/EXIN-365
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/ExpandeableShapeEditPart.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/ExpandeableShapeEditPart.java 2007-07-20
15:25:51 UTC (rev 2563)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/ExpandeableShapeEditPart.java 2007-07-20
15:48:56 UTC (rev 2564)
@@ -97,8 +97,10 @@
OrmShape tableShape = refShape.getOrmDiagram().getShape(table);
OrmEditPart tablePart =
(OrmEditPart)getViewer().getEditPartRegistry().get(tableShape);
if(tablePart != null){
- tablePart.getFigure().setVisible(visible);
- setLinksVisible(tablePart, visible);
+ if(isTableCanBeInvisible(tablePart, visible)){
+ tablePart.getFigure().setVisible(visible);
+ setLinksVisible(tablePart, visible);
+ }
}
}
@@ -112,6 +114,16 @@
shape.getOrmDiagram().update();
}
+ private boolean isTableCanBeInvisible(OrmEditPart tablePart, boolean visible){
+ if(visible) return true;
+ ConnectionEditPart link;
+ for(int i=0;i<tablePart.getTargetConnections().size();i++){
+ link = (ConnectionEditPart)tablePart.getTargetConnections().get(i);
+ if(link.getFigure().isVisible()) return false;
+ }
+ return true;
+ }
+
private boolean isReferencesCorrect(OrmShape shape){
if(shape == null) return false;
for(int i=0;i < referenceList.size();i++){