public void widgetDisposed(DisposeEvent e) { cleanUp(trimModel); } });
@Override public void hideChild(MElementContainer<MUIElement> parentElement, MUIElement child) { super.hideChild(parentElement, child); Object downCast = parentElement; layoutTrim((MTrimBar) downCast); }
@Override public void processContents(MElementContainer<MUIElement> me) { if (!(((MUIElement) me) instanceof MTrimBar)) return; super.processContents(me); IEclipseContext ctx = getContext(me); ExpressionContext eContext = new ExpressionContext(ctx); MElementContainer<?> trimObj = me; MTrimBar trimModel = (MTrimBar) trimObj; ArrayList<MTrimContribution> toContribute = new ArrayList<MTrimContribution>(); ContributionsAnalyzer.gatherTrimContributions(trimModel, application.getTrimContributions(), trimModel.getElementId(), toContribute, eContext); addTrimContributions(trimModel, toContribute, ctx, eContext); }
} else if (uiElement instanceof MTrimBar) { if (trimBarRenderer == null) { trimBarRenderer = new TrimBarRenderer(); initRenderer(trimBarRenderer);
/** * @param element * the trimBar to be cleaned up */ protected void cleanUp(MTrimBar element) { IRendererFactory rendererFactory = context.get(IRendererFactory.class); for (MTrimElement child : element.getPendingCleanup()) { element.getChildren().remove(child); if (child instanceof ToolBarImpl) { ToolBarImpl tb = (ToolBarImpl) child; releaseToolbar(rendererFactory, tb); } } element.getPendingCleanup().clear(); List<MTrimElement> children = element.getChildren(); for (MTrimElement mTrimElement : children) { if (mTrimElement instanceof ToolBarImpl) { ToolBarImpl tb = (ToolBarImpl) mTrimElement; releaseToolbar(rendererFactory, tb); } } }
@Override public void processContents(MElementContainer<MUIElement> me) { if (!(((MUIElement) me) instanceof MTrimBar)) return; super.processContents(me); IEclipseContext ctx = getContext(me); ExpressionContext eContext = new ExpressionContext(ctx); MElementContainer<?> trimObj = me; MTrimBar trimModel = (MTrimBar) trimObj; ArrayList<MTrimContribution> toContribute = new ArrayList<>(); ContributionsAnalyzer.gatherTrimContributions(trimModel, application.getTrimContributions(), trimModel.getElementId(), toContribute, eContext); addTrimContributions(trimModel, toContribute, ctx, eContext); }
} else if (uiElement instanceof MTrimBar) { if (trimBarRenderer == null) { trimBarRenderer = new TrimBarRenderer(); initRenderer(trimBarRenderer);
@Override public void hideChild(MElementContainer<MUIElement> parentElement, MUIElement child) { super.hideChild(parentElement, child); Object downCast = parentElement; layoutTrim((MTrimBar) downCast); }
return null; trimComposite.addDisposeListener(e -> cleanUp(trimModel)); } else { trimComposite = new Composite(parentComp, SWT.NONE);