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


Java ToolBarManager类代码示例

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


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

示例1: createCoolBarManager

import org.eclipse.jface.action.ToolBarManager; //导入依赖的package包/类
/**
 * Create the coolbar manager.
 *
 * @param style the style
 * @return the coolbar manager
 */
@Override
protected CoolBarManager createCoolBarManager(int style) {
	
	CoolBarManager coolBarManager = new CoolBarManager(style);

	actionFactory = new ActionFactory(this);

	ToolBarManager toolBarManager = new ToolBarManager();
	coolBarManager.add(toolBarManager);
	addtoolbarAction(toolBarManager, ImagePathConstant.CLEAR_EXEC_TRACKING_CONSOLE,
			actionFactory.getAction(ClearConsoleAction.class.getName()));
	addtoolbarAction(toolBarManager, ImagePathConstant.CONSOLE_SCROLL_LOCK, 
			actionFactory.getAction(ScrollLockAction.class.getName()));
	
	return coolBarManager;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:23,代码来源:ExecutionTrackingConsole.java

示例2: fillEditionToolBar

import org.eclipse.jface.action.ToolBarManager; //导入依赖的package包/类
protected void fillEditionToolBar(ToolBarManager manager) {
	// add element
	AddContextualAction(manager, 
			new AddElementAction("Add new element", IAction.AS_PUSH_BUTTON, Notifications.notifyRefreshReveal(getContext())));		
	// remove element
	AddContextualAction(manager, 
			new RemoveElementAction("Remove element(s)", IAction.AS_PUSH_BUTTON, Notifications.NOT_REF));		
	// move up
	AddContextualAction(manager, 
			new MoveInDirectionAction(MoveInDirectionAction.getLabel(Direction.UP), IAction.AS_PUSH_BUTTON, Direction.UP, Notifications.NOT_REF));
	// move down
	AddContextualAction(manager,
			new MoveInDirectionAction(MoveInDirectionAction.getLabel(Direction.DOWN), IAction.AS_PUSH_BUTTON, Direction.DOWN, Notifications.NOT_REF));		
	// copy
	AddContextualAction(manager,		
			new CopyElementAction("Copy element(s)", IAction.AS_PUSH_BUTTON, Notifications.NONE));
	// paste
	AddContextualAction(manager,
			new PasteElementAction("Paste element(s)", IAction.AS_PUSH_BUTTON, Notifications.NOT_REF));
}
 
开发者ID:Talend,项目名称:avro-schema-editor,代码行数:21,代码来源:SchemaToolBarConfigurationImpl.java

示例3: addResourcesArea

import org.eclipse.jface.action.ToolBarManager; //导入依赖的package包/类
private void addResourcesArea(Composite composite) {  
	ResourceSelectionTree.IToolbarControlCreator toolbarControlCreator = new ResourceSelectionTree.IToolbarControlCreator() {
  public void createToolbarControls(ToolBarManager toolbarManager) {
    toolbarManager.add(new ControlContribution("stealLock") {
      protected Control createControl(Composite parent) {
        stealButton = new Button(parent, SWT.CHECK);
        stealButton.setText(Policy.bind("LockDialog.stealLock")); //$NON-NLS-1$		
        return stealButton;
      }
    });
  }
  public int getControlCount() {
    return 1;
  }
};
	resourceSelectionTree = new ResourceSelectionTree(composite, SWT.NONE, "These files will be locked:", files, new HashMap(), null, false, toolbarControlCreator, null); //$NON-NLS-1$    	
	resourceSelectionTree.setShowRemoveFromViewAction(false);
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:19,代码来源:SvnWizardLockPage.java

示例4: createToolBarManager

import org.eclipse.jface.action.ToolBarManager; //导入依赖的package包/类
/**
 * @see org.eclipse.jface.window.ApplicationWindow#createToolBarManager(int)
 */
@Override
protected ToolBarManager createToolBarManager(final int style) {
	final ToolBarManager toolBarManager = new ToolBarManager(style);

	toolBarManager.add(newFileAction);
	toolBarManager.add(openFileAction);
	toolBarManager.add(saveFileAction);
	toolBarManager.add(new Separator());
	toolBarManager.add(copyUsernameAction);
	toolBarManager.add(copyPasswordAction);
	toolBarManager.add(copyURLAction);
	toolBarManager.add(openUrlAction);
	toolBarManager.add(clearClipboardAction);
	toolBarManager.add(new Separator());
	toolBarManager.add(addRecordAction);
	toolBarManager.add(editRecordAction);
	toolBarManager.add(deleteRecordAction);
	toolBarManager.add(new Separator());
	toolBarManager.add(helpAction);
	return toolBarManager;
}
 
开发者ID:nresare,项目名称:javapasswordsafe,代码行数:25,代码来源:PasswordSafeJFace.java

示例5: fillCoolBar

import org.eclipse.jface.action.ToolBarManager; //导入依赖的package包/类
@Override
protected void fillCoolBar(ICoolBarManager coolBar) {
	IToolBarManager toolBar = new ToolBarManager(SWT.FLAT | SWT.RIGHT);
	coolBar.add(new ToolBarContributionItem(toolBar, "standard")); //$NON-NLS-1$
	
	// For the Back and Forward actions, force their text to be shown on the toolbar,
	// not just their image.  For the remaining actions, the ActionContributionItem
	// is created implicitly with the default presentation mode.
	ActionContributionItem backCI = new ActionContributionItem(backAction);
	backCI.setMode(ActionContributionItem.MODE_FORCE_TEXT);
	toolBar.add(backCI);
	
	ActionContributionItem forwardCI = new ActionContributionItem(forwardAction);
	forwardCI.setMode(ActionContributionItem.MODE_FORCE_TEXT);
	toolBar.add(forwardCI);

	toolBar.add(stopAction);
	toolBar.add(refreshAction);
}
 
开发者ID:NineWorlds,项目名称:xstreamer,代码行数:20,代码来源:BrowserActionBarAdvisor.java

示例6: TFContainer

import org.eclipse.jface.action.ToolBarManager; //导入依赖的package包/类
public TFContainer(Composite parent, int style) {
	super(parent, style);
	GridLayout layout = new GridLayout(2,false);
	layout.marginHeight = 0;
	layout.marginWidth = 0;
	layout.verticalSpacing = 0;
	setLayout(layout);

	toolBar = new ToolBar(this, SWT.HORIZONTAL | SWT.FLAT | SWT.WRAP | SWT.RIGHT);
	
	additionalToolbar = new ToolBar(this, SWT.HORIZONTAL | SWT.FLAT | SWT.WRAP | SWT.RIGHT);
	GridData additionalToolbarGD = new GridData(SWT.RIGHT, SWT.CENTER, true, false);
	additionalToolbar.setLayoutData(additionalToolbarGD);
	additionalToolbarManager = new ToolBarManager(additionalToolbar);
	
	content = new Composite(this, SWT.NONE);
	stackLayout = new StackLayout();
	stackLayout.marginWidth = 0;
	stackLayout.marginHeight = 0;
	content.setLayout(stackLayout);
	content.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1));
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:23,代码来源:TFContainer.java

示例7: createToolBar

import org.eclipse.jface.action.ToolBarManager; //导入依赖的package包/类
@Override
protected void createToolBar(Composite parent) {
	prmtbar = new Composite(parent, SWT.NONE);
	prmtbar.setLayout(new GridLayout(2, false));
	prmtbar.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

	label = new Label(prmtbar, SWT.NONE);
	label.setText(Messages.LeftToolBarManager_label);
	label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

	topToolBar = new ToolBar(prmtbar, SWT.FLAT | SWT.WRAP | SWT.RIGHT);

	tbManager = new ToolBarManager(topToolBar);

	fillToolbar(tbManager);

	refreshToolbar();
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:19,代码来源:LeftToolBarManager.java

示例8: 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

示例9: doCreateInformationControl

import org.eclipse.jface.action.ToolBarManager; //导入依赖的package包/类
public IInformationControl doCreateInformationControl(Shell parent)
{
	if (BrowserInformationControl.isAvailable(parent))
	{
		ToolBarManager tbm = new ToolBarManager(SWT.FLAT);
		CustomBrowserInformationControl iControl = new CustomBrowserInformationControl(parent, null, tbm);
		iControl.setBackgroundColor(documentationHover.getBackgroundColor());
		iControl.setForegroundColor(documentationHover.getForegroundColor());
		documentationHover.populateToolbarActions(tbm, iControl);
		tbm.update(true);
		documentationHover.installLinkListener(iControl);
		return iControl;
	}
	else
	{
		return new DefaultInformationControl(parent, true);
	}
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:19,代码来源:AbstractDocumentationHover.java

示例10: 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

示例11: populateToolbarActions

import org.eclipse.jface.action.ToolBarManager; //导入依赖的package包/类
@Override
public void populateToolbarActions(ToolBarManager tbm, CustomBrowserInformationControl iControl)
{
	final OpenDeclarationAction openDeclarationAction = new OpenDeclarationAction(iControl);
	final OpenHelpAction openHelpAction = new OpenHelpAction(iControl);
	tbm.add(openDeclarationAction);
	tbm.add(openHelpAction);
	IInputChangedListener inputChangeListener = new IInputChangedListener()
	{
		public void inputChanged(Object newInput)
		{
			if (newInput instanceof BrowserInformationControlInput)
			{
				openDeclarationAction.update();
				openHelpAction.update();
			}
		}
	};
	iControl.addInputChangeListener(inputChangeListener);
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:21,代码来源:JSTextHover.java

示例12: 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

示例13: populateToolbarActions

import org.eclipse.jface.action.ToolBarManager; //导入依赖的package包/类
@Override
public void populateToolbarActions(ToolBarManager tbm, CustomBrowserInformationControl iControl)
{
	// @formatter:off
	/*
	final OpenDOMReferenceAction openReferenceAction = new OpenDOMReferenceAction(iControl);
	tbm.add(openReferenceAction);
	IInputChangedListener inputChangeListener = new IInputChangedListener()
	{

		public void inputChanged(Object newInput)
		{
			if (newInput instanceof BrowserInformationControlInput)
			{
				openReferenceAction.update();
			}
		}
	};
	iControl.addInputChangeListener(inputChangeListener);
	*/
	// @formatter:on
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:23,代码来源:HTMLTextHover.java

示例14: ctabFolderTest

import org.eclipse.jface.action.ToolBarManager; //导入依赖的package包/类
@Test
public void ctabFolderTest() {
	InteractiveTest.testCoat("Test coat mux layout behavior inside a CTabFolder.", cmp -> {
		Layouts.setGrid(cmp);
		CTabFolder folder = new CTabFolder(cmp, SWT.BORDER | SWT.CLOSE);
		Layouts.setGridData(folder).grabAll();

		ToolBarManager manager = new ToolBarManager();
		manager.add(Actions.create("Add", () -> {
			CTabItem item = new CTabItem(folder, SWT.NONE);
			item.setText("New control");
			Composite parent = new Composite(folder, SWT.NONE);
			randomColorMux(parent);
			item.setControl(parent);
			item.addListener(SWT.Dispose, e -> item.getControl().dispose());
			folder.setSelection(item);
		}));
		Layouts.setGridData(manager.createControl(cmp)).grabHorizontal();
	});
}
 
开发者ID:diffplug,项目名称:durian-swt,代码行数:21,代码来源:CoatMuxTest.java

示例15: createUI_20_Actions

import org.eclipse.jface.action.ToolBarManager; //导入依赖的package包/类
private void createUI_20_Actions(final Composite parent) {

		final Composite container = new Composite(parent, SWT.NONE);
		GridDataFactory.fillDefaults().grab(true, false).applyTo(container);
		GridLayoutFactory
				.fillDefaults()//
				.numColumns(2)
				.extendedMargins(2, 0, 3, 2)
				.applyTo(container);
		{

			final ToolBar toolbar = new ToolBar(container, SWT.FLAT);

			final ToolBarManager tbm = new ToolBarManager(toolbar);

			tbm.add(_actionAddColor);
			tbm.add(_actionEditSelectedColor);
			tbm.add(_actionEditAllColors);

			tbm.update(true);
		}
	}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:23,代码来源:DialogSelectMap3Color.java


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