/** * Computes the size of the expandable composite. * * @see org.eclipse.swt.widgets.Composite#computeSize */ @Override public Point computeSize(int wHint, int hHint, boolean changed) { checkWidget(); Point size; ExpandableLayout layout = (ExpandableLayout) 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); return new Point(trim.width, trim.height); }
@Override protected void layout(Composite parent, boolean changed) { initCache(changed);
if ((expansionStyle & TITLE_BAR) != 0) setBackgroundMode(SWT.INHERIT_DEFAULT); super.setLayout(new ExpandableLayout()); if (hasTitleBar()) { this.addPaintListener(new PaintListener() {
@Override protected void layout(Composite parent, boolean changed) { initCache(changed);
@Override protected Point computeSize(Composite parent, int wHint, int hHint, boolean changed) { initCache(changed);
if ((expansionStyle & TITLE_BAR) != 0) setBackgroundMode(SWT.INHERIT_DEFAULT); super.setLayout(new ExpandableLayout()); if (hasTitleBar()) { this.addPaintListener(e -> {
@Override protected Point computeSize(Composite parent, int wHint, int hHint, boolean changed) { initCache(changed);
/** * Computes the size of the expandable composite. * * @see org.eclipse.swt.widgets.Composite#computeSize */ @Override public Point computeSize(int wHint, int hHint, boolean changed) { checkWidget(); Point size; ExpandableLayout layout = (ExpandableLayout) 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); return new Point(trim.width, trim.height); }
@Override public int computeMinimumWidth(Composite parent, boolean changed) { return computeSize(parent, MIN_WIDTH, SWT.DEFAULT, changed).x; }
@Override public int computeMinimumWidth(Composite parent, boolean changed) { return computeSize(parent, 0, SWT.DEFAULT, changed).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; } }