Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/editparts/EditPartFactory.xpt')
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/editparts/EditPartFactory.xpt26
1 files changed, 13 insertions, 13 deletions
diff --git a/plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/editparts/EditPartFactory.xpt b/plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/editparts/EditPartFactory.xpt
index 5730cadf4..6b63143f8 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/editparts/EditPartFactory.xpt
+++ b/plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/editparts/EditPartFactory.xpt
@@ -73,19 +73,19 @@ public class «editPartFactoryClassName» implements org.eclipse.gef.EditPartFac
«EXPAND xpt::Common::generatedMemberComment»
public void relocate(org.eclipse.jface.viewers.CellEditor celleditor) {
- org.eclipse.swt.widgets.Text text = (org.eclipse.swt.widgets.Text) celleditor.getControl();
+ org.eclipse.swt.widgets.Control control = (org.eclipse.swt.widgets.Control) celleditor.getControl();
org.eclipse.draw2d.geometry.Rectangle rect = getWrapLabel().getTextBounds().getCopy();
getWrapLabel().translateToAbsolute(rect);
- if (!text.getFont().isDisposed()) {
+ if (!control.getFont().isDisposed()) {
if (getWrapLabel().isTextWrapOn() && getWrapLabel().getText().length() > 0) {
- rect.setSize(new org.eclipse.draw2d.geometry.Dimension(text.computeSize(rect.width, org.eclipse.swt.SWT.DEFAULT)));
+ rect.setSize(new org.eclipse.draw2d.geometry.Dimension(control.computeSize(rect.width, org.eclipse.swt.SWT.DEFAULT)));
} else {
- int avr = org.eclipse.draw2d.FigureUtilities.getFontMetrics(text.getFont()).getAverageCharWidth();
- rect.setSize(new org.eclipse.draw2d.geometry.Dimension(text.computeSize(org.eclipse.swt.SWT.DEFAULT, org.eclipse.swt.SWT.DEFAULT)).expand(avr * 2, 0));
+ int avr = org.eclipse.draw2d.FigureUtilities.getFontMetrics(control.getFont()).getAverageCharWidth();
+ rect.setSize(new org.eclipse.draw2d.geometry.Dimension(control.computeSize(org.eclipse.swt.SWT.DEFAULT, org.eclipse.swt.SWT.DEFAULT)).expand(avr * 2, 0));
}
}
- if (!rect.equals(new org.eclipse.draw2d.geometry.Rectangle(text.getBounds()))) {
- text.setBounds(rect.x, rect.y, rect.width, rect.height);
+ if (!rect.equals(new org.eclipse.draw2d.geometry.Rectangle(control.getBounds()))) {
+ control.setBounds(rect.x, rect.y, rect.width, rect.height);
}
}
}
@@ -108,15 +108,15 @@ public class «editPartFactoryClassName» implements org.eclipse.gef.EditPartFac
«EXPAND xpt::Common::generatedMemberComment»
public void relocate(org.eclipse.jface.viewers.CellEditor celleditor) {
- org.eclipse.swt.widgets.Text text = (org.eclipse.swt.widgets.Text) celleditor.getControl();
+ org.eclipse.swt.widgets.Control control = (org.eclipse.swt.widgets.Control) celleditor.getControl();
org.eclipse.draw2d.geometry.Rectangle rect = getLabel().getTextBounds().getCopy();
getLabel().translateToAbsolute(rect);
- if (!text.getFont().isDisposed()) {
- int avr = org.eclipse.draw2d.FigureUtilities.getFontMetrics(text.getFont()).getAverageCharWidth();
- rect.setSize(new org.eclipse.draw2d.geometry.Dimension(text.computeSize(org.eclipse.swt.SWT.DEFAULT, org.eclipse.swt.SWT.DEFAULT)).expand(avr * 2, 0));
+ if (!control.getFont().isDisposed()) {
+ int avr = org.eclipse.draw2d.FigureUtilities.getFontMetrics(control.getFont()).getAverageCharWidth();
+ rect.setSize(new org.eclipse.draw2d.geometry.Dimension(control.computeSize(org.eclipse.swt.SWT.DEFAULT, org.eclipse.swt.SWT.DEFAULT)).expand(avr * 2, 0));
}
- if (!rect.equals(new org.eclipse.draw2d.geometry.Rectangle(text.getBounds()))) {
- text.setBounds(rect.x, rect.y, rect.width, rect.height);
+ if (!rect.equals(new org.eclipse.draw2d.geometry.Rectangle(control.getBounds()))) {
+ control.setBounds(rect.x, rect.y, rect.width, rect.height);
}
}
}

Back to the top