@Override public void deactivateHandler(String commandId, Object handler) { context.remove(H_ID + commandId); }
@Override public Object removeVariable(String name) { Object obj = eclipseContext.getLocal(name); eclipseContext.remove(name); return obj; }
public void widgetSelected(SelectionEvent e) { lclContext.set(MItem.class.getName(), item); ContextInjectionFactory.invoke(contrib.getObject(), Execute.class, lclContext); lclContext.remove(MItem.class.getName()); }
private IEclipseContext getStaticContext(Event event) { if (infoContext == null) { infoContext = EclipseContextFactory.create(DCI_STATIC_CONTEXT); ContributionsAnalyzer.populateModelInterfaces(model, infoContext, model.getClass().getInterfaces()); } if (event == null) { infoContext.remove(Event.class); } else { infoContext.set(Event.class, event); } return infoContext; }
private IEclipseContext getStaticContext(Event event) { if (infoContext == null) { infoContext = EclipseContextFactory.create(HCI_STATIC_CONTEXT); ContributionsAnalyzer.populateModelInterfaces(model, infoContext, model.getClass().getInterfaces()); } if (event == null) { infoContext.remove(Event.class); } else { infoContext.set(Event.class, event); } return infoContext; }
/** * Removes the ids of a menu that is now hidden from the menu source * provider. This is used for legacy action-based handlers which need to * become active only for the duration of a menu being visible. * * @param menuIds * The identifiers of the menu that is now hidden; must not be * <code>null</code>. * @param localSelection * @param localEditorInput */ public void removeShowingMenus(final Set menuIds, final ISelection localSelection, final ISelection localEditorInput) { menuSourceProvider.removeShowingMenus(menuIds, localSelection, localEditorInput); for (String key : menuSourceProvider.getProvidedSourceNames()) { e4Context.remove(key); } }
/** * @return */ private List<MMenuElement> mergeFactoryIntoModel() { Object obj = menuContribution.getTransientData().get(FACTORY); if (!(obj instanceof IContextFunction)) { return Collections.EMPTY_LIST; } IEclipseContext staticContext = getStaticContext(); staticContext.remove(List.class); factoryDispose = (Runnable) ((IContextFunction) obj) .compute(staticContext, null); return staticContext.get(List.class); }
private IEclipseContext getStaticContext(Event event) { if (infoContext == null) { infoContext = EclipseContextFactory.create(DCI_STATIC_CONTEXT); ContributionsAnalyzer.populateModelInterfaces(getModel(), infoContext, getModel().getClass().getInterfaces()); } if (event == null) { infoContext.remove(Event.class); } else { infoContext.set(Event.class, event); } return infoContext; }
private IEclipseContext getStaticContext(Event event) { if (infoContext == null) { infoContext = EclipseContextFactory.create(HCI_STATIC_CONTEXT); ContributionsAnalyzer.populateModelInterfaces(getModel(), infoContext, getModel().getClass().getInterfaces()); } if (event == null) { infoContext.remove(Event.class); } else { infoContext.set(Event.class, event); } return infoContext; }
/** * @return */ private List<MToolBarElement> mergeFactoryIntoModel() { Object obj = toolbarContribution.getTransientData().get(FACTORY); if (!(obj instanceof IContextFunction)) { return Collections.EMPTY_LIST; } IEclipseContext staticContext = getStaticContext(); staticContext.remove(List.class); factoryDispose = (Runnable) ((IContextFunction) obj) .compute(staticContext, null); return staticContext.get(List.class); }
/** * @return */ private List<MMenuElement> mergeFactoryIntoModel() { Object obj = menuContribution.getTransientData().get(FACTORY); if (!(obj instanceof IContextFunction)) { return Collections.EMPTY_LIST; } IEclipseContext staticContext = getStaticContext(); staticContext.remove(List.class); factoryDispose = (Runnable) ((IContextFunction) obj).compute( staticContext, null); return staticContext.get(List.class); }
/** * @return */ private List<MToolBarElement> mergeFactoryIntoModel() { Object obj = toolbarContribution.getTransientData().get(FACTORY); if (!(obj instanceof IContextFunction)) { return Collections.EMPTY_LIST; } IEclipseContext staticContext = getStaticContext(); staticContext.remove(List.class); factoryDispose = (Runnable) ((IContextFunction) obj).compute( staticContext, null); return staticContext.get(List.class); }
public void removeTable(BindingTable table) { String contextId = getTableId(table.getId()); if (!eclipseContext.containsKey(contextId)) { throw new IllegalArgumentException("Does not contains table " + contextId); //$NON-NLS-1$ } eclipseContext.remove(contextId); final List<Context> contexts = definedTables.getContexts(); if (contexts.contains(table.getTableId())) { // this is only valid because I'm throwing away the old definedTables contextSet contexts.remove(table.getTableId()); definedTables = createContextSet(contexts); } }
public void hidePopup(Event event, Menu menu, MPopupMenu menuModel) { // System.err.println("hidePopup: " + menuModel + "\n\t" + menu); final IEclipseContext popupContext = menuModel.getContext(); final IEclipseContext originalChild = (IEclipseContext) popupContext .get(TMP_ORIGINAL_CONTEXT); popupContext.remove(TMP_ORIGINAL_CONTEXT); if (!menu.isDisposed()) { menu.getDisplay().asyncExec(new Runnable() { public void run() { if (originalChild == null) { popupContext.deactivate(); } else { originalChild.activate(); } } }); } }
public void removeTable(BindingTable table) { String contextId = getTableId(table.getId()); if (!eclipseContext.containsKey(contextId)) { throw new IllegalArgumentException("Does not contains table " + contextId); //$NON-NLS-1$ } eclipseContext.remove(contextId); final List<Context> contexts = definedTables.getContexts(); if (contexts.contains(table.getTableId())) { // this is only valid because I'm throwing away the old definedTables contextSet contexts.remove(table.getTableId()); definedTables = createContextSet(contexts); } }
@Override public boolean changed(IEclipseContext context) { context.get(RE_EVAL); String[] vars = ratVariables.toArray(new String[ratVariables.size()]); for (String var : vars) { Object value = context.getActive(var); if (value == null) { ratContext.remove(var); } else { ratContext.set(var, value); } } // This ties tool item enablement to variable changes that can // effect the enablement. getEventBroker().send(UIEvents.REQUEST_ENABLEMENT_UPDATE_TOPIC, UIEvents.ALL_ELEMENT_ID); return true; } };
public void widgetSelected(SelectionEvent e) { if (contrib.getObject() == null) { IContributionFactory cf = (IContributionFactory) lclContext .get(IContributionFactory.class.getName()); contrib.setObject(cf.create( contrib.getContributionURI(), lclContext)); } lclContext.set(MItem.class.getName(), item); ContextInjectionFactory.invoke(contrib.getObject(), Execute.class, lclContext); lclContext.remove(MItem.class.getName()); }
private void hidePopup(Menu menu, MPopupMenu menuModel, MenuManager menuManager) { final IEclipseContext popupContext = menuModel.getContext(); final IEclipseContext originalChild = (IEclipseContext) popupContext .get(MenuManagerRendererFilter.TMP_ORIGINAL_CONTEXT); popupContext.remove(MenuManagerRendererFilter.TMP_ORIGINAL_CONTEXT); if (!menu.isDisposed()) { menu.getDisplay().asyncExec(new Runnable() { public void run() { if (originalChild == null) { popupContext.deactivate(); } else { originalChild.activate(); } } }); } } }
private void hidePopup(Menu menu, MPopupMenu menuModel, MenuManager menuManager) { final IEclipseContext popupContext = menuModel.getContext(); final IEclipseContext originalChild = (IEclipseContext) popupContext .get(MenuManagerRendererFilter.TMP_ORIGINAL_CONTEXT); popupContext.remove(MenuManagerRendererFilter.TMP_ORIGINAL_CONTEXT); if (!menu.isDisposed()) { menu.getDisplay().asyncExec(() -> { if (originalChild == null) { popupContext.deactivate(); } else { originalChild.activate(); } }); } } }
public void hidePopup(Event event, Menu menu, MPopupMenu menuModel) { // System.err.println("hidePopup: " + menuModel + "\n\t" + menu); final IEclipseContext popupContext = menuModel.getContext(); final IEclipseContext originalChild = (IEclipseContext) popupContext .get(TMP_ORIGINAL_CONTEXT); popupContext.remove(TMP_ORIGINAL_CONTEXT); if (!menu.isDisposed()) { menu.getDisplay().asyncExec(() -> { if (originalChild == null) { popupContext.deactivate(); } else { originalChild.activate(); } }); } }