/** * Fires an event to all registered listeners describing changes to this * instance. * <p> * Subclasses may extend the definition of this method (i.e., if a different * type of listener can be attached to a subclass). This is used primarily * for support of <code>AbstractHandler</code> in * <code>org.eclipse.ui.workbench</code>, and clients should be wary of * overriding this behaviour. If this method is overridden, then the first * line of the method should be "<code>super.fireHandlerChanged(handlerEvent);</code>". * </p> * * @param handlerEvent * the event describing changes to this instance. Must not be * <code>null</code>. */ protected void fireHandlerChanged(final HandlerEvent handlerEvent) { if (handlerEvent == null) { throw new NullPointerException(); } final Object[] listeners = getListeners(); for (int i = 0; i < listeners.length; i++) { final IHandlerListener listener = (IHandlerListener) listeners[i]; listener.handlerChanged(handlerEvent); } }
/** * Fires an event to all registered listeners describing changes to this * instance. * <p> * Subclasses may extend the definition of this method (i.e., if a different * type of listener can be attached to a subclass). This is used primarily * for support of <code>AbstractHandler</code> in * <code>org.eclipse.ui.workbench</code>, and clients should be wary of * overriding this behaviour. If this method is overridden, then the first * line of the method should be "<code>super.fireHandlerChanged(handlerEvent);</code>". * </p> * * @param handlerEvent * the event describing changes to this instance. Must not be * <code>null</code>. */ protected void fireHandlerChanged(final HandlerEvent handlerEvent) { if (handlerEvent == null) { throw new NullPointerException(); } for (Object listener : getListeners()) { final IHandlerListener handlerListener = (IHandlerListener) listener; handlerListener.handlerChanged(handlerEvent); } }
/** * Fires an event to all registered listeners describing changes to this * instance. * <p> * Subclasses may extend the definition of this method (i.e., if a different * type of listener can be attached to a subclass). This is used primarily * for support of <code>AbstractHandler</code> in * <code>org.eclipse.ui.workbench</code>, and clients should be wary of * overriding this behaviour. If this method is overridden, then the first * line of the method should be "<code>super.fireHandlerChanged(handlerEvent);</code>". * </p> * * @param handlerEvent * the event describing changes to this instance. Must not be * <code>null</code>. */ protected void fireHandlerChanged(final HandlerEvent handlerEvent) { if (handlerEvent == null) { throw new NullPointerException(); } final Object[] listeners = getListeners(); for (int i = 0; i < listeners.length; i++) { final IHandlerListener listener = (IHandlerListener) listeners[i]; listener.handlerChanged(handlerEvent); } }
@Override public void handlerChanged(HandlerEvent event) { final boolean enabledChanged = ((Boolean) event .getPreviousAttributeValuesByName().get( ILegacyAttributeNames.ENABLED)).booleanValue() != handler .isEnabled(); final boolean handledChanged = ((Boolean) event .getPreviousAttributeValuesByName().get( ILegacyAttributeNames.HANDLED)).booleanValue() != handler .isHandled(); listener.handlerChanged(new org.eclipse.core.commands.HandlerEvent( handler, enabledChanged, handledChanged)); } }