Author: dazarov
Date: 2007-07-31 08:01:53 -0400 (Tue, 31 Jul 2007)
New Revision: 2750
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/ExpandeableShape.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/OrmDiagram.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/ComponentShapeEditPart.java
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/model/ExpandeableShape.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/ExpandeableShape.java 2007-07-31
11:07:49 UTC (rev 2749)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/ExpandeableShape.java 2007-07-31
12:01:53 UTC (rev 2750)
@@ -22,7 +22,7 @@
public static final String SHOW_REFERENCES = "show references";
- protected boolean refHide = true;
+ public boolean refHide = true;
protected boolean first=false;
private OrmShape reference=null;
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/OrmDiagram.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/OrmDiagram.java 2007-07-31
11:07:49 UTC (rev 2749)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/OrmDiagram.java 2007-07-31
12:01:53 UTC (rev 2750)
@@ -557,7 +557,7 @@
}else if(shape instanceof ExpandeableShape){
state = getState(properties, (Shape)shape);
if(!state)
- ((ExpandeableShape)shape).refreshReferences(this);
+ ((ExpandeableShape)shape).refHide = false;
}
for(int i=0;i<shape.getChildren().size();i++){
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/ComponentShapeEditPart.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/ComponentShapeEditPart.java 2007-07-31
11:07:49 UTC (rev 2749)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/ComponentShapeEditPart.java 2007-07-31
12:01:53 UTC (rev 2750)
@@ -56,10 +56,11 @@
}
}
- public void addNotify() {
- super.addNotify();
- if(!((ExpandeableShape)getModel()).isReferenceVisible()){
- int i = figure.getPreferredSize().width;
+ public void activate() {
+ super.activate();
+ if(this.getClass().equals(ComponentShapeEditPart.class) &&
!((ExpandeableShape)getModel()).isReferenceVisible()){
+ ((ComponentShape)getModel()).refreshChildsHiden(((OrmDiagram)getViewer().getContents().getModel()));
+ /*int i = figure.getPreferredSize().width;
((ComponentFigure)figure).setChildsHiden(true);
figure.setSize(i,-1);
@@ -68,7 +69,7 @@
refreshReference((ExpandeableShape)getCastedModel(),
((ExpandeableShape)getCastedModel()).isReferenceVisible());
- ((OrmShape)getParent().getModel()).refreshReference();
+ ((OrmShape)getParent().getModel()).refreshReference();*/
}
}
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-31
11:07:49 UTC (rev 2749)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/ExpandeableShapeEditPart.java 2007-07-31
12:01:53 UTC (rev 2750)
@@ -53,11 +53,13 @@
}
}
- public void addNotify() {
- super.addNotify();
- if(!((ExpandeableShape)getModel()).isReferenceVisible()){
- refreshReferences((Shape)getCastedModel(),
((ExpandeableShape)getCastedModel()).isReferenceVisible());
- ((TitleLabel)getFigure()).setHidden(!((ExpandeableShape)getCastedModel()).isReferenceVisible());
+ public void activate() {
+ super.activate();
+ if(this.getClass().equals(ExpandeableShapeEditPart.class) &&
!((ExpandeableShape)getModel()).isReferenceVisible()){
+ ((ExpandeableShape)getModel()).refHide = true;
+ ((ExpandeableShape)getModel()).refreshReferences(getViewer().getContents().getModel());
+ //refreshReferences((Shape)getCastedModel(),
((ExpandeableShape)getCastedModel()).isReferenceVisible());
+ //((TitleLabel)getFigure()).setHidden(true);
}
}
@@ -80,12 +82,8 @@
((IFigure)getFigure().getChildren().get(0)).setForegroundColor(ResourceManager.getInstance().getColor(new
RGB(0,0,0)));
}
}else if (ExpandeableShape.SHOW_REFERENCES.equals(prop)) {
- //referenceList.add((OrmShape)getCastedModel().getParent());
- //refreshReference((ExpandeableShape)getCastedModel(),
((ExpandeableShape)getCastedModel()).isReferenceVisible());
refreshReferences((Shape)getCastedModel(),
((ExpandeableShape)getCastedModel()).isReferenceVisible());
((TitleLabel)getFigure()).setHidden(!((ExpandeableShape)getCastedModel()).isReferenceVisible());
-// ((IFigure)getFigure().getChildren().get(0)).setBackgroundColor(getSelectionColor());
-// ((IFigure)getFigure().getChildren().get(0)).setForegroundColor(ResourceManager.getInstance().getColor(new
RGB(255,255,255)));
} else {
super.propertyChange(evt);
}