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


Java EMenuService类代码示例

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


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

示例1: createPartControl

import org.eclipse.e4.ui.workbench.swt.modeling.EMenuService; //导入依赖的package包/类
@PostConstruct
public void createPartControl(Composite parent, EMenuService menuService, Shell shell, EPartService partService, EModelService modelService, MApplication application) {
	// Treeviewer
	this.viewer = new TreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
	menuService.registerContextMenu(this.viewer.getControl(),
			"ch.droptilllate.application.popupmenu.table");		
	
	
	this.shell = shell;
	this.parent = parent;
	this.controller = ViewController.getInstance();
	this.controller.initViewController(this.viewer, shell, partService, modelService, application);
	addListeners();
	addCloseListener(parent);
	
}
 
开发者ID:dev131,项目名称:DropTillLate_Application,代码行数:17,代码来源:TreeView.java

示例2: postConstruct

import org.eclipse.e4.ui.workbench.swt.modeling.EMenuService; //导入依赖的package包/类
@PostConstruct
public void postConstruct(Composite parent, EMenuService menuService) {
	parent.setLayout(new GridLayout(2, false));

	text = new Combo(parent, SWT.BORDER);
	text.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
	text.add("http://dl.dropboxusercontent.com/u/5004102/My.model");
	text.add("file://C:/Users/jongw/Dropbox/Public/My.model");

	Button btnNewButton = new Button(parent, SWT.NONE);
	btnNewButton.addSelectionListener(new SelectionAdapter() {
		@Override
		public void widgetSelected(SelectionEvent e) {
			setInput(e);
		}
	});
	btnNewButton.setText("Load Model");

	Composite composite = new Composite(parent, SWT.NONE);
	composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1));
	composite.setLayout(new TreeColumnLayout());

	treeViewer = new TreeViewer(composite, SWT.BORDER);
	Tree tree = treeViewer.getTree();
	tree.setLinesVisible(true);

	ComposedAdapterFactory composedAdapterFactory = new ComposedAdapterFactory(
			ComposedAdapterFactory.Descriptor.Registry.INSTANCE);

	AdapterFactoryLabelProvider labelProvider = new AdapterFactoryLabelProvider(
			composedAdapterFactory);
	AdapterFactoryContentProvider contentProvider = new AdapterFactoryContentProvider(
			composedAdapterFactory);

	treeViewer.setLabelProvider(labelProvider);
	treeViewer.setContentProvider(contentProvider);

	menuService.registerContextMenu(treeViewer.getControl(),
			"com.remainsoftware.fde.application.part.0.popupmenu.0");

	context.modify(Viewer.class, treeViewer);

}
 
开发者ID:wimjongman,项目名称:FDE,代码行数:44,代码来源:FeatureModelView.java


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