• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java EPartService类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: openProgressView

import org.eclipse.e4.ui.workbench.modeling.EPartService; //导入依赖的package包/类
/**
 * Open the progress view in the supplied window.
 *
 * @param window
 */
// TODO E4
public static void openProgressView() {
	Services services = Services.getInstance();
	MPart progressView = (MPart) services.getModelService().find(
	        ProgressManager.PROGRESS_VIEW_NAME, services.getMWindow());
	EPartService partService = services.getPartService();
	if (progressView == null) {
		progressView = partService.createPart(ProgressManager.PROGRESS_VIEW_NAME);
		if (progressView != null)
			partService.showPart(progressView, PartState.VISIBLE);
	}
	if (progressView == null) {
		return;
	}
	partService.activate(progressView);
}
 
开发者ID:termsuite,项目名称:termsuite-ui,代码行数:22,代码来源:ProgressManagerUtil.java


示例2: createPartControl

import org.eclipse.e4.ui.workbench.modeling.EPartService; //导入依赖的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


示例3: initViewController

import org.eclipse.e4.ui.workbench.modeling.EPartService; //导入依赖的package包/类
public void initViewController(TreeViewer viewer, Shell shell, EPartService partService, EModelService modelService, MApplication application) {
	// Treeviewer
	this.viewer = viewer;
	this.shell = shell;
	this.partService = partService;
	this.modelService = modelService;
	this.application = application;
	// Set ContentProvider and Labels
	viewer.setContentProvider(new DropTillLateContentProvider());
	viewer.setLabelProvider(new DropTillLateLabelProvider());
	// Expand the tree
	viewer.setAutoExpandLevel(2);
	// Change TreeTable
	tree = viewer.getTree();
	// Tree table specific code starts fill labels
	tree.setHeaderVisible(true);
	tree.setLinesVisible(true);
	for (TableIdentifier identifier : TableIdentifier.values()) {
		new TreeColumn(tree, SWT.NONE).setText(Messages
				.getTableColumnTitle(identifier));
		tree.getColumn(identifier.ordinal()).setWidth(
				identifier.columnWidth);
	}
	
}
 
开发者ID:dev131,项目名称:DropTillLate_Application,代码行数:26,代码来源:ViewController.java


示例4: execute

import org.eclipse.e4.ui.workbench.modeling.EPartService; //导入依赖的package包/类
@Execute
public void execute(MWindow window, EPartService partService,
		EModelService modelService) {
	// assumes you have only two perspectives
	List<MPerspective> perspectives = modelService.findElements(window,
			null, MPerspective.class, null);
	if (perspectives.size() != 2) {
		System.out.println("works only for exactly two perspectives");
	}
	
	MPerspective activePerspective = modelService
			.getActivePerspective(window);
	if (activePerspective.equals(perspectives.get(0))) {
		partService.switchPerspective(perspectives.get(1));
	} else {
		partService.switchPerspective(perspectives.get(0));
	}
}
 
开发者ID:scela,项目名称:EclipseCon2014,代码行数:19,代码来源:SwitchPerspectiveHandler.java


示例5: forceActivate

import org.eclipse.e4.ui.workbench.modeling.EPartService; //导入依赖的package包/类
/**
 * Cursor enablement for E4
 */
private void forceActivate() {
	EPartService partService = (EPartService)PlatformUI.getWorkbench().getActiveWorkbenchWindow().getService(EPartService.class);
	partService.activate(null);
	partService.activate(partService.getActivePart(),true);
	// E4 activation seems slightly hosed - add this in
	EmacsPlusUtils.asyncUiRun(new Runnable() {
		public void run() {
			try {
				// this will finish activating
				EmacsPlusUtils.executeCommand("org.eclipse.ui.window.activateEditor", null);	//$NON-NLS-1$
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
	});
}
 
开发者ID:MulgaSoft,项目名称:e4macs,代码行数:20,代码来源:SwitchToBufferHandler.java


示例6: afterInit

import org.eclipse.e4.ui.workbench.modeling.EPartService; //导入依赖的package包/类
@PostConstruct
void afterInit(
        final EMenuService inService,
        final EPartService inPartService,
        @Preference(value = RelationsConstants.ACTIVE_BROWSER_ID) @Optional final String inBrowserId) {
	inService.registerContextMenu(styledText.getControl(),
	        RelationsConstants.POPUP_INSPECTOR);

	// work around to have the application's focus on the browser stack
	if (inBrowserId != null) {
		final MPart lBrowser = inPartService.findPart(inBrowserId);
		if (lBrowser != null) {
			inPartService.activate(lBrowser, true);
		}
	}
}
 
开发者ID:aktion-hip,项目名称:relations,代码行数:17,代码来源:InspectorView.java


示例7: openURL

import org.eclipse.e4.ui.workbench.modeling.EPartService; //导入依赖的package包/类
@Execute
void openURL(final EPartService inPartService,
        final MApplication inApplication,
        @Named(IServiceConstants.ACTIVE_SHELL) final Shell inShell) {
	final MPart lPart = inPartService
	        .findPart(RelationsConstants.PART_INSPECTOR);
	if (lPart != null) {
		if (lPart.getObject() instanceof ISelectedTextProvider) { // NOPMD
			String lURL = ((ISelectedTextProvider) lPart.getObject())
			        .getSelection();
			if (!lURL.isEmpty()) {
				if (!BrowserUtil.textIsURL(lURL)) {
					lURL = BrowserUtil.PREFIX_HTTP + lURL;
				}
				BrowserUtil.startBrowser(lURL);
			}
		}
	}
}
 
开发者ID:aktion-hip,项目名称:relations,代码行数:20,代码来源:OpenURLHandler.java


示例8: activate

import org.eclipse.e4.ui.workbench.modeling.EPartService; //导入依赖的package包/类
@Execute
void activate(final EPartService inPartService,
        final EModelService inModelService, final MApplication inApplication) {
	// get browser stack
	final MPartStack lStack = (MPartStack) inModelService.find(
	        RelationsConstants.PART_STACK_BROWSERS, inApplication);
	final Iterator<MStackElement> lParts = lStack.getChildren().iterator();
	// iterate over children
	while (lParts.hasNext()) {
		final MStackElement lElement = lParts.next();
		if (lElement instanceof MPart) {
			final MPart lPart = (MPart) lElement;
			// activate visible
			if (inPartService.isPartVisible(lPart)) {
				inPartService.activate(lPart, true);
				break;
			}
		}
	}
}
 
开发者ID:aktion-hip,项目名称:relations,代码行数:21,代码来源:ActivateViewBrowsers.java


示例9: execute

import org.eclipse.e4.ui.workbench.modeling.EPartService; //导入依赖的package包/类
@Execute
public void execute(EPartService partService, 
		@Named(IServiceConstants.ACTIVE_SHELL) Shell shell,
		EModelService modelService,
		ResourceService resourceService,
		ECommandService commandService,
		EHandlerService handlerService,

		IEclipseContext context,
		MApplication mApplication) {
	
	NewPipelineDialog dialog = new NewPipelineDialog(shell, resourceService);
	if(dialog.open() == Dialog.OK) {
		
		String filename = dialog.getFilename();
		EPipeline pipeline;
		try {
			pipeline = resourceService.createPipeline(filename);
			ParameterizedCommand command = commandService.createCommand(
					OpenObjectHandler.COMMAND_ID, 
					CommandUtil.params(OpenObjectHandler.PARAM_INPUT_OBJECT_ID, resourceService.getResourceId(pipeline)));
			if(handlerService.canExecute(command))
				handlerService.executeHandler(command);

		} catch (IOException e) {
			MessageDialog.openError(shell, "Filename error", e.getMessage());
		}
	}
	
}
 
开发者ID:termsuite,项目名称:termsuite-ui,代码行数:31,代码来源:NewPipelineHandler.java


示例10: execute

import org.eclipse.e4.ui.workbench.modeling.EPartService; //导入依赖的package包/类
@Execute
public void execute(@Named(IServiceConstants.ACTIVE_SHELL) Shell shell, 
		ResourceService resourceService, 
		ESelectionService selectionService, EPartService partService) {
	Object s = selectionService.getSelection();

	boolean ok = MessageDialog.openConfirm(shell, "Confirmation", String.format(
			"Are you sure that you want to remove the %s \"%s\" ?", getResourceTypeName(s), getResourceName(s)));

	if (ok) {
		if (s instanceof EPipeline) {
			resourceService.remove((EPipeline) s);
		} else if (s instanceof ECorpus) {
			resourceService.removeCorpus((ECorpus) s);
		} else if (s instanceof ETerminology) {
			resourceService.removeTerminology((ETerminology) s);
		}

		for (MPart p : partService.getParts()) {
			if (p != null && p.getContext() != null) {
				Object inputObject = p.getContext().get(TermSuiteUI.INPUT_OBJECT);
				if (inputObject != null && inputObject == s) {
					partService.hidePart(p, true);
				}
			}
		}

	}

}
 
开发者ID:termsuite,项目名称:termsuite-ui,代码行数:31,代码来源:RemoveResourceHandler.java


示例11: canExecute

import org.eclipse.e4.ui.workbench.modeling.EPartService; //导入依赖的package包/类
@CanExecute
public boolean canExecute(EPartService partService) {
	if (partService != null) {
		return !partService.getDirtyParts().isEmpty();
	}
	return false;
}
 
开发者ID:DrBookings,项目名称:drbookings,代码行数:8,代码来源:SaveHandler.java


示例12: LogViewPart

import org.eclipse.e4.ui.workbench.modeling.EPartService; //导入依赖的package包/类
@Inject
public LogViewPart(final EPartService partService, final IEclipseContext context, final UISynchronize synchronize,
		@Optional final IBundleResourceLoader bundleResourceService) {
	this.synchronize = synchronize;
	this.logTracker = context.get(LogTracker.class);
	this.bundleResourceLoader = bundleResourceService;
}
 
开发者ID:amitjoy,项目名称:Kura-MQTT-Client-Utility,代码行数:8,代码来源:LogViewPart.java


示例13: SubscribePart

import org.eclipse.e4.ui.workbench.modeling.EPartService; //导入依赖的package包/类
@Inject
public SubscribePart(final MApplication application, final IEclipseContext context,
		final UISynchronize uiSynchronize, final IEventBroker broker,
		@Optional final IBundleResourceLoader bundleResourceService, final MWindow window,
		final EPartService partService) {
	this.uiSynchronize = uiSynchronize;
	this.broker = broker;
	this.window = window;
	this.bundleResourceService = context.get(IBundleResourceLoader.class);
	logTracker = context.get(LogTracker.class);
	this.partService = partService;
}
 
开发者ID:amitjoy,项目名称:Kura-MQTT-Client-Utility,代码行数:13,代码来源:SubscribePart.java


示例14: execute

import org.eclipse.e4.ui.workbench.modeling.EPartService; //导入依赖的package包/类
@Execute
public void execute(EPartService partService) {
	MPart part = partService.findPart(TextAnnotationsPart.PART_ID);
	if (part == null)
	{
		part = partService.createPart(TextAnnotationsPart.PART_ID);
	}
	partService.activate(part);
}
 
开发者ID:cplutte,项目名称:bts,代码行数:10,代码来源:OpenTextAnnotationPartHandler.java


示例15: execute

import org.eclipse.e4.ui.workbench.modeling.EPartService; //导入依赖的package包/类
@Execute
public void execute(EPartService partService, final IWorkbench workbench,
		Shell shell, DBManager dbManager, UISynchronize sync) {
	boolean saveAll = false;
	boolean close = false;
	if (!partService.getDirtyParts().isEmpty()) {
		saveAll = MessageDialog.openConfirm(shell, "Unsaved Data",
				"Unsaved data, do you want to save and restart?");

	} else {
		close = MessageDialog.openConfirm(shell, "Restart",
				"Restart application?");
	}

	if (saveAll) {
		partService.saveAll(false);
	}
	if (close || saveAll) {
		try {
			if (dbManager.optimizationRequired()) {
				// ask user if optimize
				dbManager.optimize();
			}
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		sync.asyncExec(new Runnable() {
			@Override
			public void run() {
				workbench.restart();
			}
		});
	}

}
 
开发者ID:cplutte,项目名称:bts,代码行数:38,代码来源:RestartHandler.java


示例16: execute

import org.eclipse.e4.ui.workbench.modeling.EPartService; //导入依赖的package包/类
@Execute
public void execute(EPartService partService, @Named("partId") String partId) {
	MPart part = partService.findPart(partId);
	if (part == null)
	{
		part = partService.createPart(partId);
	}
	partService.activate(part);
}
 
开发者ID:cplutte,项目名称:bts,代码行数:10,代码来源:OpenPartHandler.java


示例17: canExecute

import org.eclipse.e4.ui.workbench.modeling.EPartService; //导入依赖的package包/类
@CanExecute
public boolean canExecute(
		EPartService partService,
		@Optional @Named(IServiceConstants.ACTIVE_SELECTION) Object selection) {
	boolean can = partService.getActivePart().isDirty();
	return can;
}
 
开发者ID:cplutte,项目名称:bts,代码行数:8,代码来源:SaveHandler.java


示例18: canExecute

import org.eclipse.e4.ui.workbench.modeling.EPartService; //导入依赖的package包/类
@CanExecute
public boolean canExecute(
		EPartService partService,
		@Optional @Named(IServiceConstants.ACTIVE_SELECTION) Object selection) {
	boolean can = !partService.getDirtyParts().isEmpty();
	return can;
}
 
开发者ID:cplutte,项目名称:bts,代码行数:8,代码来源:SaveAllHandler.java


示例19: openNewWindowPerspective

import org.eclipse.e4.ui.workbench.modeling.EPartService; //导入依赖的package包/类
/**
 * Opens the specified perspective in a new window.
 * 
 * @param perspectiveId
 *            The perspective to open; must not be <code>null</code>
 * @throws ExecutionException
 *             If the perspective could not be opened.
 */
private void openNewWindowPerspective(IEclipseContext context, String perspectiveID) {
	MApplication application = context.get(MApplication.class);
	EPartService partService = context.get(EPartService.class);
	EModelService modelService = context.get(EModelService.class);
	
	List<MPerspective> perspectives = modelService.findElements(application, perspectiveID, MPerspective.class, null);
	partService.switchPerspective(perspectives.get(0));
}
 
开发者ID:cplutte,项目名称:bts,代码行数:17,代码来源:ShowPerspectiveHandler.java


示例20: openPerspective

import org.eclipse.e4.ui.workbench.modeling.EPartService; //导入依赖的package包/类
/**
 * Opens the perspective with the given identifier.
 * 
 * @param perspectiveId
 *            The perspective to open; must not be <code>null</code>
 * @throws ExecutionException
 *             If the perspective could not be opened.
 */
private final void openPerspective(IEclipseContext context, String perspectiveID) {
	MApplication application = context.get(MApplication.class);
	EPartService partService = context.get(EPartService.class);
	EModelService modelService = context.get(EModelService.class);
	
	List<MPerspective> perspectives = modelService.findElements(application, perspectiveID, MPerspective.class, null);
	partService.switchPerspective(perspectives.get(0));
}
 
开发者ID:cplutte,项目名称:bts,代码行数:17,代码来源:ShowPerspectiveHandler.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java EvaluationContextExtension类代码示例发布时间:2022-05-21
下一篇:
Java TransPreviewProgressDialog类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap