public void relocate(CellEditor celleditor) { if (celleditor == null) return; Text text = (Text) celleditor.getControl(); Rectangle rect = fig.getClientArea(Rectangle.SINGLETON); if (fig instanceof Label) rect = ((Label) fig).getTextBounds().intersect(rect); fig.translateToAbsolute(rect); org.eclipse.swt.graphics.Rectangle trim = text.computeTrim(0, 0, 0, 0); rect.translate(trim.x, trim.y); rect.width += trim.width; rect.height += trim.height; text.setBounds(rect.x, rect.y, rect.width, rect.height); }