org.eclipse.jface.action.StatusLineLayoutData Java Examples

The following examples show how to use org.eclipse.jface.action.StatusLineLayoutData. 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: XLIFFEditorStatusLineItemWithProgressBar.java    From tmxeditor8 with GNU General Public License v2.0 6 votes vote down vote up
public void fill(Composite parent) {
	super.fill(parent);
	Composite container = new Composite(parent, SWT.NONE);
	GridLayout gl = new GridLayout(2, false);
	gl.marginWidth = 5;
	gl.marginHeight = 3;
	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);

	label = new Label(container, SWT.None);
	label.setText(progressValue + "%");

	StatusLineLayoutData data = new StatusLineLayoutData();
	container.setLayoutData(data);
}
 
Example #2
Source File: XLIFFEditorStatusLineItemWithProgressBar.java    From translationstudio8 with GNU General Public License v2.0 5 votes vote down vote up
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);
	}