当前位置: 首页>>代码示例>>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;未经允许,请勿转载。