private void addStickyFolder() { MPartStack stickyFolder = modelService.createModelElement(MPartStack.class); stickyFolder.setElementId(StickyViewDescriptor.STICKY_FOLDER_RIGHT); stickyFolder.setContainerData("2500"); //$NON-NLS-1$ stickyFolder.setToBeRendered(false); mainSash.getChildren().add(stickyFolder); }
private MPartStack addDefaultFastViewStack() { MPartStack stack = null; List<String> views = perspReader.getDefaultFastViewBarViewIds(); if (views.size() > 0) { stack = layoutUtils.createStack(DEFAULT_FASTVIEW_STACK, true); MPartSashContainer psc = modelService.createModelElement(MPartSashContainer.class); psc.setHorizontal(true); psc.setContainerData(Integer.toString(5000)); stack.setContainerData(Integer.toString(2500)); psc.getChildren().add(stack); List<MPartSashContainer> list = modelService.findElements(perspective, null, MPartSashContainer.class); if (list == null || list.isEmpty()) { perspective.getChildren().add(psc); } else { int size = list.size(); MPartSashContainer container = list.get(size - 1); container.getChildren().add(psc); } setPartState(stack, org.eclipse.ui.internal.e4.migration.InfoReader.PartState.MINIMIZED); for (String view : views) { addPlaceholderToDefaultFastViewStack(stack, view, null); } } return stack; }
private void split(MUIElement toSplit, MUIElement child, @NonNull DropLocation dropType) { // remove the moved element from its parent child.setParent(null); // remember the index to insert MElementContainer<MUIElement> owner = toSplit.getParent(); int index = owner.getChildren().indexOf(toSplit); // remove the split from the parent owner.getChildren().remove(toSplit); MPartSashContainer container = this.modelService.createModelElement(MPartSashContainer.class); container.setContainerData(toSplit.getContainerData()); MPartStack childContainer = this.modelService.createModelElement(MPartStack.class); childContainer.getChildren().add((MStackElement) child); toSplit.setContainerData(null); childContainer.setContainerData(null); container.setToBeRendered(true); container.setVisible(true); container.setHorizontal(dropType == BasicDropLocation.SPLIT_LEFT || dropType == BasicDropLocation.SPLIT_RIGHT); if( dropType == BasicDropLocation.SPLIT_TOP || dropType == BasicDropLocation.SPLIT_LEFT ) { container.getChildren().add((MPartSashContainerElement) childContainer); container.getChildren().add((MPartSashContainerElement) toSplit); } else { container.getChildren().add((MPartSashContainerElement) toSplit); container.getChildren().add((MPartSashContainerElement) childContainer); } owner.getChildren().add(index, container); }
stickyFolder.setContainerData("2500"); //$NON-NLS-1$ stickyFolder.setElementId("stickyFolderRight"); //$NON-NLS-1$ stickyFolder.setToBeRendered(false);