@Override public void childRendered( final MElementContainer<MUIElement> parentElement, MUIElement element) { super.childRendered(parentElement, element); if (!(((MUIElement) parentElement) instanceof MPartStack) || !(element instanceof MStackElement)) return; createTab(parentElement, element); }
@PreDestroy public void contextDisposed() { super.contextDisposed(eventBroker); }
@PostConstruct public void init() { super.init(eventBroker); }
protected void showTab(MUIElement element) { // Now process any newly visible elements MUIElement curSel = element.getParent().getSelectedElement(); if (curSel != null) { showElementRecursive(curSel); } }
@Override protected boolean requiresFocus(MPart element) { MUIElement inStack = element.getCurSharedRef() != null ? element.getCurSharedRef() : element; if (inStack.getParent() != null && inStack.getParent().getTransientData().containsKey(INHIBIT_FOCUS)) { inStack.getParent().getTransientData().remove(INHIBIT_FOCUS); return false; } return super.requiresFocus(element); }
@Override public void postProcess(MUIElement element) { super.postProcess(element); MPerspectiveStack ps = (MPerspectiveStack) element; if (ps.getSelectedElement() != null && ps.getSelectedElement().getWidget() != null) { Control ctrl = (Control) ps.getSelectedElement().getWidget(); Composite psComp = (Composite) ps.getWidget(); StackLayout sl = (StackLayout) psComp.getLayout(); sl.topControl = ctrl; psComp.layout(); } }
@Override public void hideChild(MElementContainer<MUIElement> parentElement, MUIElement child) { super.hideChild(parentElement, child); CTabFolder tabFolder = (CTabFolder) parentElement.getWidget(); if (tabFolder == null) return; // Check if we have to reset the currently active child for the stack CTabItem tabItem = findItemForPart(child, parentElement); if (tabItem == tabFolder.getSelection()) { // If we're the only part we need to clear the top right... if (tabFolder.getItemCount() == 1) { adjustTopRight(tabFolder); } } // find the 'stale' tab for this element and dispose it if (tabItem != null && !tabItem.isDisposed()) { tabItem.setControl(null); tabItem.dispose(); } }
@Override public void processContents(MElementContainer<MUIElement> me) { // Lazy Loading: here we only process the contents through childAdded, // we specifically do not render them IPresentationEngine renderer = (IPresentationEngine) context .get(IPresentationEngine.class.getName()); for (MUIElement element : me.getChildren()) { if (!element.isToBeRendered() || !element.isVisible()) continue; boolean lazy = true; // Special case: we also render any placeholder that refers to // an *existing* part, this doesn't break lazy loading since the // part is already there...see bug 378138 for details if (element instanceof MPlaceholder) { MPlaceholder ph = (MPlaceholder) element; if (ph.getRef() instanceof MPart && ph.getRef().getWidget() != null) { lazy = false; } } if (lazy) { createTab(me, element); } else { renderer.createGui(element); } } }
hideElementRecursive(curSel); } else if (element instanceof MElementContainer<?>) { MElementContainer<?> container = (MElementContainer<?>) element; for (MUIElement childElement : container.getChildren()) { hideElementRecursive(childElement); hideElementRecursive(w); hideElementRecursive(w);
@Override public void hookControllerLogic(final MUIElement me) { super.hookControllerLogic(me);
protected void showTab(MUIElement element) { // Now process any newly visible elements MUIElement curSel = element.getParent().getSelectedElement(); if (curSel != null) { showElementRecursive(curSel); } }
@Override protected boolean requiresFocus(MPart element) { MUIElement inStack = element.getCurSharedRef() != null ? element .getCurSharedRef() : element; if (inStack.getParent() != null && inStack.getParent().getTransientData() .containsKey(INHIBIT_FOCUS)) { inStack.getParent().getTransientData().remove(INHIBIT_FOCUS); return false; } return super.requiresFocus(element); }
@Override public void postProcess(MUIElement element) { super.postProcess(element); MPerspectiveStack ps = (MPerspectiveStack) element; if (ps.getSelectedElement() != null && ps.getSelectedElement().getWidget() != null) { Control ctrl = (Control) ps.getSelectedElement().getWidget(); Composite psComp = (Composite) ps.getWidget(); StackLayout sl = (StackLayout) psComp.getLayout(); sl.topControl = ctrl; psComp.layout(); } }
@Override public void hideChild(MElementContainer<MUIElement> parentElement, MUIElement child) { super.hideChild(parentElement, child);
createTab(me, element); } else { renderer.createGui(element);
hideElementRecursive(curSel); } else if (element instanceof MElementContainer<?>) { MElementContainer<?> container = (MElementContainer<?>) element; for (MUIElement childElement : container.getChildren()) { hideElementRecursive(childElement); hideElementRecursive(w); hideElementRecursive(w);
@Override public void hookControllerLogic(final MUIElement me) { super.hookControllerLogic(me);
curSel = container.getChildren().get(0); if (curSel != null) showElementRecursive(curSel); } else if (element instanceof MElementContainer<?>) { MElementContainer<?> container = (MElementContainer<?>) element; container.getChildren()); for (MUIElement childElement : kids) { showElementRecursive(childElement); showElementRecursive(w); showElementRecursive(w);
@PostConstruct public void init() { super.init(eventBroker); }
@PreDestroy public void contextDisposed() { super.contextDisposed(eventBroker); eventBroker.unsubscribe(itemUpdater); eventBroker.unsubscribe(dirtyUpdater); eventBroker.unsubscribe(viewMenuUpdater); eventBroker.unsubscribe(childrenHandler); eventBroker.unsubscribe(tabStateHandler); }