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


Java IActionBars.getToolBarManager方法代码示例

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


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

示例1: updateActions

import org.eclipse.ui.IActionBars; //导入方法依赖的package包/类
public void updateActions(ISelection selection) {
	chooseFolderAction.setEnabled(activePage instanceof FolderViewerPage);
	copyPathAction.setEnabled(activePage instanceof FolderViewerPage);
	showReadOnlyAction.setEnabled(activePage instanceof PlatformViewerPage);
	
	removeAction.setEnabled(!selection.isEmpty()  && activePage.isSelectionEditable());
	copyAction.setEnabled(!selection.isEmpty());
	boolean leafSelected = ((StructuredSelection) selection).getFirstElement() instanceof KeyValue;
	copyValueAction.setEnabled(!selection.isEmpty() && leafSelected);
	editValueAction.setEnabled(!selection.isEmpty() && leafSelected);
	trackAction.setChecked(activePage.isTracking());
	
	exportAction.setEnabled(!selection.isEmpty() && !leafSelected);
	
	IActionBars bars = getViewSite().getActionBars();
	IToolBarManager toolBarManager = bars.getToolBarManager();
	toolBarManager.removeAll();
	fillLocalToolBar(toolBarManager);
	toolBarManager.update(true);
	
	IMenuManager menuManager = bars.getMenuManager();
	menuManager.removeAll();
	fillLocalPullDown(menuManager);
	menuManager.update(true);
}
 
开发者ID:32kda,项目名称:com.onpositive.prefeditor,代码行数:26,代码来源:PreferenceView.java

示例2: addActionToToolbar

import org.eclipse.ui.IActionBars; //导入方法依赖的package包/类
private void addActionToToolbar(Action action)
	{
		IActionBars actionBars = getViewSite().getActionBars();
//		IMenuManager dropDownMenu = actionBars.getMenuManager();
		IToolBarManager toolBar = actionBars.getToolBarManager();
//		dropDownMenu.add(action);
		toolBar.add(action);	
	}
 
开发者ID:eclipse,项目名称:gemoc-studio-modeldebugging,代码行数:9,代码来源:EnginesStatusView.java

示例3: createControl

import org.eclipse.ui.IActionBars; //导入方法依赖的package包/类
public void createControl(Composite parent) {
	super.createControl(parent);

	labelProvider = new BatchEditorOutlineLabelProvider();

	TreeViewer viewer = getTreeViewer();
	viewer.setContentProvider(contentProvider);
	viewer.addDoubleClickListener(this);
	viewer.setLabelProvider(new DelegatingStyledCellLabelProvider(labelProvider));
	viewer.addSelectionChangedListener(this);

	/* it can happen that input is already updated before control created */
	if (input != null) {
		viewer.setInput(input);
	}
	toggleLinkingAction = new ToggleLinkingAction();
	toggleLinkingAction.setActionDefinitionId(IWorkbenchCommandConstants.NAVIGATE_TOGGLE_LINK_WITH_EDITOR);
	
	IActionBars actionBars = getSite().getActionBars();
	
	IToolBarManager toolBarManager = actionBars.getToolBarManager();
	toolBarManager.add(toggleLinkingAction);
	
	IMenuManager viewMenuManager = actionBars.getMenuManager();
	viewMenuManager.add(new Separator("EndFilterGroup")); //$NON-NLS-1$

	viewMenuManager.add(new Separator("treeGroup")); //$NON-NLS-1$
	viewMenuManager.add(toggleLinkingAction);
	
	
	/*
	 * when no input is set on init state - let the editor rebuild outline
	 * (async)
	 */
	if (input == null && editor != null) {
		editor.rebuildOutline();
	}

}
 
开发者ID:de-jcup,项目名称:eclipse-batch-editor,代码行数:40,代码来源:BatchEditorContentOutlinePage.java

示例4: createControl

import org.eclipse.ui.IActionBars; //导入方法依赖的package包/类
public void createControl(Composite parent) {
	super.createControl(parent);

	labelProvider = new BashEditorOutlineLabelProvider();

	TreeViewer viewer = getTreeViewer();
	viewer.setContentProvider(contentProvider);
	viewer.addDoubleClickListener(this);
	viewer.setLabelProvider(new DelegatingStyledCellLabelProvider(labelProvider));
	viewer.addSelectionChangedListener(this);

	/* it can happen that input is already updated before control created */
	if (input != null) {
		viewer.setInput(input);
	}
	toggleLinkingAction = new ToggleLinkingAction();
	toggleLinkingAction.setActionDefinitionId(IWorkbenchCommandConstants.NAVIGATE_TOGGLE_LINK_WITH_EDITOR);
	
	IActionBars actionBars = getSite().getActionBars();
	
	IToolBarManager toolBarManager = actionBars.getToolBarManager();
	toolBarManager.add(toggleLinkingAction);
	
	IMenuManager viewMenuManager = actionBars.getMenuManager();
	viewMenuManager.add(new Separator("EndFilterGroup")); //$NON-NLS-1$

	viewMenuManager.add(new Separator("treeGroup")); //$NON-NLS-1$
	viewMenuManager.add(toggleLinkingAction);
	
	
	/*
	 * when no input is set on init state - let the editor rebuild outline
	 * (async)
	 */
	if (input == null && editor != null) {
		editor.rebuildOutline();
	}

}
 
开发者ID:de-jcup,项目名称:eclipse-bash-editor,代码行数:40,代码来源:BashEditorContentOutlinePage.java

示例5: addActionToToolbar

import org.eclipse.ui.IActionBars; //导入方法依赖的package包/类
private void addActionToToolbar(Action action) {
	IActionBars actionBars = getViewSite().getActionBars();
	IToolBarManager toolBar = actionBars.getToolBarManager();
	toolBar.add(action);
}
 
开发者ID:eclipse,项目名称:gemoc-studio-modeldebugging,代码行数:6,代码来源:StateGraphViewPart.java


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