本文整理汇总了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);
}
示例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);
}