當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。