本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}