Java Code Examples for org.eclipse.swt.widgets.Text.computeTrim()

The following are Jave code examples for showing how to use computeTrim() of the org.eclipse.swt.widgets.Text class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: Hydrograph   File: CommentBoxCellEditorLocator.java   Source Code and License Vote up 5 votes
@Override
public void relocate(CellEditor celleditor) {
	Text text = (Text)celleditor.getControl();
	Rectangle rect = comment.getClientArea();
	comment.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);
	
	text.setBounds(rect.x - 5, rect.y - 8, rect.width+10, rect.height+16);
}