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


Java MPartStack类代码示例

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


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

示例1: getProjectEditorWindow

import org.eclipse.e4.ui.model.application.ui.basic.MPartStack; //导入依赖的package包/类
/**
 * Returns the project window (Swing or SWT).
 *
 * @param project the project
 * @return the project window
 */
public AwbProjectEditorWindow getProjectEditorWindow(Project project) {
	
	AwbProjectEditorWindow projectEditorWindow = null;
	switch (this.getVisualisationPlatform()) {
	case EclipseFramework:
		// --- SWT editor -------------------
		MPartStack editorStack = (MPartStack) project.getEclipseEModelService().find(AppModelId.PARTSTACK_ORG_AGENTGUI_CORE_PARTSTACK_EDITOR, project.getEclipseMApplication());
		MPart editorPart = project.getEclipseEPartService().createPart(AppModelId.PARTDESCRIPTOR_ORG_AGENTGUI_CORE_PARTDESCRIPTOR_AGENTPROJECT);
		if (editorPart!=null) {
			editorPart.getTransientData().put(Project.class.getName(), project);
			editorPart.setVisible(true);
			editorStack.getChildren().add(editorPart);
			project.getEclipseEPartService().showPart(editorPart, PartState.VISIBLE);

			projectEditorWindow = (AwbProjectEditorWindow) editorPart.getObject();
		}
		break;
		
	case AgentGuiSwing:
		// --- Swing editor -----------------
		projectEditorWindow = new org.agentgui.gui.swing.project.ProjectWindow(project);
		break;
	}
	return projectEditorWindow;
}
 
开发者ID:EnFlexIT,项目名称:AgentWorkbench,代码行数:32,代码来源:UiBridge.java

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

示例3: setup

import org.eclipse.e4.ui.model.application.ui.basic.MPartStack; //导入依赖的package包/类
@PostConstruct
public void setup(IEventBroker eventBroker){
	partStack = (MPartStack)modelService.find("linguine.partstack.advanced."
			+ "dataEditorPartStack", application);
	
	eventBroker.subscribe(LinGUIneEvents.UILifeCycle.OPEN_PROJECT_DATA,
			new EventHandler(){
		@Override
		public void handleEvent(Event event) {
			if(event != null){
				for(String propName: event.getPropertyNames()){
					//Does nothing, but I'm afraid to get rid of it
				}
			}
		}
	});
}
 
开发者ID:Pro-Nouns,项目名称:LinGUIne,代码行数:18,代码来源:DataEditorManager.java

示例4: activate

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

示例5: createFastViewStack

import org.eclipse.e4.ui.model.application.ui.basic.MPartStack; //导入依赖的package包/类
private static MPartStack createFastViewStack(MTrimmedWindow window, MPerspective mPerspective,
	EModelService eModelService){
	
	if (window != null && mPerspective != null) {
		MPartStack mPartStack = eModelService.createModelElement(MPartStack.class);
		mPartStack.setElementId(ELEXIS_FASTVIEW_STACK);
		mPartStack.setToBeRendered(true);
		mPartStack.getTags().add("Minimized");
		mPartStack.setOnTop(false);
		mPartStack.setVisible(false);
		mPartStack.getTags().add("NoAutoCollapse");
		mPartStack.getTags().add("active");
		mPerspective.getChildren().add(0, mPartStack);
		return mPartStack;
	}
	return null;
}
 
开发者ID:elexis,项目名称:elexis-3-core,代码行数:18,代码来源:ElexisFastViewUtil.java

示例6: setActiveTerminology

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

示例7: getPartStack

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

示例8: showMPartForOrder

import org.eclipse.e4.ui.model.application.ui.basic.MPartStack; //导入依赖的package包/类
public void showMPartForOrder(final Order order) {

		// if already exist we show the part
		if (!orderIdToMPartMap.containsKey(order.getId())) {
			MPartStack partstack = filterOutOrdersPartStack();
			MPart newPart = createAndMapNewPart(order);
			partstack.getChildren().add(newPart);
		}
		MPart part = orderIdToMPartMap.get(order.getId());
		partService.showPart(part, PartState.ACTIVATE);
	}
 
开发者ID:scenarioo,项目名称:scenarioo-example-swtbot-e4,代码行数:12,代码来源:OrderMPartFactory.java

示例9: filterOutOrdersPartStack

import org.eclipse.e4.ui.model.application.ui.basic.MPartStack; //导入依赖的package包/类
private MPartStack filterOutOrdersPartStack() {

		List<MPartStack> partstacks = modelService.findElements(application,
				MODEL_PARTSTACKS_EDITOR_ID, MPartStack.class, null);

		for (MPartStack partstack : partstacks) {
			MPerspective perspective = modelService.getPerspectiveFor(partstack);
			if (MODEL_PERSPECTIVE_ORDERS_ID.equals(perspective.getElementId())) {
				return partstack;
			}
		}
		throw new IllegalStateException("no partstack of " + partstacks
				+ " does belong to a perspecktive(id=" + MODEL_PERSPECTIVE_ORDERS_ID + ")");
	}
 
开发者ID:scenarioo,项目名称:scenarioo-example-swtbot-e4,代码行数:15,代码来源:OrderMPartFactory.java

示例10: showMPartForPosition

import org.eclipse.e4.ui.model.application.ui.basic.MPartStack; //导入依赖的package包/类
public void showMPartForPosition(final PositionWithOrderAndArticleInfoDTO positionViewDTO) {

		// if already exist we show the part
		MPart mpart = null;
		if (positionIdToMPartMap.containsKey(positionViewDTO.getPositionId())) {
			mpart = positionIdToMPartMap.get(positionViewDTO.getPositionId());
		} else {
			MPartStack partstack = filterOutOrdersPartStack();
			mpart = createAndMapNewPart(positionViewDTO);
			partstack.getChildren().add(mpart);
		}
		passDataToMPart(positionViewDTO, mpart);
		partService.showPart(mpart, PartState.ACTIVATE);
	}
 
开发者ID:scenarioo,项目名称:scenarioo-example-swtbot-e4,代码行数:15,代码来源:PositionMPartFactory.java

示例11: grid

import org.eclipse.e4.ui.model.application.ui.basic.MPartStack; //导入依赖的package包/类
static void grid(final MPartStack displayStack, final List<MPlaceholder> holders) {
	final MElementContainer currentSash = displayStack.getParent();
	final int size = holders.size();
	final List<MElementContainer> containers = new ArrayList<>();
	createContainers(currentSash, containers, size, true);
	for (int i = 0; i < holders.size(); i++) {
		associate(containers.get(i), holders.get(i), false);
	}
}
 
开发者ID:gama-platform,项目名称:gama,代码行数:10,代码来源:ArrangeDisplayViews.java

示例12: horizontalOrVertical

import org.eclipse.e4.ui.model.application.ui.basic.MPartStack; //导入依赖的package包/类
static void horizontalOrVertical(final MPartStack displayStack, final List<MPlaceholder> holders,
		final boolean horizontal) {
	final MElementContainer rootSash = displayStack.getParent();
	((MPartSashContainer) rootSash).setHorizontal(horizontal);
	for (int i = 0; i < holders.size(); i++) {
		associate(createContainer(rootSash), holders.get(i), false);
	}
}
 
开发者ID:gama-platform,项目名称:gama,代码行数:9,代码来源:ArrangeDisplayViews.java

示例13: createStack

import org.eclipse.e4.ui.model.application.ui.basic.MPartStack; //导入依赖的package包/类
static MPartStack createStack(final MElementContainer root) {
	final MPartStack stack = modelService.createModelElement(MPartStack.class);
	stack.getTransientData().put("Dynamic", true);
	stack.setContainerData("5000");
	root.getChildren().add(stack);
	return stack;
}
 
开发者ID:gama-platform,项目名称:gama,代码行数:8,代码来源:ArrangeDisplayViews.java

示例14: createPart

import org.eclipse.e4.ui.model.application.ui.basic.MPartStack; //导入依赖的package包/类
@Override
public boolean createPart(Path rootPath, String panelId) {
    boolean result = false;

    if (rootPath != null) {
        String rootPathString = null;

        rootPathString = PathUtils.getFileName(rootPath);

        // create dynamic part
        MPart part = createDynamicPart(modelService);

        if (part != null) {
            // specify part
            part.setLabel(rootPathString);
            part.setElementId(createElementId());

            // add tab to the part stack (panel)
            MPartStack panel = (MPartStack) modelService.find(panelId, application);
            panel.getChildren().add(part);

            //
            openedParts.add(part);

            // TODO Send out events: workout
            broker.post(TabEvents.TOPIC_TAB_OPEN, part);

            result = true;
        }
        else {
            log.error("Unable to create dynamic part."); //$NON-NLS-1$
        }
    }

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

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


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