當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。