@Override public void contextManagerChanged( org.eclipse.core.commands.contexts.ContextManagerEvent contextManagerEvent) { final String contextId = contextManagerEvent.getContextId(); final boolean definedContextsChanged; final Set previouslyDefinedContextIds; if (contextId == null) { definedContextsChanged = false; previouslyDefinedContextIds = null; } else { definedContextsChanged = true; previouslyDefinedContextIds = new HashSet(); previouslyDefinedContextIds.addAll(contextManager .getDefinedContextIds()); if (contextManagerEvent.isContextDefined()) { previouslyDefinedContextIds.remove(contextId); } else { previouslyDefinedContextIds.add(contextId); } } fireContextManagerChanged(new ContextManagerEvent(this, definedContextsChanged, contextManagerEvent .isActiveContextsChanged(), previouslyDefinedContextIds, contextManagerEvent .getPreviouslyActiveContextIds())); }
@Override public void runWithException() { contextManager.addContextManagerListener(contextManagerEvent -> { if (contextManagerEvent.isContextChanged()) { String id = contextManagerEvent.getContextId(); if (id != null) { defineBindingTable(id); } } }); EContextService ecs = e4Context.get(EContextService.class); ecs.activateContext(IContextService.CONTEXT_ID_DIALOG_AND_WINDOW); } });