use of org.eclipse.jface.action.StatusLineLayoutData in project dbeaver by serge-rider.
the class StatusLineContributionItemEx method fill.
@Override
public void fill(Composite parent) {
Composite statusLine = parent;
Label sep = new Label(parent, SWT.SEPARATOR);
label = new CLabel(statusLine, SWT.SHADOW_NONE);
label.setText(text);
if (toolTip != null) {
label.setToolTipText(toolTip);
}
// compute the size of the label to get the width hint for the contribution
Point preferredSize = label.computeSize(SWT.DEFAULT, SWT.DEFAULT);
int widthHint = preferredSize.x;
int heightHint = preferredSize.y;
StatusLineLayoutData data = new StatusLineLayoutData();
data.widthHint = widthHint;
label.setLayoutData(data);
data = new StatusLineLayoutData();
data.heightHint = heightHint;
sep.setLayoutData(data);
}
use of org.eclipse.jface.action.StatusLineLayoutData in project lwjgl by LWJGL.
the class FpsStatusLineItem method fill.
/**
* {@inheritDoc}
*
* @see org.eclipse.jface.action.ContributionItem#fill(org.eclipse.swt.widgets.Composite)
*/
@Override
public void fill(Composite i_parent) {
Label sep = new Label(i_parent, SWT.SEPARATOR);
m_label = new CLabel(i_parent, SWT.SHADOW_NONE);
StatusLineLayoutData data = new StatusLineLayoutData();
data.widthHint = getWidthHint(i_parent);
m_label.setLayoutData(data);
data = new StatusLineLayoutData();
data.heightHint = getHeightHint(i_parent);
sep.setLayoutData(data);
updateCounter();
}
use of org.eclipse.jface.action.StatusLineLayoutData in project translationstudio8 by heartsome.
the class XLIFFEditorStatusLineItemWithProgressBar method fill.
public void fill(Composite parent) {
super.fill(parent);
Composite container = new Composite(parent, SWT.NONE);
GridLayout gl = new GridLayout(1, false);
gl.marginWidth = 0;
gl.marginHeight = 0;
gl.marginTop = 0;
gl.marginRight = 0;
gl.marginBottom = 0;
container.setLayout(gl);
// progressBar = new ProgressBar(container, SWT.SMOOTH);
// GridData gdPprogressBar = new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1);
// gdPprogressBar.heightHint = 16;
// gdPprogressBar.widthHint = 130;
// progressBar.setLayoutData(gdPprogressBar);
// progressBar.setMinimum(0); // 最小值
// progressBar.setMaximum(100);// 最大值
// progressBar.setSelection(progressValue);
// progressBar.setToolTipText(defaultMessage);
GC gc = new GC(statusLine);
int widthHint = gc.textExtent("100%").x;
// int height = gc.textExtent("100%").y;
gc.dispose();
label = new Label(container, SWT.NONE);
GridData gd = new GridData(SWT.LEFT, SWT.CENTER, false, true, 1, 1);
gd.widthHint = widthHint;
label.setLayoutData(gd);
label.setText(progressValue + "%");
StatusLineLayoutData data = new StatusLineLayoutData();
container.setLayoutData(data);
}
Aggregations