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


Java EPartService.createPart方法代码示例

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


在下文中一共展示了EPartService.createPart方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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

示例3: 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

示例4: openEditor

import org.eclipse.e4.ui.workbench.modeling.EPartService; //导入方法依赖的package包/类
private void openEditor(EPartService partService, IEditorInputResource eir){

		String editorPartID = findEditorID(eir);
		String resourcePath = eir.getResource().getFullPath().toString();
		
		MPart part = null;
		
		//find existing
		for(MPart p : partService.getParts()){
			String path = p.getPersistedState().get(AlternativeEditor.ALTERNATIVE_RESOURCE);
			if(path != null && path.equals(resourcePath)){
				part = p;
			}
		}
		
		if(part == null){
			MPartStack stack = (MPartStack)modelService.find("org.eclipse.e4.primaryDataStack", application);
			if(stack != null){
				part = partService.createPart(editorPartID);
				part.getProperties().put(AlternativeEditor.ALTERNATIVE_RESOURCE, eir.getResource().getFullPath().toString());
				
				stack.getChildren().add(part);				
				partService.showPart(part, PartState.ACTIVATE);
			}
		}
		else{
			partService.showPart(part, PartState.ACTIVATE);
		}
		
	}
 
开发者ID:CloudScale-Project,项目名称:Environment,代码行数:31,代码来源:OpenAlternativeHandler.java

示例5: execute

import org.eclipse.e4.ui.workbench.modeling.EPartService; //导入方法依赖的package包/类
@Execute
public void execute(EPartService partService, EModelService modelService, @Named("part_id") String partID) {
	MPart part = partService.findPart(partID);
			
	if(part == null){
		MPartStack stack = (MPartStack)modelService.find("org.eclipse.e4.primaryDataStack", application);
		if(stack != null){
			part = partService.createPart(partID);
			stack.getChildren().add(part);
		}
	}
	
	partService.showPart(part, PartState.ACTIVATE);
}
 
开发者ID:CloudScale-Project,项目名称:Environment,代码行数:15,代码来源:OpenPartHandler.java

示例6: copyPart

import org.eclipse.e4.ui.workbench.modeling.EPartService; //导入方法依赖的package包/类
/**
 * Copy all available parameters from initial part to build part
 * 
 * @param partService
 *            EPartService
 * @param activePart
 *            initial part
 * @return MPart finite part
 */
private MPart copyPart(EPartService partService, MPart activePart) {

    MPart newPart = partService.createPart(IdStorage.DYNAMIC_PART_DESCRIPTOR_ID);
    newPart = internalCopyPart(newPart, activePart);

    return newPart;
}
 
开发者ID:e4c,项目名称:EclipseCommander,代码行数:17,代码来源:PartServiceImpl.java


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