/** * Adds an execution listener to this manager. This listener will be * notified if any of the commands controlled by this manager execute. This * can be used to support macros and instrumentation of commands. * * @param listener * The listener to attach; must not be <code>null</code>. */ public final void addExecutionListener(final IExecutionListener listener) { if (listener == null) { throw new NullPointerException( "Cannot add a null execution listener"); //$NON-NLS-1$ } if (executionListeners == null) { executionListeners = new ListenerList<>(ListenerList.IDENTITY); // Add an execution listener to every command. executionListener = new ExecutionListener(); final Iterator<NamedHandleObject> commandItr = handleObjectsById.values().iterator(); while (commandItr.hasNext()) { final Command command = (Command) commandItr.next(); command.addExecutionListener(executionListener); } } executionListeners.add(listener); }
/** * Adds an execution listener to this manager. This listener will be * notified if any of the commands controlled by this manager execute. This * can be used to support macros and instrumentation of commands. * * @param listener * The listener to attach; must not be <code>null</code>. */ public final void addExecutionListener(final IExecutionListener listener) { if (listener == null) { throw new NullPointerException( "Cannot add a null execution listener"); //$NON-NLS-1$ } if (executionListeners == null) { executionListeners = new ListenerList<>(ListenerList.IDENTITY); // Add an execution listener to every command. executionListener = new ExecutionListener(); final Iterator<NamedHandleObject> commandItr = handleObjectsById.values().iterator(); while (commandItr.hasNext()) { final Command command = (Command) commandItr.next(); command.addExecutionListener(executionListener); } } executionListeners.add(listener); }
/** * Adds an execution listener to this manager. This listener will be * notified if any of the commands controlled by this manager execute. This * can be used to support macros and instrumentation of commands. * * @param listener * The listener to attach; must not be <code>null</code>. */ public void addExecutionListener(final IExecutionListener listener) { if (listener == null) { throw new NullPointerException( "Cannot add a null execution listener"); //$NON-NLS-1$ } if (executionListeners == null) { executionListeners = new ListenerList<>(ListenerList.IDENTITY); // Add an execution listener to every command. executionListener = new ExecutionListener(); final Iterator<NamedHandleObject> commandItr = handleObjectsById.values().iterator(); while (commandItr.hasNext()) { final Command command = (Command) commandItr.next(); command.addExecutionListener(executionListener); } } executionListeners.add(listener); }