@Override public void setEnabled(boolean enabled) { boolean oldEnabled = fEnabled; fEnabled = enabled; if (fEnabled != oldEnabled && fCurrentEnabledTarget == this) { fireHandlerChanged(new HandlerEvent(DebugCommandHandler.this, true, false)); } }
@Override public void windowActivated(IWorkbenchWindow w) { fCurrentEnabledTarget = fEnabledTargetsMap.get(w); fireHandlerChanged(new HandlerEvent(DebugCommandHandler.this, true, false)); } };
/** * Set the enablement of this handler. * @param isEnabled whether the handler is enabled */ protected void setEnabled(boolean isEnabled) { if (enabled != isEnabled) { enabled = isEnabled; fireHandlerChanged(new HandlerEvent(this, true, false)); } }
/** * Set the enablement of this handler. * @param isEnabled whether the handler is enabled */ protected void setEnabled(boolean isEnabled) { if (enabled != isEnabled) { enabled = isEnabled; fireHandlerChanged(new HandlerEvent(this, true, false)); } }
protected void setEnabled(boolean isEnabled) { if (enabled != isEnabled) { enabled = isEnabled; fireHandlerChanged(new HandlerEvent(this, true, false)); } } }
public final void propertyChange( final PropertyChangeEvent propertyChangeEvent) { final String property = propertyChangeEvent.getProperty(); fireHandlerChanged(new HandlerEvent(ActionHandler.this, IAction.ENABLED.equals(property), IAction.HANDLED .equals(property))); } };
/** * 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)); }
/** * 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)); }
/** * 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)); }
/** * When a listener is attached to this handler, then this registers a * listener with the underlying action. * * @since 3.1 */ private final void attachListener() { if (propertyChangeListener == null) { propertyChangeListener = propertyChangeEvent -> { final String property = propertyChangeEvent.getProperty(); fireHandlerChanged(new HandlerEvent(ActionHandler.this, IAction.ENABLED.equals(property), IAction.HANDLED.equals(property))); }; } this.action.addPropertyChangeListener(propertyChangeListener); }
/** * When a listener is attached to this handler, then this registers a * listener with the underlying action. * * @since 3.1 */ private final void attachListener() { if (propertyChangeListener == null) { propertyChangeListener = propertyChangeEvent -> { final String property = propertyChangeEvent.getProperty(); fireHandlerChanged(new HandlerEvent(ActionHandler.this, IAction.ENABLED.equals(property), IAction.HANDLED.equals(property))); }; } this.action.addPropertyChangeListener(propertyChangeListener); }
@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)); } }
private IHandlerListener getHandlerListener() { if (handlerListener == null) { handlerListener = handlerEvent -> fireHandlerChanged(new HandlerEvent(HandlerProxy.this, handlerEvent.isEnabledChanged(), handlerEvent .isHandledChanged())); } return handlerListener; }
handledChanged = true; final HandlerEvent newEvent = new HandlerEvent(this, enabledChanged, handledChanged); super.fireHandlerChanged(newEvent);
private IPropertyChangeListener getEnablementListener() { if (enablementListener == null) { enablementListener = event -> { if (event.getProperty() == PROP_ENABLED) { setProxyEnabled(event.getNewValue() == null ? false : ((Boolean) event.getNewValue()) .booleanValue()); fireHandlerChanged(new HandlerEvent(HandlerProxy.this, true, false)); } }; } return enablementListener; }