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


Java MPartSashContainer类代码示例

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


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

示例1: getAdjacentElement

import org.eclipse.e4.ui.model.application.ui.basic.MPartSashContainer; //导入依赖的package包/类
/**
 * Find the first element with which we should join
 * 
 * @param dragStack the stack to join
 * @return the target stack 
 */
@SuppressWarnings("unchecked")  // for safe cast to MElementContainer<MUIElement>
protected MElementContainer<MUIElement> getAdjacentElement(MElementContainer<MUIElement> dragStack, MPart part, boolean stackp) {
	MElementContainer<MUIElement> result = null;
	if (dragStack != null) {
		MElementContainer<MUIElement> psash = dragStack.getParent();
		if ((Object)psash instanceof MPartSashContainer) {
			List<MUIElement> children = psash.getChildren();
			int size = children.size(); 
			if (size > 1) {
				int index = children.indexOf(dragStack)+1;
				result = (MElementContainer<MUIElement>)children.get((index == size) ? index - 2 : index);
				if (stackp) {
					result =  findTheStack(result);
				}
			}
		}
	}
	return result;
}
 
开发者ID:MulgaSoft,项目名称:e4macs,代码行数:26,代码来源:E4WindowCmd.java

示例2: addElementsFrom

import org.eclipse.e4.ui.model.application.ui.basic.MPartSashContainer; //导入依赖的package包/类
private void addElementsFrom(MWindow window, List<MPerspective> perspectives) {
List<MWindowElement> windowElements = window.getChildren();
for (Iterator<MWindowElement> i = windowElements.iterator(); i.hasNext();) {
	MWindowElement _elm = i.next();

	if (_elm instanceof MPerspectiveStack)
		perspectives.addAll(((MPerspectiveStack) _elm).getChildren());
	else if (_elm instanceof MPartSashContainer)
		addChildPerspectives((MPartSashContainer) _elm, perspectives);
}
  }
 
开发者ID:cplutte,项目名称:bts,代码行数:12,代码来源:PerspectiveContentProvider.java

示例3: addChildPerspectives

import org.eclipse.e4.ui.model.application.ui.basic.MPartSashContainer; //导入依赖的package包/类
private void addChildPerspectives(MPartSashContainer partContainer, List<MPerspective> perspectives) {
List<MPartSashContainerElement> containerElements = partContainer.getChildren();
for (Iterator<MPartSashContainerElement> i = containerElements.iterator(); i.hasNext();) {
	MPartSashContainerElement _elm = i.next();
	
	if (_elm instanceof MPartSashContainer)
		addChildPerspectives((MPartSashContainer) _elm, perspectives);
	if (_elm instanceof MPerspectiveStack)
		perspectives.addAll(((MPerspectiveStack) _elm).getChildren());
}   	
  }
 
开发者ID:cplutte,项目名称:bts,代码行数:12,代码来源:PerspectiveContentProvider.java

示例4: horizontalOrVertical

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

示例5: createContainers

import org.eclipse.e4.ui.model.application.ui.basic.MPartSashContainer; //导入依赖的package包/类
private static void createContainers(final MElementContainer root, final List<MElementContainer> containers,
		final int size, final boolean horizontal) {
	((MPartSashContainer) root).setHorizontal(horizontal);
	if (size == 0)
		return;
	else if (size == 1) {
		final MElementContainer container = createContainer(root);
		containers.add(container);
	} else {
		final int half = size / 2;
		createContainers(createSash(root), containers, half, !horizontal);
		createContainers(createSash(root), containers, size - half, !horizontal);
	}
}
 
开发者ID:gama-platform,项目名称:gama,代码行数:15,代码来源:ArrangeDisplayViews.java

示例6: createSash

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

示例7: findTheStack

import org.eclipse.e4.ui.model.application.ui.basic.MPartSashContainer; //导入依赖的package包/类
/**
 * If parent is a sash, keep looking until we find a PartStack
 * 
 * @param parent a sash of PartStack
 * @return the first PartStack we find
 */
@SuppressWarnings("unchecked")  // for safe cast to MElementContainer<MUIElement>
private MElementContainer<MUIElement> findTheStack(MElementContainer<MUIElement> parent) {
	MElementContainer<MUIElement> result = parent;
	if ((MPartSashContainerElement)parent instanceof MPartSashContainer) {
		List<MUIElement> children = parent.getChildren();
		result = findTheStack((MElementContainer<MUIElement>)children.get(0));
	}
	return result;
}
 
开发者ID:MulgaSoft,项目名称:e4macs,代码行数:16,代码来源:E4WindowCmd.java


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