@Override public void fireHandlerChanged(HandlerEvent handlerEvent) { super.fireHandlerChanged(handlerEvent); }
/** * @see IHandler#addHandlerListener(IHandlerListener) */ @Override public void addHandlerListener(final IHandlerListener handlerListener) { addListenerObject(handlerListener); }
/** * <p> * Returns true iff there is one or more IHandlerListeners attached to this * AbstractHandler. * </p> * <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 return * value should include "<code>super.hasListeners() ||</code>". * </p> * * @return true iff there is one or more IHandlerListeners attached to this * AbstractHandler */ protected boolean hasListeners() { return isListenerAttached(); }
/** * {@inheritDoc} */ public void dispose() { fDelegateHandler.dispose(); super.dispose(); }
if (super.hasListeners()) { final boolean enabledChanged; final boolean handledChanged; super.fireHandlerChanged(newEvent);
@Override public final void removeHandlerListener(final IHandlerListener handlerListener) { super.removeHandlerListener(handlerListener); if (!hasListeners()) { detachListener(); } }
public final void addHandlerListener(final IHandlerListener handlerListener) { if (!hasListeners()) { attachListener(); } super.addHandlerListener(handlerListener); }
@Override public void removeHandlerListener(final IHandlerListener handlerListener) { removeListenerObject(handlerListener); } }
/** * 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 dispose() { for (Entry<IWorkbenchWindow, EventHandler> w : eventHandlers.entrySet()) { IEventBroker eventBroker = eventBrokers.get(w.getKey()); EventHandler eventHandler = w.getValue(); if (eventBroker != null && eventHandler != null) { eventBroker.unsubscribe(eventHandler); } } super.dispose(); }
public final void removeHandlerListener( final IHandlerListener handlerListener) { super.removeHandlerListener(handlerListener); if (!hasListeners()) { detachListener(); } }
@Override public final void addHandlerListener(final IHandlerListener handlerListener) { if (!hasListeners()) { attachListener(); } super.addHandlerListener(handlerListener); }
/** * @see IHandler#removeHandlerListener(IHandlerListener) */ @Override public void removeHandlerListener(final IHandlerListener handlerListener) { removeListenerObject(handlerListener); } }
/** * 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); } }
public void dispose() { super.dispose(); if(window != null) { window.getSelectionService().removePostSelectionListener(selectionListener); } // Don't hold on to anything when we are disposed to prevent memory leaks (see bug 195521) selection = null; window = null; targetPart = null; shell = null; }
/** * Allow the default {@link #isEnabled()} to answer our enabled state. It * will fire a HandlerEvent if necessary. If clients use this method they * should also consider overriding {@link #setEnabled(Object)} so they can * be notified about framework execution contexts. * * @param state * the enabled state * @since 3.4 */ protected void setBaseEnabled(boolean state) { if (baseEnabled == state) { return; } baseEnabled = state; fireHandlerChanged(new HandlerEvent(this, true, false)); }
@Override public final void removeHandlerListener(final IHandlerListener handlerListener) { super.removeHandlerListener(handlerListener); if (!hasListeners()) { detachListener(); } }
/** * @see IHandler#addHandlerListener(IHandlerListener) */ @Override public void addHandlerListener(final IHandlerListener handlerListener) { addListenerObject(handlerListener); }
@Override public final void addHandlerListener(final IHandlerListener handlerListener) { if (!hasListeners()) { attachListener(); } super.addHandlerListener(handlerListener); }
/** * @see IHandler#removeHandlerListener(IHandlerListener) */ @Override public void removeHandlerListener(final IHandlerListener handlerListener) { removeListenerObject(handlerListener); } }