当前位置: 首页>>代码示例>>Java>>正文


Java ToolBarManager.createControl方法代码示例

本文整理汇总了Java中org.eclipse.jface.action.ToolBarManager.createControl方法的典型用法代码示例。如果您正苦于以下问题:Java ToolBarManager.createControl方法的具体用法?Java ToolBarManager.createControl怎么用?Java ToolBarManager.createControl使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.jface.action.ToolBarManager的用法示例。


在下文中一共展示了ToolBarManager.createControl方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createEmptyWindowContents

import org.eclipse.jface.action.ToolBarManager; //导入方法依赖的package包/类
public Control createEmptyWindowContents(Composite parent)
{
  final IWorkbenchWindow window = getWindowConfigurer().getWindow();
  Composite composite = new Composite(parent, SWT.NONE);
  composite.setLayout(new GridLayout(2, false));
  Display display = composite.getDisplay();
  Color bgCol = display.getSystemColor(SWT.COLOR_TITLE_INACTIVE_BACKGROUND);
  composite.setBackground(bgCol);
  Label label = new Label(composite, SWT.WRAP);
  label.setForeground(display
      .getSystemColor(SWT.COLOR_TITLE_INACTIVE_FOREGROUND));
  label.setBackground(bgCol);
  label.setFont(JFaceResources.getFontRegistry().getBold(
      JFaceResources.DEFAULT_FONT));
  String msg = IDEWorkbenchMessages.IDEWorkbenchAdvisor_noPerspective;
  label.setText(msg);
  ToolBarManager toolBarManager = new ToolBarManager();
  // TODO: should obtain the open perspective action from ActionFactory
  openPerspectiveAction =
      ActionFactory.OPEN_PERSPECTIVE_DIALOG.create(window);
  toolBarManager.add(openPerspectiveAction);
  ToolBar toolBar = toolBarManager.createControl(composite);
  toolBar.setBackground(bgCol);
  return composite;
}
 
开发者ID:debrief,项目名称:limpet,代码行数:26,代码来源:ApplicationWorkbenchWindowAdvisor.java

示例2: createToolBar

import org.eclipse.jface.action.ToolBarManager; //导入方法依赖的package包/类
private void createToolBar(ToolBarManager toolBarManager)
{
	final Composite bars = new Composite(fStatusComposite, SWT.NONE);
	bars.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));

	GridLayout layout = new GridLayout(3, false);
	layout.marginHeight = 0;
	layout.marginWidth = 0;
	layout.horizontalSpacing = 0;
	layout.verticalSpacing = 0;
	bars.setLayout(layout);

	fToolBar = toolBarManager.createControl(bars);
	GridData gd = new GridData(SWT.BEGINNING, SWT.BEGINNING, false, false);
	fToolBar.setLayoutData(gd);

	Composite spacer = new Composite(bars, SWT.NONE);
	gd = new GridData(SWT.FILL, SWT.FILL, true, true);
	gd.widthHint = 0;
	gd.heightHint = 0;
	spacer.setLayoutData(gd);

	addMoveSupport(spacer);
	addResizeSupportIfNecessary(bars);
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:26,代码来源:CustomAbstractInformationControl.java

示例3: createNavigationBar

import org.eclipse.jface.action.ToolBarManager; //导入方法依赖的package包/类
private void createNavigationBar(Composite parent) {
	toolBarManager = new ToolBarManager(SWT.FLAT);
	// toolBarManager.add(consoleAction);
	toolBarManager.add(backAction);
	toolBarManager.add(forwardAction);
	toolBarManager.add(stopAction);
	toolBarManager.add(refreshAction);
	ToolBar toolbar = toolBarManager.createControl(parent);
	toolbar.setLayoutData(GridDataFactory.fillDefaults().create());

	urlCombo = new Combo(parent, SWT.DROP_DOWN);
	urlCombo.setLayoutData(GridDataFactory.fillDefaults().grab(true, false)
			.create());

	urlCombo.addListener(SWT.DefaultSelection, new Listener() {
		public void handleEvent(Event e) {
			setURL(urlCombo.getText());
		}
	});

	ToolBarManager toolBarManager2 = new ToolBarManager(SWT.FLAT);
	toolBarManager2.add(goAction);
	toolbar = toolBarManager2.createControl(parent);
	toolbar.setLayoutData(GridDataFactory.fillDefaults().create());
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:26,代码来源:WebBrowserViewer4Mac.java

示例4: createNavigationBar

import org.eclipse.jface.action.ToolBarManager; //导入方法依赖的package包/类
private void createNavigationBar(Composite parent)
{
	toolBarManager = new ToolBarManager(SWT.FLAT);
	toolBarManager.add(consoleAction);
	toolBarManager.add(backAction);
	toolBarManager.add(forwardAction);
	toolBarManager.add(stopAction);
	toolBarManager.add(refreshAction);
	ToolBar toolbar = toolBarManager.createControl(parent);
	toolbar.setLayoutData(GridDataFactory.fillDefaults().create());

	urlCombo = new Combo(parent, SWT.DROP_DOWN);
	urlCombo.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create());
	urlCombo.addListener(SWT.DefaultSelection, new Listener() {
		
		@Override
		public void handleEvent(Event e) {
			setURL(urlCombo.getText());
		}
	});

	ToolBarManager toolBarManager2 = new ToolBarManager(SWT.FLAT);
	toolBarManager2.add(goAction);
	toolbar = toolBarManager2.createControl(parent);
	toolbar.setLayoutData(GridDataFactory.fillDefaults().create());
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:27,代码来源:WebBrowserViewer.java

示例5: createContents

import org.eclipse.jface.action.ToolBarManager; //导入方法依赖的package包/类
@Override
protected Control createContents(Composite parent) {
  Composite c = new Composite(parent, SWT.BORDER);

  GridLayout gridLayout = new GridLayout(1, false);
  gridLayout.marginWidth = 0;
  gridLayout.marginHeight = 0;
  gridLayout.horizontalSpacing = 0;
  gridLayout.verticalSpacing = 0;
  c.setLayout(gridLayout);

  GridData gd = new GridData(GridData.FILL_HORIZONTAL);
  c.setLayoutData(gd);

  ToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT);
  toolBarManager.add(new OpenFilesAction(this));
  toolBarManager.add(new ScreenshotAction(this, false));
  toolBarManager.add(new ScreenshotAction(this, true));
  toolBarManager.add(new SaveScreenShotAction(this));
  ToolBar tb = toolBarManager.createControl(c);
  tb.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

  mUiAutomatorView = new UiAutomatorView(c, SWT.BORDER);
  mUiAutomatorView.setLayoutData(new GridData(GridData.FILL_BOTH));

  return parent;
}
 
开发者ID:DroidTesting,项目名称:android-uiautomatorviewer,代码行数:28,代码来源:UiAutomatorViewer.java

示例6: createToolBar

import org.eclipse.jface.action.ToolBarManager; //导入方法依赖的package包/类
protected ToolBarManager createToolBar(Composite parent, int style) {
	ToolBarManager toolbarManager = new ToolBarManager(style);
	
	int gridDataStyle = isBeginning(style) ? GridData.HORIZONTAL_ALIGN_BEGINNING : GridData.HORIZONTAL_ALIGN_END;
	
       ToolBar toolbar = toolbarManager.createControl(parent);
       GridData toolbarLayoutdata = new GridData(gridDataStyle);
       toolbarLayoutdata.heightHint = 25;
       toolbar.setLayoutData(toolbarLayoutdata);
       
	return toolbarManager;
}
 
开发者ID:Talend,项目名称:avro-schema-editor,代码行数:13,代码来源:SchemaViewer.java

示例7: createToolBarManager

import org.eclipse.jface.action.ToolBarManager; //导入方法依赖的package包/类
protected ToolBarManager createToolBarManager(Composite parent) {
	ToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT);
	ToolBar toolBar = toolBarManager.createControl(parent);

	// Adapt it to a form if a form tool kit is specified
	adaptControl(toolBar);

	GridDataFactory.fillDefaults().grab(false, false).align(SWT.BEGINNING, SWT.BEGINNING).applyTo(toolBar);
	return toolBarManager;
}
 
开发者ID:eclipse,项目名称:cft,代码行数:11,代码来源:ApplicationActionMenuControl.java

示例8: createToolBar

import org.eclipse.jface.action.ToolBarManager; //导入方法依赖的package包/类
/**
 * Creates a ToolBar in the specified parent composite. The bar is populated
 * using the same actions from {@link #getPlotActions()}.
 * 
 * @param parent
 *            The parent composite that will contain the ToolBar.
 * @return The new ToolBar.
 */
protected ToolBar createToolBar(Composite parent) {
	ToolBar toolBar = null;

	// Create the ToolBarManager and add its content.
	final ToolBarManager toolBarManager = new ToolBarManager();
	for (VizActionTree action : plotActions) {
		toolBarManager.add(action.getContributionItem());
	}

	// Create the ToolBar itself.
	toolBar = toolBarManager.createControl(parent);

	return toolBar;
}
 
开发者ID:eclipse,项目名称:eavp,代码行数:23,代码来源:PlotComposite.java

示例9: ActionButton

import org.eclipse.jface.action.ToolBarManager; //导入方法依赖的package包/类
/**
 * @param parent
 * @param action
 */
public ActionButton(Composite parent, IAction action) {
    super(parent, SWT.NONE);
    RowLayout layout = new RowLayout();
    setLayout(layout);
    layout.marginBottom = 0;
    layout.marginLeft = 0;
    layout.marginRight = 0;
    layout.marginTop = 0;

    ToolBarManager toolBarMgr = new ToolBarManager(SWT.FLAT);
    toolBarMgr.createControl(this);
    toolBarMgr.add(action);
    toolBarMgr.update(true);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:19,代码来源:ActionButton.java

示例10: SideNavComposite

import org.eclipse.jface.action.ToolBarManager; //导入方法依赖的package包/类
/**
     * Constructor.
     * @param parent parent composite
     * @param keyTree key tree
     */
    public SideNavComposite(
            Composite parent, final MessagesEditor editor) {
        super(parent, SWT.BORDER);
        this.editor = editor;

        // Create a toolbar.
        ToolBarManager toolBarMgr = new ToolBarManager(SWT.FLAT);
        ToolBar toolBar = toolBarMgr.createControl(this);

        
        this.treeViewer = new TreeViewer(this,
                SWT.SINGLE | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);

        
        setLayout(new GridLayout(1, false));

        GridData gid;

        gid = new GridData();
        gid.horizontalAlignment = GridData.END;
        gid.verticalAlignment = GridData.BEGINNING;
        toolBar.setLayoutData(gid);
        toolBarMgr.add(new TreeModelAction(editor, treeViewer));
        toolBarMgr.add(new FlatModelAction(editor, treeViewer));
        toolBarMgr.add(new Separator());
        toolBarMgr.add(new ExpandAllAction(editor, treeViewer));
        toolBarMgr.add(new CollapseAllAction(editor, treeViewer));
        toolBarMgr.update(true);
        
        //TODO have two toolbars, one left-align, and one right, with drop
        //down menu
        
        
//        createTopSection();
        createKeyTree();
        new SideNavTextBoxComposite(this, editor);
    }
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:43,代码来源:SideNavComposite.java

示例11: SideNavComposite

import org.eclipse.jface.action.ToolBarManager; //导入方法依赖的package包/类
/**
   * Constructor.
   * 
   * @param parent
   *            parent composite
   * @param keyTree
   *            key tree
   */
  public SideNavComposite(Composite parent, final AbstractMessagesEditor editor) {
      super(parent, SWT.BORDER);
      this.editor = editor;
      
      setLayout(new GridLayout(1, false));
      
      Composite toolBarComposite = new Composite(this, SWT.NONE);
      GridLayout toolbarLayout = new GridLayout(2, false);
      toolbarLayout.marginWidth = 0;
      toolBarComposite.setLayout(toolbarLayout);
      toolBarComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
      
      //Create the filter box
filterTextBox = new Text(toolBarComposite, SWT.BORDER);
filterTextBox.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
filterTextBox.addModifyListener(new ModifyListener() {
	public void modifyText(ModifyEvent e) {
		treeContributor.filterKeyItems(filterTextBox.getText());
		treeViewer.getControl().setRedraw(false);
		treeViewer.refresh();
		if (!filterTextBox.getText().isEmpty())
			treeViewer.expandAll();
		treeViewer.getControl().setRedraw(true);
	}
});
      
      // Create a toolbar.
      ToolBarManager toolBarMgr = new ToolBarManager(SWT.FLAT);
      ToolBar toolBar = toolBarMgr.createControl(toolBarComposite);

      this.treeViewer = new TreeViewer(this, SWT.SINGLE | SWT.BORDER| SWT.V_SCROLL | SWT.H_SCROLL);

      GridData gid;

      gid = new GridData();
      gid.horizontalAlignment = GridData.END;
      gid.verticalAlignment = GridData.BEGINNING;
      toolBar.setLayoutData(gid);
      toolBarMgr.add(new TreeModelAction(editor, treeViewer));
      toolBarMgr.add(new FlatModelAction(editor, treeViewer));
      toolBarMgr.add(new Separator());
      toolBarMgr.add(new ExpandAllAction(editor, treeViewer));
      toolBarMgr.add(new CollapseAllAction(editor, treeViewer));
      toolBarMgr.update(true);

      // TODO have two toolbars, one left-align, and one right, with drop
      // down menu
      // initListener();

      createKeyTree();
      textBoxComp = new SideNavTextBoxComposite(this, editor);
  }
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:61,代码来源:SideNavComposite.java


注:本文中的org.eclipse.jface.action.ToolBarManager.createControl方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。