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


Java MPartStack.getChildren方法代码示例

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


在下文中一共展示了MPartStack.getChildren方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getOpenedEditors

import org.eclipse.e4.ui.model.application.ui.basic.MPartStack; //导入方法依赖的package包/类
public static HashSet<MPart> getOpenedEditors(){
	
	EModelService modelService = CloudscaleContext.getGlobalContext().get(EModelService.class);
	MApplication app = CloudscaleContext.getGlobalContext().get(MApplication.class);

	if(modelService == null){
		throw new IllegalSelectorException();
	}
	if(app == null){
		throw new IllegalSelectorException();
	}
	
	HashSet<MPart> out = new HashSet<MPart>();
	MPartStack stack = (MPartStack)modelService.find("org.eclipse.e4.primaryDataStack", app);
	
	for(MStackElement el : stack.getChildren()){
		if(el instanceof MPart){
			MPart part = (MPart)el;
			if(part.getContext() != null){
				out.add(part);
			}
		}
	}
	return out;
}
 
开发者ID:CloudScale-Project,项目名称:Environment,代码行数:26,代码来源:ExplorerUtils.java

示例2: copyPart

import org.eclipse.e4.ui.model.application.ui.basic.MPartStack; //导入方法依赖的package包/类
@Override
public boolean copyPart(MPart activePart, PartCopyType copyType) {

    // 1. copy part
    MPart newPart = copyPart(partService, activePart);

    // 2. get panel
    MPartStack panel = getPanel(modelService, application, activePart, copyType);

    // 3. add part into panel
    if (panel != null && panel.getChildren() != null) {
        panel.getChildren().add(newPart);
    }

    // 4. add created part to opened parts set
    openedParts.add(newPart);

    lastPart = newPart;
    // TODO Send out events
    // broker.post(MyEventConstants.TOPIC_TODO_NEW, updateTodo);

    // 6. show part
    showPart(partService, newPart, activePart);

    // 6. resolve selections
    // if (PartCopyType.COPY == copyType) {
    // tabService.clearSelection(getVisiblePart(activePart,
    // !stayActiveTab));
    // tabService.setSelection(getVisiblePart(activePart, stayActiveTab));
    // }

    // else if (PartCopyType.DUPLICATE == copyType) {
    // tabService.clearSelection(activePart);
    // tabService.setSelection(newPart);
    // }

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

示例3: getOpenedAlternatives

import org.eclipse.e4.ui.model.application.ui.basic.MPartStack; //导入方法依赖的package包/类
public static HashSet<IEditorInputResource> getOpenedAlternatives(){
	
	EModelService modelService = CloudscaleContext.getGlobalContext().get(EModelService.class);
	MApplication app = CloudscaleContext.getGlobalContext().get(MApplication.class);

	if(modelService == null){
		throw new IllegalSelectorException();
	}
	if(app == null){
		throw new IllegalSelectorException();
	}
	
	HashSet<IEditorInputResource> out = new HashSet<IEditorInputResource>();
	MPartStack stack = (MPartStack)modelService.find("org.eclipse.e4.primaryDataStack", app);
	
	for(MStackElement el : stack.getChildren()){
		if(el instanceof MPart){
			MPart part = (MPart)el;
			if(part.getContext() != null){
				IEditorInputResource alternative = part.getContext().get(IEditorInputResource.class);
				if(alternative != null){
					out.add(alternative);
				}
			}
		}
	}
	return out;
}
 
开发者ID:CloudScale-Project,项目名称:Environment,代码行数:29,代码来源:ToolchainUtils.java

示例4: isViewInsideFastview

import org.eclipse.e4.ui.model.application.ui.basic.MPartStack; //导入方法依赖的package包/类
private static boolean isViewInsideFastview(MPartStack stack, String placeholderId){
	if (stack != null) {
		for (MStackElement stackElement : stack.getChildren()) {
			if (stackElement.getElementId().equals(placeholderId)) {
				return true;
			}
		}
	}
	return false;
}
 
开发者ID:elexis,项目名称:elexis-3-core,代码行数:11,代码来源:ElexisFastViewUtil.java


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