@Override public void handleEvent(Event event) { Object element = event.getProperty(UIEvents.EventTags.ELEMENT); if (!(element instanceof MPartStack)) { return; } Object newValue = event.getProperty(UIEvents.EventTags.NEW_VALUE); Object oldValue = event.getProperty(UIEvents.EventTags.OLD_VALUE); boolean minimizedTagAdded = UIEvents.isADD(event) && IPresentationEngine.MINIMIZED.equals(newValue); boolean minimizedTagRemoved = UIEvents.isREMOVE(event) && IPresentationEngine.MINIMIZED.equals(oldValue); if (!(minimizedTagAdded || minimizedTagRemoved)) { return; } MPart part = toPart(((MPartStack) element).getSelectedElement()); if (part != null && minimizedTagAdded) { firePartHidden(part); } else if (part != null) { firePartVisible(part); } }
public void handleEvent(Event event) { if (psTB.isDisposed()) { return; } Object changedObj = event.getProperty(UIEvents.EventTags.ELEMENT); if (psME == null || !(changedObj instanceof MPerspectiveStack)) return; MWindow perspWin = modelService.getTopLevelWindowFor((MUIElement) changedObj); MWindow switcherWin = modelService.getTopLevelWindowFor(psME); if (perspWin != switcherWin) return; if (UIEvents.isADD(event)) { for (Object o : UIEvents.asIterable(event, UIEvents.EventTags.NEW_VALUE)) { MPerspective added = (MPerspective) o; // Adding invisible elements is a NO-OP if (!added.isToBeRendered()) continue; addPerspectiveItem(added); } } else if (UIEvents.isREMOVE(event)) { for (Object o : UIEvents.asIterable(event, UIEvents.EventTags.OLD_VALUE)) { MPerspective removed = (MPerspective) o; // Removing invisible elements is a NO-OP if (!removed.isToBeRendered()) continue; removePerspectiveItem(removed); } } }