@Override public void addContextManagerListener( final IContextManagerListener listener) { contextManager.addContextManagerListener(listener); }
/** * Constructs a new instance of <code>MutableContextManager</code>. The * registry is created on the platform's extension registry. * * @param contextManager * The manager which will provided the real support; must not be * <code>null</code>. */ public ContextManagerLegacyWrapper(ContextManager contextManager) { if (contextManager == null) { throw new NullPointerException("The context manager cannot be null"); //$NON-NLS-1$ } this.contextManager = contextManager; this.contextManager.addContextManagerListener(this); }
/** * <p> * Constructs a new instance of <code>BindingManager</code>. * </p> * <p> * This method completes in amortized constant time (O(1)). * </p> * * @param contextManager * The context manager that will support this binding manager. * This value must not be <code>null</code>. * @param commandManager * The command manager that will support this binding manager. * This value must not be <code>null</code>. */ public BindingManager(final ContextManager contextManager, final CommandManager commandManager) { if (contextManager == null) { throw new NullPointerException( "A binding manager requires a context manager"); //$NON-NLS-1$ } if (commandManager == null) { throw new NullPointerException( "A binding manager requires a command manager"); //$NON-NLS-1$ } this.contextManager = contextManager; contextManager.addContextManagerListener(this); this.commandManager = commandManager; }
/** * <p> * Constructs a new instance of <code>BindingManager</code>. * </p> * <p> * This method completes in amortized constant time (O(1)). * </p> * * @param contextManager * The context manager that will support this binding manager. * This value must not be <code>null</code>. * @param commandManager * The command manager that will support this binding manager. * This value must not be <code>null</code>. */ public BindingManager(final ContextManager contextManager, final CommandManager commandManager) { if (contextManager == null) { throw new NullPointerException( "A binding manager requires a context manager"); //$NON-NLS-1$ } if (commandManager == null) { throw new NullPointerException( "A binding manager requires a command manager"); //$NON-NLS-1$ } this.contextManager = contextManager; contextManager.addContextManagerListener(this); this.commandManager = commandManager; }
/** * <p> * Constructs a new instance of <code>BindingManager</code>. * </p> * <p> * This method completes in amortized constant time (O(1)). * </p> * * @param contextManager * The context manager that will support this binding manager. * This value must not be <code>null</code>. * @param commandManager * The command manager that will support this binding manager. * This value must not be <code>null</code>. */ public BindingManager(final ContextManager contextManager, final CommandManager commandManager) { if (contextManager == null) { throw new NullPointerException( "A binding manager requires a context manager"); //$NON-NLS-1$ } if (commandManager == null) { throw new NullPointerException( "A binding manager requires a command manager"); //$NON-NLS-1$ } this.contextManager = contextManager; contextManager.addContextManagerListener(this); this.commandManager = commandManager; }
@Override public void addCommandManagerListener( final ICommandManagerListener commandManagerListener) { if (commandManagerListener == null) { throw new NullPointerException("Cannot add a null listener."); //$NON-NLS-1$ } if (commandManagerListeners == null) { commandManagerListeners = new ArrayList(); this.commandManager.addCommandManagerListener(this); this.bindingManager.addBindingManagerListener(this); this.contextManager.addContextManagerListener(this); } if (!commandManagerListeners.contains(commandManagerListener)) { commandManagerListeners.add(commandManagerListener); } }
@Override public void addContextListener(IContextListener contextListener) { final LegacyContextListenerWrapper wrapper = new LegacyContextListenerWrapper( contextListener, contextManager, this); wrappedContext.addContextListener(wrapper); /* * We need to add the listener to the context manager as well, as only * the manager advertises changes to the enabled state. */ contextManager.addContextManagerListener(wrapper); }
@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); } });