org.eclipse.swt.widgets.CoolBar Java Examples

The following examples show how to use org.eclipse.swt.widgets.CoolBar. 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: BarManager.java    From pmTrans with GNU Lesser General Public License v3.0 6 votes vote down vote up
public void createToolBar() {
	bar = new CoolBar(shell, SWT.FLAT | SWT.TOP);
	// bars
	bar.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));

	createFileSection();
	createEditBar();
	createFontSection();
	createSettingsBar();

	bar.pack();
	bar.addListener(SWT.Resize, new Listener() {

		@Override
		public void handleEvent(Event arg0) {
			pmTrans.adjustLayout();
		}
	});
}
 
Example #2
Source File: LogAnalysis.java    From AndroidRobot with Apache License 2.0 6 votes vote down vote up
public void createToolBar() {
    Composite compCoolBar = new Composite(shell, SWT.BORDER);
    compCoolBar.setLayout(new FillLayout());

    CoolBar coolBarSort = new CoolBar(compCoolBar, SWT.NONE);

    CoolItem coolItemSort = new CoolItem(coolBarSort, SWT.NONE);

    Combo prjCombo = new Combo(coolBarSort, SWT.READ_ONLY);
    prjCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    prjCombo.setItems(new String[] { "显示所有用例", "只显示成功的用例", "只显示失败的用例" });
    prjCombo.select(0);

    Point p = prjCombo.computeSize(SWT.DEFAULT, SWT.DEFAULT);
    prjCombo.setSize(p);
    Point p2 = coolItemSort.computeSize(p.x, p.y);
    coolItemSort.setSize(p2);
    coolItemSort.setControl(prjCombo);

    coolBarSort.pack();

}
 
Example #3
Source File: JframeApp.java    From jframe with Apache License 2.0 6 votes vote down vote up
/**
 * 
 */
protected void createToolBar() {
    CoolBar bar = new CoolBar(shell, SWT.FLAT);
    bar.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
    bar.setLayout(new RowLayout());

    CoolItem item = new CoolItem(bar, SWT.NONE);
    Button button = new Button(bar, SWT.FLAT);
    // button.setLayoutData(new GridData(SWT.LEFT, SWT.FILL, false, true));
    button.setText("Button");
    Point size = button.computeSize(SWT.DEFAULT, SWT.DEFAULT);
    item.setPreferredSize(item.computeSize(size.x, size.y));
    item.setControl(button);

    Rectangle clientArea = shell.getClientArea();
    bar.setLocation(clientArea.x, clientArea.y);
    bar.pack();
}
 
Example #4
Source File: LogAnalysis.java    From AndroidRobot with Apache License 2.0 5 votes vote down vote up
private void createStatusBar() {
    coolBar1 = new CoolBar(shell, SWT.NONE);
    FormData formData1 = new FormData();
    formData1.left = new FormAttachment(0, 0);
    formData1.right = new FormAttachment(100, 0);
    formData1.top = new FormAttachment(100, -24);
    formData1.bottom = new FormAttachment(100, 0);
    coolBar1.setLayoutData(formData1);
    CoolItem coolItem1 = new CoolItem(coolBar1, SWT.NONE);
    toolBar1 = new ToolBar(coolBar1, SWT.NONE);

    ToolItem tiStatusBarTotal = new ToolItem(toolBar1, SWT.NONE);
    ToolItem tiStatusBarPass = new ToolItem(toolBar1, SWT.NONE);
    ToolItem tiStatusBarFail = new ToolItem(toolBar1, SWT.NONE);
    ToolItem tiStatusBarRate = new ToolItem(toolBar1, SWT.NONE);

    tiStatusBarPass.setText("通过:0");
    tiStatusBarFail.setText("失败:0");
    tiStatusBarRate.setText("通过率:0%");
    tiStatusBarTotal.setText("总用例数:0");

    coolItem1.setControl(toolBar1);

    Control control = coolItem1.getControl();
    Point pt = control.computeSize(SWT.DEFAULT, SWT.DEFAULT);
    pt = coolItem1.computeSize(pt.x, pt.y);
    coolItem1.setSize(pt);

    coolBar1.pack();
}
 
Example #5
Source File: ZoomScaleContributionItem.java    From gef with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public void fill(CoolBar parent, int index) {
	throw new UnsupportedOperationException();
}
 
Example #6
Source File: ZoomComboContributionItem.java    From gef with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public void fill(CoolBar parent, int index) {
	throw new UnsupportedOperationException();
}
 
Example #7
Source File: MainShell.java    From RepDev with GNU General Public License v3.0 4 votes vote down vote up
public CoolBar getCoolBar() {
	return this.coolBar;
}
 
Example #8
Source File: MenuManagerCopiedToAddCreateMenuWithMenuParent.java    From Pydev with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public void fill(CoolBar parent, int index) {
}