Java Code Examples for org.eclipse.swt.custom.StyledText#getBounds()

The following examples show how to use org.eclipse.swt.custom.StyledText#getBounds() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TestResultsView.java    From n4js with Eclipse Public License 1.0 5 votes vote down vote up
@Override
protected Composite createToolTipContentArea(final Event event, final Composite parent) {
	final Object layoutData = parent.getLayoutData();
	final StyledText text = lastDescriptor.toStyledText(parent, NONE);
	if (layoutData instanceof GridData) {
		((GridData) layoutData).heightHint = text.getBounds().height;
		((GridData) layoutData).widthHint = text.getBounds().width;
	}
	return parent;
}
 
Example 2
Source File: HsMultiCellEditor.java    From translationstudio8 with GNU General Public License v2.0 4 votes vote down vote up
public Point computeSize(){
	StyledText textControl = cellEditor.getSegmentViewer().getTextWidget();
	Rectangle controlBounds = textControl.getBounds();
	Point x = textControl.computeSize(controlBounds.width, SWT.DEFAULT, true);
	return x;
}
 
Example 3
Source File: HsMultiCellEditor.java    From tmxeditor8 with GNU General Public License v2.0 4 votes vote down vote up
public Point computeSize(){
	StyledText textControl = cellEditor.getSegmentViewer().getTextWidget();
	Rectangle controlBounds = textControl.getBounds();
	Point x = textControl.computeSize(controlBounds.width, SWT.DEFAULT, true);
	return x;
}