public DragHost(Shell shell) { dragWindow = (MWindow) shell.getData(AbstractPartRenderer.OWNING_ME); baseWindow = (MWindow) shell.getParent().getData( AbstractPartRenderer.OWNING_ME); dragElement = dragWindow.getChildren().get(0); }
public DragHost(Shell shell) { dragWindow = (MWindow) shell.getData(AbstractPartRenderer.OWNING_ME); baseWindow = (MWindow) shell.getParent().getData( AbstractPartRenderer.OWNING_ME); dragElement = dragWindow.getChildren().get(0); }
/** * If this window has a primary perspective stack, return it. Otherwise * return null. A primary stack is a single MPerspectiveStack found either * as the window's immediate children or the child under a single * MPartSashContainer. * * @param window * the window * @return the stack or {@code null} */ private MPerspectiveStack getPrimaryPerspectiveStack(MWindow window) { List<MWindowElement> winKids = window.getChildren(); if (winKids.isEmpty()) { return null; } // Check if we have a MPerspectiveStack in window's children if (instanceCount(winKids, MPerspectiveStack.class) == 1) { return firstInstance(winKids, MPerspectiveStack.class); } // Traditional shape of IWorkbenchWindow: // MWindow{ MPartSashContainer{ MPerspectiveStack, MPartStack (intro // + cheatsheets + help)}} if (winKids.size() == 1 && winKids.get(0) instanceof MPartSashContainer) { MPartSashContainer topLevelPSC = (MPartSashContainer) winKids.get(0); if (instanceCount(topLevelPSC.getChildren(), MPerspectiveStack.class) == 1) { return firstInstance(topLevelPSC.getChildren(), MPerspectiveStack.class); } } return null; }
if (window.getChildren().get(0) instanceof MPerspectiveStack) { this.stack = (MPerspectiveStack) window.getChildren().get(0); } else { this.stack = null;
public void drop(MElementContainer<MUIElement> newContainer, int itemIndex) { if (dragElement.getParent() != null) dragElement.getParent().getChildren().remove(dragElement); if (itemIndex >= 0) newContainer.getChildren().add(itemIndex, dragElement); else newContainer.getChildren().add(dragElement); newContainer.setSelectedElement(dragElement); if (dragElement.getWidget() instanceof ToolItem) { ToolItem ti = (ToolItem) dragElement.getWidget(); ToolBar tb = ti.getParent(); tb.layout(true); tb.getParent() .layout(new Control[] { tb }, SWT.CHANGED | SWT.DEFER); } baseWindow.getChildren().remove(dragWindow); newContainer.setSelectedElement(dragElement); if (getShell() != null) getShell().dispose(); }
for (MWindowElement child : window.getChildren()) { if (child instanceof MPerspectiveStack) { _perspectiveStack = (MPerspectiveStack) child; stickySash.setSelectedElement(perspectiveStack); window.getChildren().add(stickySash); window.setSelectedElement(stickySash); _perspectiveStack = perspectiveStack;
mainSash.setSelectedElement(perspectiveStack); window.getChildren().add(mainSash); window.setSelectedElement(mainSash);
for (MUIElement kid : ((MWindow) element).getChildren()) { if (isWindowChildRendered(kid)) { visCount++;
for (MWindowElement e : element.getChildren()) { WLayoutedWidget<MWindowElement> widget = engineCreateWidget(e); if (widget != null && isChildRenderedAndVisible(e)) {
for (MUIElement kid : ((MWindow) element).getChildren()) { if (kid.isToBeRendered() && kid.isVisible()) visCount++;
for (MUIElement kid : ((MWindow) element).getChildren()) { if (kid.isToBeRendered() && kid.isVisible()) { visCount++;