當前位置: 首頁>>代碼示例>>Java>>正文


Java ToolBar類代碼示例

本文整理匯總了Java中org.eclipse.swt.widgets.ToolBar的典型用法代碼示例。如果您正苦於以下問題:Java ToolBar類的具體用法?Java ToolBar怎麽用?Java ToolBar使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ToolBar類屬於org.eclipse.swt.widgets包,在下文中一共展示了ToolBar類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: ToolBarNavigator

import org.eclipse.swt.widgets.ToolBar; //導入依賴的package包/類
public ToolBarNavigator ( final Composite parent, final int style, final ViewManager viewManager )
{
    this.viewManager = viewManager;
    this.toolbar = new ToolBar ( parent, style );
    this.resourceManager = new LocalResourceManager ( JFaceResources.getResources ( parent.getDisplay () ) );

    this.toolbar.addDisposeListener ( new DisposeListener () {

        @Override
        public void widgetDisposed ( final DisposeEvent e )
        {
            handleDispose ();
        }
    } );

    viewManager.addViewManagerListener ( this );
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:18,代碼來源:ToolBarNavigator.java

示例2: createContent

import org.eclipse.swt.widgets.ToolBar; //導入依賴的package包/類
private void createContent() {
    toolBar = new ToolBar(this, SWT.HORIZONTAL);
    toolBar.setEnabled(false);
    GridLayout layout = new GridLayout();
    GridData layoutData = new GridData(SWT.FILL, SWT.TOP, true, false);
    toolBar.setLayout(layout);
    toolBar.setLayoutData(layoutData);

    ToolItem cancelProcessToolItem = new ToolItem(toolBar, SWT.PUSH);
    cancelProcessToolItem.setText(resourceBundle.getString("cancel_process"));
    cancelProcessToolItem.addListener(SWT.Selection, event -> {
        listeners.forEach(DBProcessInfoViewListener::dbProcessInfoViewCancelProcessToolItemClicked);
    });

    ToolItem terminateProcessToolItem = new ToolItem(toolBar, SWT.PUSH);
    terminateProcessToolItem.setText(resourceBundle.getString("kill_process"));
    terminateProcessToolItem.addListener(SWT.Selection, event -> {
        listeners.forEach(DBProcessInfoViewListener::dbProcessInfoViewTerminateProcessToolItemClicked);
    });

    processInfoText = new Text(this, SWT.MULTI | SWT.READ_ONLY | SWT.WRAP | SWT.V_SCROLL);
    GridData textLayoutData = new GridData(SWT.FILL, SWT.BOTTOM, true, false);
    textLayoutData.heightHint = 200;
    processInfoText.setLayoutData(textLayoutData);
}
 
開發者ID:technology16,項目名稱:pgsqlblocks,代碼行數:26,代碼來源:DBProcessInfoView.java

示例3: deleteToolItem

import org.eclipse.swt.widgets.ToolBar; //導入依賴的package包/類
private void deleteToolItem(ToolBar toolBar) {
	ToolItem tltmDelete = new ToolItem(toolBar, SWT.NONE);
	tltmDelete.setWidth(5);
	tltmDelete.setImage(ImagePathConstant.DELETE_BUTTON.getImageFromRegistry());
	tltmDelete.addSelectionListener(new SelectionAdapter() {
		@Override
		public void widgetSelected(SelectionEvent e) {
			for (TableItem tableItem : inputFieldTable.getSelection()) {
				inputFields.remove(String.valueOf(tableItem.getData()));
			}
			inputFieldTableViewer.refresh();
			dialog.refreshErrorLogs();
			addCusrsorToLastRow();
		}
	});
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:17,代碼來源:InputFieldsComposite.java

示例4: createContent

import org.eclipse.swt.widgets.ToolBar; //導入依賴的package包/類
private void createContent() {
    toolBar = new ToolBar(this, SWT.HORIZONTAL);
    GridData layoutData = new GridData(SWT.FILL, SWT.FILL, true, true);
    GridLayout layout = new GridLayout();
    layout.marginWidth = 0;
    layout.marginHeight = 0;
    SashForm sashForm = new SashForm(this, SWT.HORIZONTAL);
    sashForm.SASH_WIDTH = 2;
    sashForm.setLayoutData(layoutData);
    sashForm.setLayout(layout);

    createLeftPanel(sashForm);
    createRightPanel(sashForm);

    sashForm.setSashWidth(2);
    sashForm.setWeights(new int[] {15, 85});
}
 
開發者ID:technology16,項目名稱:pgsqlblocks,代碼行數:18,代碼來源:ProcessesView.java

示例5: createTagComposite

import org.eclipse.swt.widgets.ToolBar; //導入依賴的package包/類
/**
 * Creates the actual GUI widgets.
 */
private static Composite createTagComposite(Composite parent, TagVM tagVm, TagToolItemConfigurator configurator) {
	Composite tagContainer = new Composite(parent, SWT.BORDER);
	GridLayout layout = new GridLayout();
	layout.numColumns = 2;
	tagContainer.setLayout(layout);

	Label tagLabel = new Label(tagContainer, SWT.NONE);
	tagLabel.setText(tagVm.getName());
	GridData gdl = new GridData();
	gdl.verticalAlignment = GridData.CENTER;
	tagLabel.setLayoutData(gdl);

	ToolBar toolBar = new ToolBar(tagContainer, SWT.FLAT);
	Rectangle clientArea = tagContainer.getClientArea();
	toolBar.setLocation(clientArea.x, clientArea.y);
	configurator.setupToolbar(toolBar, tagVm);

	toolBar.pack();
	return tagContainer;
}
 
開發者ID:sjclemen,項目名稱:peten,代碼行數:24,代碼來源:TagListSelected.java

示例6: createToolItem

import org.eclipse.swt.widgets.ToolBar; //導入依賴的package包/類
public ToolItem createToolItem(final ToolBar toolbar) {
    configureResources();
    item = new ToolItem(toolbar, SWT.RADIO);
    item.setImage(getImage());
    item.setToolTipText(getToolTip());
    item.addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(SelectionEvent e) {
            js.showPage(JSmoothPage.this);
            ToolItem[] items = toolbar.getItems();
            for (int i = 0; i < items.length; i++) {
                if (items[i] != item) items[i].setSelection(false);
            }
        }
    });
    return item;
}
 
開發者ID:BisonSchweizAG,項目名稱:JSmooth,代碼行數:17,代碼來源:JSmoothPage.java

示例7: createComposites

import org.eclipse.swt.widgets.ToolBar; //導入依賴的package包/類
private void createComposites(Composite parent) {
	ToolBar toolBar = new ToolBar(parent, SWT.VERTICAL | SWT.FLAT | SWT.WRAP);
	toolBar.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true , true));
	
	Composite option = new Composite(parent,SWT.NONE);
	option.setLayout(new FormLayout());
	
	initOptions(toolBar,option);
	
	Point optionSize = computeOptionsSize(0 , toolBar.computeSize(SWT.DEFAULT,SWT.DEFAULT).y );
	option.setLayoutData(new GridData(optionSize.x,optionSize.y));
	
	if( this.options.size() > 0 ){
		select((Option)this.options.get(0));
	}
}
 
開發者ID:theokyr,項目名稱:TuxGuitar-1.3.1-fork,代碼行數:17,代碼來源:TGSettingsEditor.java

示例8: main

import org.eclipse.swt.widgets.ToolBar; //導入依賴的package包/類
public static void main(String[] args) {
    Display display = new Display();
    Shell shell = new Shell(display);
    ToolBar bar = new ToolBar(shell, SWT.BORDER|SWT.VERTICAL);
    for (int i = 0; i < 4; i++) {
      ToolItem item = new ToolItem(bar, 0);
//      item.setText("Item " + i);
      item.setImage(Images.APPLICATION);
    }
    bar.pack();

    shell.pack();
    shell.open();
    while (!shell.isDisposed()) {
      if (!display.readAndDispatch())
        display.sleep();
    }
    display.dispose();
  }
 
開發者ID:Transkribus,項目名稱:TranskribusSwtGui,代碼行數:20,代碼來源:ToolBarVertical.java

示例9: createContents

import org.eclipse.swt.widgets.ToolBar; //導入依賴的package包/類
protected Control createContents(Composite parent) {
  // --- Create the window title. ---

  getShell().setText("CoolBar Test");

  String asCoolItemSection[] = { "File", "Formatting", "Search" };
  CoolBar composite = new CoolBar(parent, SWT.NONE);
  for (int idxCoolItem = 0; idxCoolItem < 3; ++idxCoolItem) {
    CoolItem item = new CoolItem(composite, SWT.NONE);
    ToolBar tb = new ToolBar(composite, SWT.FLAT);
    for (int idxItem = 0; idxItem < 3; ++idxItem) {
      ToolItem ti = new ToolItem(tb, SWT.NONE);
      ti
          .setText(asCoolItemSection[idxCoolItem] + " Item #"
              + idxItem);
    }
    Point p = tb.computeSize(SWT.DEFAULT, SWT.DEFAULT);
    tb.setSize(p);
    Point p2 = item.computeSize(p.x, p.y);
    item.setControl(tb);
    item.setSize(p2);
  }
  return composite;
}
 
開發者ID:Transkribus,項目名稱:TranskribusSwtGui,代碼行數:25,代碼來源:SWTCoolBarTestDemo.java

示例10: CanvasToolBarNew

import org.eclipse.swt.widgets.ToolBar; //導入依賴的package包/類
public CanvasToolBarNew(CanvasWidget parent, ToolBar mainTb, ToolBar viewTb, ToolBar editTb, int style) {
		Assert.assertNotNull("mainTb must be given!", mainTb);
//		Assert.assertNotNull("viewTb must be given!", viewTb);
		Assert.assertNotNull("editTb must be given!", editTb);
		
		this.mainTb = mainTb;
		this.viewTb = viewTb;
		this.editTb = editTb;
		
		this.canvasWidget = parent;
		
//		initMainTb(mainTb);
		createViewItems(mainTb);
		createEditItems(editTb);
		
		addListeners();
		updateButtonVisibility();
	}
 
開發者ID:Transkribus,項目名稱:TranskribusSwtGui,代碼行數:19,代碼來源:CanvasToolBarNew.java

示例11: toggleToolbarVisiblity

import org.eclipse.swt.widgets.ToolBar; //導入依賴的package包/類
public void toggleToolbarVisiblity(ToolBar tb, boolean show) {
	if (tb != bar1 && tb != bar2)
		return;
	
	if (!show) {
		tb.setParent(SWTUtil.dummyShell);
	} else {
		tb.setParent(this);
	}
	
	if (tb == bar1) {
		tb.moveAbove(null);
	} else {
		tb.moveAbove(canvas);
	}
	
	pack();
}
 
開發者ID:Transkribus,項目名稱:TranskribusSwtGui,代碼行數:19,代碼來源:CanvasWidget.java

示例12: createUI_20_GalleryToolbars

import org.eclipse.swt.widgets.ToolBar; //導入依賴的package包/類
/**
 * fill gallery actionbar
 * 
 * @param galleryActionBarContainer
 */
private void createUI_20_GalleryToolbars(final Composite galleryActionBarContainer) {

	/*
	 * toolbar actions
	 */
	_galleryToolbar = new ToolBar(galleryActionBarContainer, SWT.FLAT);
	GridDataFactory.fillDefaults()//
			.align(SWT.BEGINNING, SWT.CENTER)
			.applyTo(_galleryToolbar);

	final ToolBarManager tbm = new ToolBarManager(_galleryToolbar);

	tbm.add(_actionToggleFolderGallery);
	tbm.add(_actionNavigateBackward);
	tbm.add(_actionNavigateForward);

	tbm.update(true);
}
 
開發者ID:wolfgang-ch,項目名稱:mytourbook,代碼行數:24,代碼來源:PicDirImages.java

示例13: showViewMenu

import org.eclipse.swt.widgets.ToolBar; //導入依賴的package包/類
protected void showViewMenu(MenuManager manager, ToolBar toolBar) {
	// don't show if the debug button is disabled.
	if (!isVisible()) {
		return;
	}

	Menu menu = manager.createContextMenu(applicationActionButton);
	applicationActionButton.setMenu(menu);

	Rectangle bounds = toolBar.getBounds();
	// Position the menu near the toolitem
	Point topRight = new Point(bounds.x + bounds.x / 10, bounds.height);
	topRight = applicationActionButton.toDisplay(topRight);
	menu.setLocation(topRight.x, topRight.y);

	menu.setVisible(true);

}
 
開發者ID:eclipse,項目名稱:cft,代碼行數:19,代碼來源:ApplicationActionMenuControl.java

示例14: DataMappingComposite

import org.eclipse.swt.widgets.ToolBar; //導入依賴的package包/類
public DataMappingComposite(Composite parent, int style)
{
  super(parent, style);
  
  GridLayout layout = new GridLayout(2, false);
  layout.horizontalSpacing = 0;
  layout.verticalSpacing = 0;
  layout.marginWidth = 0;
  layout.marginHeight = 0;
  this.setLayout(layout);
  
  text = new StyledText(this, SWT.BORDER);
  text.setBackground(getGrey());
  text.setEnabled(false);
  text.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
  text.setTopMargin(2);
  
  ToolBar toolBar = new ToolBar(this, SWT.HORIZONTAL);
  toolBar.setLayoutData(new GridData(SWT.RIGHT, SWT.FILL, false, false, 1, 1));
  btnAttributeBrowser = new ToolItem(toolBar, SWT.NONE);
  btnAttributeBrowser.setImage(IconFactory.get(parent.getDisplay()).getAttribute16());
}
 
開發者ID:ivy-supplements,項目名稱:bpm-beans,代碼行數:23,代碼來源:DataMappingComposite.java

示例15: fill

import org.eclipse.swt.widgets.ToolBar; //導入依賴的package包/類
@Override
public void fill(final ToolBar parent, int index)
{
	toolItem = new ToolItem(parent, SWT.DROP_DOWN);
	toolItem.setImage(actionProvider.getImage());
	// toolItem.setDisabledImage(actionProvider.getDisabledImage());
	// toolItem.setHotImage(actionProvider.getHotImage());
	toolItem.setToolTipText(actionProvider.getToolTip());

	toolItem.addSelectionListener(new SelectionAdapter()
	{

		@Override
		public void widgetSelected(SelectionEvent selectionEvent)
		{
			actionProvider.run(parent);
		}
	});
}
 
開發者ID:apicloudcom,項目名稱:APICloud-Studio,代碼行數:20,代碼來源:DefaultNavigatorContributionItem.java


注:本文中的org.eclipse.swt.widgets.ToolBar類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。