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


Java IViewSite.getActionBars方法代碼示例

本文整理匯總了Java中org.eclipse.ui.IViewSite.getActionBars方法的典型用法代碼示例。如果您正苦於以下問題:Java IViewSite.getActionBars方法的具體用法?Java IViewSite.getActionBars怎麽用?Java IViewSite.getActionBars使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.ui.IViewSite的用法示例。


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

示例1: init

import org.eclipse.ui.IViewSite; //導入方法依賴的package包/類
@Override
public void init(IPageBookViewPage page, IConsole console) {
	IPageSite pageSite = page.getSite();
	IWorkbenchPage workbenchPage = pageSite.getPage();
	IViewPart viewPart = workbenchPage.findView(IConsoleConstants.ID_CONSOLE_VIEW);
	IViewSite viewSite = viewPart.getViewSite();
	IActionBars actionBars = viewSite.getActionBars();
	IToolBarManager toolBarManager = actionBars.getToolBarManager();
	IContributionItem[] items = toolBarManager.getItems();
	for(int i = 0; i < items.length; ++i) {
		IContributionItem item = items[i];
		if(item instanceof ActionContributionItem) {
			IAction action = ((ActionContributionItem) item).getAction();
			String text = action.getText();
			if(text.equals("Pi&n Console") || text.equals("Open Console"))
				toolBarManager.remove(item);
		}
	}
}
 
開發者ID:AlexWengh,項目名稱:HMM,代碼行數:20,代碼來源:ConsolePageParticipant.java

示例2: createActions

import org.eclipse.ui.IViewSite; //導入方法依賴的package包/類
/**
 * Actions in addition to the standard plotting actions which
 * should be shown on the plot.
 *
 * @param site
 */
private void createActions(IViewSite site) {

	IActionBars bars = site.getActionBars();
	final List<IContributionManager> mans = Arrays.asList(bars.getToolBarManager(), bars.getMenuManager());

    final IAction configureAxes = new Action("Configure...", Activator.getImageDescriptor("icons/home-for-sale-sign-blue.png")) {

		@Override
		public void run() {

		try {
			IModelDialog<AxisConfiguration>  dialog = ServiceHolder.getInterfaceService().createModelDialog(site.getShell());
			dialog.setPreamble("Please define the axes and their ranges we will map within.");
			dialog.create();
			dialog.setSize(550,450); // As needed
			dialog.setText("Scan Area");
			dialog.setModel(getAxisConfiguration());
			int ok = dialog.open();
			if (ok==IModelDialog.OK) {
				AxisConfiguration conf = dialog.getModel();
				setAxisConfiguration(conf);
			}
		} catch (Exception ne) {
			ErrorDialog.openError(site.getShell(), "Error Showing Plot Configuration", "Please contact your support representative.", new Status(IStatus.ERROR, "org.eclipse.scanning.device.ui", ne.getMessage(), ne));
			logger.error("Cannot configure plot!", ne);
		}
	}
	};
	ViewUtil.addGroups("configure", mans, configureAxes);
}
 
開發者ID:eclipse,項目名稱:scanning,代碼行數:37,代碼來源:PlottingController.java

示例3: contributeToActionBars

import org.eclipse.ui.IViewSite; //導入方法依賴的package包/類
private void contributeToActionBars ( final IViewSite viewSite )
{
    final IActionBars bars = viewSite.getActionBars ();
    fillLocalPullDown ( bars.getMenuManager () );
    fillLocalToolBar ( bars.getToolBarManager () );
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:7,代碼來源:RealTimeListViewer.java


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