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


Java MStackElement类代码示例

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


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

示例1: getOpenedEditors

import org.eclipse.e4.ui.model.application.ui.basic.MStackElement; //导入依赖的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: activate

import org.eclipse.e4.ui.model.application.ui.basic.MStackElement; //导入依赖的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

示例3: setActiveTerminology

import org.eclipse.e4.ui.model.application.ui.basic.MStackElement; //导入依赖的package包/类
private void setActiveTerminology( EModelService modelService, MApplication application) {
	MPartStack stack = (MPartStack) modelService.find(TermSuiteUI.UI_MAIN_PART_STACK, application);
	MStackElement element = stack.getSelectedElement();
	if(element != null && element instanceof MPart) {
		MPart activePart = (MPart) element;
		if(activePart.getObject() instanceof TerminologyPart)
			updateActiveTerminology((activePart.getContext().get(ETerminology.class)));
	}
}
 
开发者ID:termsuite,项目名称:termsuite-ui,代码行数:10,代码来源:StatsPart.java

示例4: getPartStack

import org.eclipse.e4.ui.model.application.ui.basic.MStackElement; //导入依赖的package包/类
private MPartStack getPartStack(MPart childPart) {
	MStackElement stackElement = childPart;
	MPartStack newStack = BasicFactoryImpl.eINSTANCE.createPartStack();
	newStack.getChildren().add(stackElement);
	newStack.setSelectedElement(stackElement);
	return newStack;				
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:8,代码来源:DwGraphicalFeatureModelEditor.java

示例5: getOppositePart

import org.eclipse.e4.ui.model.application.ui.basic.MStackElement; //导入依赖的package包/类
@Override
public MPart getOppositePart(MPart activePart) {
    MPart visiblePart = null;

    if (activePart != null) {
        // find opposite panel
        String oppositePanelId = getPanelId(activePart, PartCopyType.COPY);
        MUIElement oppositePanel = modelService.find(oppositePanelId, application);

        if (oppositePanel instanceof MPartStack) {
            for (MStackElement elem : ((MPartStack) oppositePanel).getChildren()) {
                if (elem instanceof MPart) {
                    MPart part = (MPart) elem;

                    // get opposite visible part
                    if (partService.isPartVisible(part)) {
                        visiblePart = part;

                        if (log.isDebugEnabled()) {
                            log.debug("tab number {} - oposite tab number {}", //$NON-NLS-1$
                                    tabService.getTabId(activePart), tabService.getTabId(visiblePart));
                        }
                        break;
                    }
                }
            }
        }
    }
    return visiblePart;
}
 
开发者ID:e4c,项目名称:EclipseCommander,代码行数:31,代码来源:PartServiceImpl.java

示例6: getOpenedAlternatives

import org.eclipse.e4.ui.model.application.ui.basic.MStackElement; //导入依赖的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

示例7: getStack

import org.eclipse.e4.ui.model.application.ui.basic.MStackElement; //导入依赖的package包/类
/**
 * Wrap the editor (MPart) up in a new PartStack
 * @param apart
 * @return the wrapped MPart
 */
private MPartStack getStack(MPart apart, MElementContainer<MUIElement> parent) {
	MPartStack result = MBasicFactory.INSTANCE.createPartStack();
	MStackElement stackElement = (MStackElement) apart;
	parent.getChildren().remove(apart);
	result.getChildren().add(stackElement);
	result.setSelectedElement(stackElement);
	return result;
}
 
开发者ID:MulgaSoft,项目名称:e4macs,代码行数:14,代码来源:WindowSplitCmd.java

示例8: isViewInsideFastview

import org.eclipse.e4.ui.model.application.ui.basic.MStackElement; //导入依赖的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

示例9: caseStackElement

import org.eclipse.e4.ui.model.application.ui.basic.MStackElement; //导入依赖的package包/类
@Override
public Adapter caseStackElement(MStackElement object) {
	return createStackElementAdapter();
}
 
开发者ID:scela,项目名称:EclipseCon2014,代码行数:5,代码来源:ExtensionsAdapterFactory.java

示例10: caseStackElement

import org.eclipse.e4.ui.model.application.ui.basic.MStackElement; //导入依赖的package包/类
/**
 * Returns the result of interpreting the object as an instance of '<em>Stack Element</em>'.
 * <!-- begin-user-doc -->
 * This implementation returns null;
 * returning a non-null result will terminate the switch.
 * <!-- end-user-doc -->
 * @param object the target of the switch.
 * @return the result of interpreting the object as an instance of '<em>Stack Element</em>'.
 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
 * @generated
 */
public T caseStackElement(MStackElement object) {
	return null;
}
 
开发者ID:scela,项目名称:EclipseCon2014,代码行数:15,代码来源:ExtensionsSwitch.java


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