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