Author: dazarov
Date: 2007-07-30 11:52:16 -0400 (Mon, 30 Jul 2007)
New Revision: 2724
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/DiagramEditPart.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/OrmShapeEditPart.java
Log:
http://jira.jboss.com/jira/browse/EXIN-369
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/DiagramEditPart.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/DiagramEditPart.java 2007-07-30
15:52:02 UTC (rev 2723)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/DiagramEditPart.java 2007-07-30
15:52:16 UTC (rev 2724)
@@ -208,7 +208,8 @@
if (!isActive()) {
super.activate();
((ModelElement) getModel()).addPropertyChangeListener(this);
- autolayout();
+ if(!getCastedModel().isLoadSuccessfull())
+ autolayout();
// restore();
}
}
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/OrmShapeEditPart.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/OrmShapeEditPart.java 2007-07-30
15:52:02 UTC (rev 2723)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/OrmShapeEditPart.java 2007-07-30
15:52:16 UTC (rev 2724)
@@ -25,25 +25,32 @@
import org.eclipse.swt.graphics.FontData;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.widgets.Display;
-import org.hibernate.mapping.Bag;
-import org.hibernate.mapping.Collection;
import org.hibernate.mapping.Component;
import org.hibernate.mapping.PersistentClass;
import org.hibernate.mapping.Property;
import org.hibernate.mapping.RootClass;
-import org.hibernate.mapping.SingleTableSubclass;
import org.hibernate.mapping.Subclass;
import org.hibernate.mapping.Table;
import org.jboss.tools.hibernate.ui.veditor.editors.figures.RoundLineBorder;
import org.jboss.tools.hibernate.ui.veditor.editors.figures.TitleFigure;
import org.jboss.tools.hibernate.ui.veditor.editors.figures.TitleLabel;
-import org.jboss.tools.hibernate.ui.veditor.editors.model.ExpandeableShape;
import org.jboss.tools.hibernate.ui.veditor.editors.model.OrmDiagram;
import org.jboss.tools.hibernate.ui.veditor.editors.model.OrmShape;
public class OrmShapeEditPart extends ExpandeableShapeEditPart{
+ public void addNotify() {
+ super.addNotify();
+ if(((OrmShape)getModel()).isHiden()){
+ int i = figure.getPreferredSize().width;
+ ((TitleFigure)figure).setHidden(true);
+ ((TitleLabel)figure.getChildren().get(0)).setHidden(true);
+ figure.setSize(i,-1);
+ refresh();
+ }
+ }
+
protected IFigure createFigure() {
if (getModel() instanceof OrmShape) {
TitleFigure figure = new TitleFigure();
@@ -92,7 +99,7 @@
String prop = evt.getPropertyName();
if (OrmShape.LOCATION_PROP.equals(prop)) {
refreshVisuals();
- //((OrmDiagram)getParent().getModel()).setDirty(true);
+ ((OrmDiagram)getParent().getModel()).setDirty(true);
} else if (OrmShape.SET_HIDEN.equals(prop)) {
int i = figure.getPreferredSize().width;
((TitleFigure)figure).setHidden(((Boolean)evt.getNewValue()).booleanValue());
@@ -102,7 +109,7 @@
else
figure.setSize(-1,-1);
refresh();
- //((OrmDiagram)getParent().getModel()).setDirty(true);
+ ((OrmDiagram)getParent().getModel()).setDirty(true);
} else {
super.propertyChange(evt);
}