/** * Overrides the method by fully trusting the layout manager (computed width * or height may be larger than the provider width or height hints). Callers * should be prepared that the computed width is larger than the provided * wHint. * * @see org.eclipse.swt.widgets.Composite#computeSize(int, int, boolean) */ @Override public Point computeSize(int wHint, int hHint, boolean changed) { checkWidget(); Point size; FormTextLayout layout = (FormTextLayout) getLayout(); if (wHint == SWT.DEFAULT || hHint == SWT.DEFAULT) { size = layout.computeSize(this, wHint, hHint, changed); } else { size = new Point(wHint, hHint); } Rectangle trim = computeTrim(0, 0, size.x, size.y); if (DEBUG_TEXTSIZE) System.out.println("FormText Computed size: "+trim); //$NON-NLS-1$ return new Point(trim.width, trim.height); }
/** * Overrides the method by fully trusting the layout manager (computed width * or height may be larger than the provider width or height hints). Callers * should be prepared that the computed width is larger than the provided * wHint. * * @see org.eclipse.swt.widgets.Composite#computeSize(int, int, boolean) */ @Override public Point computeSize(int wHint, int hHint, boolean changed) { checkWidget(); Point size; FormTextLayout layout = (FormTextLayout) getLayout(); if (wHint == SWT.DEFAULT || hHint == SWT.DEFAULT) { size = layout.computeSize(this, wHint, hHint, changed); } else { size = new Point(wHint, hHint); } Rectangle trim = computeTrim(0, 0, size.x, size.y); if (DEBUG_TEXTSIZE) System.out.println("FormText Computed size: "+trim); //$NON-NLS-1$ return new Point(trim.width, trim.height); }
@Override public int computeMinimumWidth(Composite parent, boolean changed) { return computeSize(parent, 5, SWT.DEFAULT, true).x; }
@Override public int computeMinimumWidth(Composite parent, boolean changed) { return computeSize(parent, 5, SWT.DEFAULT, true).x; }
@Override public int computeMaximumWidth(Composite parent, boolean changed) { return computeSize(parent, SWT.DEFAULT, SWT.DEFAULT, changed).x; }
@Override public int computeMaximumWidth(Composite parent, boolean changed) { return computeSize(parent, SWT.DEFAULT, SWT.DEFAULT, changed).x; }