/* package */ int getHeaderHeight() { int headerHeight= fLeftLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).y; headerHeight= Math.max(headerHeight, fDirectionLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).y); return headerHeight; }
/** * Calculates the height of the header. */ /* package */ int getHeaderHeight() { int headerHeight= fLeftLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).y; headerHeight= Math.max(headerHeight, fDirectionLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).y); return headerHeight; }
/** * {@inheritDoc} */ public Point computeSize(final int wHint, final int hHint, final boolean changed) { return super.computeSize(wHint, Math.max(24, hHint), changed); }
@Override public Point computeSize(int wHint, int hHint, boolean changed) { return super.computeSize(wHint, Math.max(24, hHint), changed); } };
public Point computeSize(int wHint, int hHint, boolean changed) { return super.computeSize(wHint, Math.max(24, hHint), changed); } };
@Override public void fill(Composite parent) { statusLine = parent; Label sep = new Label(parent, SWT.SEPARATOR); label = new CLabel(statusLine, SWT.SHADOW_NONE); label.setText(text); if (charWidth == CALC_TRUE_WIDTH) { // compute the size of the label to get the width hint for the contribution Point preferredSize = label.computeSize(SWT.DEFAULT, SWT.DEFAULT); widthHint = preferredSize.x; heightHint = preferredSize.y; } else if (widthHint < 0) { // Compute the size base on 'charWidth' average char widths GC gc = new GC(statusLine); gc.setFont(statusLine.getFont()); FontMetrics fm = gc.getFontMetrics(); widthHint = fm.getAverageCharWidth() * charWidth; heightHint = fm.getHeight(); gc.dispose(); } StatusLineLayoutData data = new StatusLineLayoutData(); data.widthHint = widthHint; label.setLayoutData(data); data = new StatusLineLayoutData(); data.heightHint = heightHint; sep.setLayoutData(data); }
public void fill(Composite parent) { statusLine = parent; Label sep = new Label(parent, SWT.SEPARATOR); label = new CLabel(statusLine, SWT.SHADOW_NONE); label.setText(text); if (charWidth == CALC_TRUE_WIDTH) { // compute the size of the label to get the width hint for the contribution Point preferredSize = label.computeSize(SWT.DEFAULT, SWT.DEFAULT); widthHint = preferredSize.x; heightHint = preferredSize.y; } else if (widthHint < 0) { // Compute the size base on 'charWidth' average char widths GC gc = new GC(statusLine); gc.setFont(statusLine.getFont()); FontMetrics fm = gc.getFontMetrics(); widthHint = fm.getAverageCharWidth() * charWidth; heightHint = fm.getHeight(); gc.dispose(); } StatusLineLayoutData data = new StatusLineLayoutData(); data.widthHint = widthHint; label.setLayoutData(data); data = new StatusLineLayoutData(); data.heightHint = heightHint; sep.setLayoutData(data); }
@Override public void fill(Composite parent) { statusLine = parent; Label sep = new Label(parent, SWT.SEPARATOR); label = new CLabel(statusLine, SWT.SHADOW_NONE); label.setText(text); if (charWidth == CALC_TRUE_WIDTH) { // compute the size of the label to get the width hint for the contribution Point preferredSize = label.computeSize(SWT.DEFAULT, SWT.DEFAULT); widthHint = preferredSize.x; heightHint = preferredSize.y; } else if (widthHint < 0) { // Compute the size base on 'charWidth' average char widths GC gc = new GC(statusLine); gc.setFont(statusLine.getFont()); FontMetrics fm = gc.getFontMetrics(); widthHint = fm.getAverageCharWidth() * charWidth; heightHint = fm.getHeight(); gc.dispose(); } StatusLineLayoutData data = new StatusLineLayoutData(); data.widthHint = widthHint; label.setLayoutData(data); data = new StatusLineLayoutData(); data.heightHint = heightHint; sep.setLayoutData(data); }
int headerHeight= fLeftLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).y; Rectangle r= composite.getClientArea();
Point size = toolTipLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT); if (size.x > 600) { size = toolTipLabel.computeSize(600, SWT.DEFAULT, true);
size = toolTipLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT); if (size.x > 600) { size = toolTipLabel.computeSize(600, SWT.DEFAULT, true); toolTipShell.setData("TableCellSWT", cell); toolTipLabel.setImage(image); size = toolTipLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT);
int twidth = bounds.width - marginWidth - marginWidth; if (label != null) labelSize = label.computeSize(SWT.DEFAULT, SWT.DEFAULT, true); if (labelSize != null) twidth -= labelSize.x + 4;
public void layout(Composite composite, boolean force) { int headerHeight= fLeftLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).y; Rectangle r= composite.getClientArea();