本文整理匯總了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);
}