Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordstadnik2006-03-17 08:20:58 -0500
committerdstadnik2006-03-17 08:20:58 -0500
commit75ead02ef6a6c994023170f251245e282f670a07 (patch)
tree04c19cad121fc6ace6538dd4e76c95921ff6d596
parent0157ade89fceff30f9dafaf21a86071392b38b0d (diff)
downloadorg.eclipse.gmf-tooling-75ead02ef6a6c994023170f251245e282f670a07.tar.gz
org.eclipse.gmf-tooling-75ead02ef6a6c994023170f251245e282f670a07.tar.xz
org.eclipse.gmf-tooling-75ead02ef6a6c994023170f251245e282f670a07.zip
temp fix for #132219
-rw-r--r--plugins/org.eclipse.gmf.codegen/src-templates/org/eclipse/gmf/codegen/templates/parts/CompartmentEditPartGenerator.java83
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/parts/CompartmentEditPart.javajet40
2 files changed, 111 insertions, 12 deletions
diff --git a/plugins/org.eclipse.gmf.codegen/src-templates/org/eclipse/gmf/codegen/templates/parts/CompartmentEditPartGenerator.java b/plugins/org.eclipse.gmf.codegen/src-templates/org/eclipse/gmf/codegen/templates/parts/CompartmentEditPartGenerator.java
index 1709446ce..32e22385d 100644
--- a/plugins/org.eclipse.gmf.codegen/src-templates/org/eclipse/gmf/codegen/templates/parts/CompartmentEditPartGenerator.java
+++ b/plugins/org.eclipse.gmf.codegen/src-templates/org/eclipse/gmf/codegen/templates/parts/CompartmentEditPartGenerator.java
@@ -36,10 +36,10 @@ public class CompartmentEditPartGenerator {
protected final String TEXT_18 = "());" + NL + "\t\tinstallEditPolicy(EditPolicyRoles.CANONICAL_ROLE, new ";
protected final String TEXT_19 = "());";
protected final String TEXT_20 = NL + "\t}";
- protected final String TEXT_21 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
- protected final String TEXT_22 = " createFigure() {" + NL + "\t\t";
- protected final String TEXT_23 = " result = super.createFigure();" + NL + "\t\tresult.setBorder(new ";
- protected final String TEXT_24 = "());" + NL + "\t\treturn result;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshRatio() {" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshVisuals() {" + NL + "\t\tsuper.refreshVisuals();" + NL + "\t\trefreshBounds();" + NL + "\t}" + NL + "\t" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void handleNotificationEvent(";
+ protected final String TEXT_21 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\t//public ";
+ protected final String TEXT_22 = " createFigure() {" + NL + "\t//\t";
+ protected final String TEXT_23 = " result = super.createFigure();" + NL + "\t//\tresult.setBorder(new ";
+ protected final String TEXT_24 = "());" + NL + "\t//\treturn result;" + NL + "\t//}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshRatio() {" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshVisuals() {" + NL + "\t\tsuper.refreshVisuals();" + NL + "\t\trefreshBounds();" + NL + "\t}" + NL + "\t" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void handleNotificationEvent(";
protected final String TEXT_25 = " notification) {" + NL + "\t\tsuper.handleNotificationEvent(notification);" + NL + "\t\tObject feature = notification.getFeature();" + NL + "\t\tif (";
protected final String TEXT_26 = ".eINSTANCE.getSize_Width().equals(feature)" + NL + "\t\t\t|| ";
protected final String TEXT_27 = ".eINSTANCE.getSize_Height().equals(feature)" + NL + "\t\t\t|| ";
@@ -55,8 +55,31 @@ public class CompartmentEditPartGenerator {
protected final String TEXT_37 = "(x, y);" + NL + "\t\t((";
protected final String TEXT_38 = ") getParent()).setLayoutConstraint(this, getFigure(), new ";
protected final String TEXT_39 = "(loc, size));" + NL + "\t}";
- protected final String TEXT_40 = NL + "}";
- protected final String TEXT_41 = NL;
+ protected final String TEXT_40 = NL + NL + "\t/**" + NL + "\t * Temporary fix for the https://bugs.eclipse.org/bugs/show_bug.cgi?id=132219" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
+ protected final String TEXT_41 = " createFigure() {" + NL + "\t\t";
+ protected final String TEXT_42 = " mm = getMapMode();" + NL + "\t\t";
+ protected final String TEXT_43 = " rcf =" + NL + "\t\t\t(";
+ protected final String TEXT_44 = ") super.createFigure();" + NL + "\t\tif (rcf instanceof ";
+ protected final String TEXT_45 = ") {" + NL + "\t\t\t";
+ protected final String TEXT_46 = " insets = new ";
+ protected final String TEXT_47 = "(mm.DPtoLP(1), mm.DPtoLP(2), mm.DPtoLP(1), mm.DPtoLP(0));" + NL + "\t\t\t";
+ protected final String TEXT_48 = " size = new ";
+ protected final String TEXT_49 = "(mm.DPtoLP(15), mm.DPtoLP(15));" + NL + "" + NL + "\t\t\t";
+ protected final String TEXT_50 = " scrollpane = rcf.getScrollPane();" + NL + "\t\t\tscrollpane.setHorizontalScrollBar(new ";
+ protected final String TEXT_51 = "(";
+ protected final String TEXT_52 = ".HORIZONTAL, insets, size, mm.DPtoLP(10), mm.DPtoLP(50)));" + NL + "\t\t\tscrollpane.setVerticalScrollBar(new ";
+ protected final String TEXT_53 = "(";
+ protected final String TEXT_54 = ".VERTICAL, insets, size, mm.DPtoLP(10), mm.DPtoLP(50)));" + NL + "" + NL + "\t\t\tint MB = mm.DPtoLP(5);" + NL + "\t\t\tscrollpane.setBorder(new ";
+ protected final String TEXT_55 = "(MB, MB, MB, MB));" + NL + "\t\t\tint SZ = mm.DPtoLP(10);" + NL + "\t\t\tscrollpane.setMinimumSize(new ";
+ protected final String TEXT_56 = "(SZ, SZ));" + NL + "\t\t} else {" + NL + "\t\t\t";
+ protected final String TEXT_57 = " insets = new ";
+ protected final String TEXT_58 = "(mm.DPtoLP(1), mm.DPtoLP(2), mm.DPtoLP(1), mm.DPtoLP(0));" + NL + "\t\t\t";
+ protected final String TEXT_59 = " size = new ";
+ protected final String TEXT_60 = "(mm.DPtoLP(15), mm.DPtoLP(15));" + NL + "" + NL + "\t\t\t";
+ protected final String TEXT_61 = " scrollPane = rcf.getScrollPane();" + NL + "\t\t\tscrollPane.setVerticalScrollBar(new ";
+ protected final String TEXT_62 = "(";
+ protected final String TEXT_63 = ".VERTICAL, insets, size, mm.DPtoLP(10), mm.DPtoLP(50)));" + NL + "\t\t}" + NL + "\t\treturn rcf;" + NL + "\t}" + NL + "}";
+ protected final String TEXT_64 = NL;
protected final String getFeatureValueGetter(String containerName, GenFeature feature, boolean isContainerEObject, ImportAssistant importManager) {
StringBuffer result = new StringBuffer();
@@ -245,8 +268,54 @@ importManager.markImportLocation(stringBuffer);
stringBuffer.append(TEXT_39);
}
stringBuffer.append(TEXT_40);
- importManager.emitSortedImports();
+ stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
stringBuffer.append(TEXT_41);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.draw2d.ui.mapmode.IMapMode"));
+ stringBuffer.append(TEXT_42);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure"));
+ stringBuffer.append(TEXT_43);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure"));
+ stringBuffer.append(TEXT_44);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.figures.ShapeCompartmentFigure"));
+ stringBuffer.append(TEXT_45);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Insets"));
+ stringBuffer.append(TEXT_46);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Insets"));
+ stringBuffer.append(TEXT_47);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Dimension"));
+ stringBuffer.append(TEXT_48);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Dimension"));
+ stringBuffer.append(TEXT_49);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ScrollPane"));
+ stringBuffer.append(TEXT_50);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.draw2d.ui.figures.ListScrollBar"));
+ stringBuffer.append(TEXT_51);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Orientable"));
+ stringBuffer.append(TEXT_52);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.draw2d.ui.figures.ListScrollBar"));
+ stringBuffer.append(TEXT_53);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Orientable"));
+ stringBuffer.append(TEXT_54);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.MarginBorder"));
+ stringBuffer.append(TEXT_55);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Dimension"));
+ stringBuffer.append(TEXT_56);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Insets"));
+ stringBuffer.append(TEXT_57);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Insets"));
+ stringBuffer.append(TEXT_58);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Dimension"));
+ stringBuffer.append(TEXT_59);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Dimension"));
+ stringBuffer.append(TEXT_60);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ScrollPane"));
+ stringBuffer.append(TEXT_61);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.draw2d.ui.figures.ListScrollBar"));
+ stringBuffer.append(TEXT_62);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Orientable"));
+ stringBuffer.append(TEXT_63);
+ importManager.emitSortedImports();
+ stringBuffer.append(TEXT_64);
return stringBuffer.toString();
}
} \ No newline at end of file
diff --git a/plugins/org.eclipse.gmf.codegen/templates/parts/CompartmentEditPart.javajet b/plugins/org.eclipse.gmf.codegen/templates/parts/CompartmentEditPart.javajet
index 897cdba50..ce0468147 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/parts/CompartmentEditPart.javajet
+++ b/plugins/org.eclipse.gmf.codegen/templates/parts/CompartmentEditPart.javajet
@@ -60,11 +60,11 @@ public class <%=genCompartment.getEditPartClassName()%> extends <%=genCompartmen
/**
* @generated
*/
- public <%=importManager.getImportedName("org.eclipse.draw2d.IFigure")%> createFigure() {
- <%=importManager.getImportedName("org.eclipse.draw2d.IFigure")%> result = super.createFigure();
- result.setBorder(new <%=importManager.getImportedName("org.eclipse.draw2d.LineBorder")%>());
- return result;
- }
+ //public <%=importManager.getImportedName("org.eclipse.draw2d.IFigure")%> createFigure() {
+ // <%=importManager.getImportedName("org.eclipse.draw2d.IFigure")%> result = super.createFigure();
+ // result.setBorder(new <%=importManager.getImportedName("org.eclipse.draw2d.LineBorder")%>());
+ // return result;
+ //}
/**
* @generated
@@ -107,5 +107,35 @@ public class <%=genCompartment.getEditPartClassName()%> extends <%=genCompartmen
((<%=importManager.getImportedName("org.eclipse.gef.GraphicalEditPart")%>) getParent()).setLayoutConstraint(this, getFigure(), new <%=importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")%>(loc, size));
}
<%}%>
+
+ /**
+ * Temporary fix for the https://bugs.eclipse.org/bugs/show_bug.cgi?id=132219
+ * @generated
+ */
+ public <%=importManager.getImportedName("org.eclipse.draw2d.IFigure")%> createFigure() {
+ <%=importManager.getImportedName("org.eclipse.gmf.runtime.draw2d.ui.mapmode.IMapMode")%> mm = getMapMode();
+ <%=importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure")%> rcf =
+ (<%=importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure")%>) super.createFigure();
+ if (rcf instanceof <%=importManager.getImportedName("org.eclipse.gmf.runtime.diagram.ui.figures.ShapeCompartmentFigure")%>) {
+ <%=importManager.getImportedName("org.eclipse.draw2d.geometry.Insets")%> insets = new <%=importManager.getImportedName("org.eclipse.draw2d.geometry.Insets")%>(mm.DPtoLP(1), mm.DPtoLP(2), mm.DPtoLP(1), mm.DPtoLP(0));
+ <%=importManager.getImportedName("org.eclipse.draw2d.geometry.Dimension")%> size = new <%=importManager.getImportedName("org.eclipse.draw2d.geometry.Dimension")%>(mm.DPtoLP(15), mm.DPtoLP(15));
+
+ <%=importManager.getImportedName("org.eclipse.draw2d.ScrollPane")%> scrollpane = rcf.getScrollPane();
+ scrollpane.setHorizontalScrollBar(new <%=importManager.getImportedName("org.eclipse.gmf.runtime.draw2d.ui.figures.ListScrollBar")%>(<%=importManager.getImportedName("org.eclipse.draw2d.Orientable")%>.HORIZONTAL, insets, size, mm.DPtoLP(10), mm.DPtoLP(50)));
+ scrollpane.setVerticalScrollBar(new <%=importManager.getImportedName("org.eclipse.gmf.runtime.draw2d.ui.figures.ListScrollBar")%>(<%=importManager.getImportedName("org.eclipse.draw2d.Orientable")%>.VERTICAL, insets, size, mm.DPtoLP(10), mm.DPtoLP(50)));
+
+ int MB = mm.DPtoLP(5);
+ scrollpane.setBorder(new <%=importManager.getImportedName("org.eclipse.draw2d.MarginBorder")%>(MB, MB, MB, MB));
+ int SZ = mm.DPtoLP(10);
+ scrollpane.setMinimumSize(new <%=importManager.getImportedName("org.eclipse.draw2d.geometry.Dimension")%>(SZ, SZ));
+ } else {
+ <%=importManager.getImportedName("org.eclipse.draw2d.geometry.Insets")%> insets = new <%=importManager.getImportedName("org.eclipse.draw2d.geometry.Insets")%>(mm.DPtoLP(1), mm.DPtoLP(2), mm.DPtoLP(1), mm.DPtoLP(0));
+ <%=importManager.getImportedName("org.eclipse.draw2d.geometry.Dimension")%> size = new <%=importManager.getImportedName("org.eclipse.draw2d.geometry.Dimension")%>(mm.DPtoLP(15), mm.DPtoLP(15));
+
+ <%=importManager.getImportedName("org.eclipse.draw2d.ScrollPane")%> scrollPane = rcf.getScrollPane();
+ scrollPane.setVerticalScrollBar(new <%=importManager.getImportedName("org.eclipse.gmf.runtime.draw2d.ui.figures.ListScrollBar")%>(<%=importManager.getImportedName("org.eclipse.draw2d.Orientable")%>.VERTICAL, insets, size, mm.DPtoLP(10), mm.DPtoLP(50)));
+ }
+ return rcf;
+ }
}
<%importManager.emitSortedImports();%>

Back to the top