@Override public boolean isEnabled() { return handler.isEnabled(); }
/** * Returns whether this command has a handler, and whether this handler is * also handled. * * @return <code>true</code> if the command is handled; <code>false</code> * otherwise. */ public final boolean isHandled() { if (handler == null) { return false; } return handler.isHandled(); }
/** * {@inheritDoc} */ public Object execute(final ExecutionEvent event) throws ExecutionException { return fDelegateHandler.execute(event); }
/** * Passes the dipose on to the proxied handler, if it has been loaded. */ @Override public void dispose() { if (handler != null) { if (handlerListener != null) { handler.removeHandlerListener(handlerListener); handlerListener = null; } handler.dispose(); handler = null; } if (enablementListener != null) { evaluationService.removeEvaluationListener(enablementRef); enablementRef = null; enablementListener = null; } }
@Override public void runWithEvent(Event event) { if (handler == null || !handler.isEnabled()) return; try { handleTargetSaveableChange(); } catch (InvocationTargetException e) { handle(e); return; } catch (InterruptedException e) { // Canceled so return return; } try { handler.execute(new ExecutionEvent(null, Collections.EMPTY_MAP, event, null)); } catch (ExecutionException e) { handle(e); } }
@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)); } }
this.handler.removeHandlerListener(getHandlerListener()); this.handler.addHandlerListener(getHandlerListener());
@Override public void run() throws Exception { handler.dispose(); }
public E4HandlerProxy(Command command, IHandler handler) { this.command = command; this.handler = handler; handler.addHandlerListener(this); }
@Override public void removeHandlerListener(IHandlerListener handlerListener) { handler.removeHandlerListener(handlerListener); }
public void runWithEvent(Event event) { if (handler == null || !handler.isEnabled()) return; try { handleTargetSaveableChange(); } catch (InvocationTargetException e) { handle(e); return; } catch (InterruptedException e) { // Canceled so return return; } try { handler.execute(new ExecutionEvent(null, Collections.EMPTY_MAP, event, null)); } catch (ExecutionException e) { handle(e); } }
this.handler.removeHandlerListener(getHandlerListener()); this.handler.addHandlerListener(getHandlerListener());
@Override public void dispose() { handler.dispose(); }
@Override public void addHandlerListener(IHandlerListener handlerListener) { handler.addHandlerListener(handlerListener); }
/** * {@inheritDoc} */ public boolean isEnabled() { return !hasRefactorings(getSynchronizationContext(), getSynchronizePageConfiguration()) && fDelegateHandler.isEnabled(); } }
public void runWithEvent(Event event) { IHandler handler = getHandler(); if (handler != null && handler.isEnabled()) { final SaveableComparison currentBuffer = ((ModelSynchronizeParticipant)configuration.getParticipant()).getActiveSaveable(); if (currentBuffer != null && currentBuffer.isDirty()) { handler.execute(new ExecutionEvent(null, Collections.EMPTY_MAP, event, null)); } catch (ExecutionException e) { handle(e);
/** * Returns whether this command has a handler, and whether this handler is * also handled. * * @return <code>true</code> if the command is handled; <code>false</code> * otherwise. */ public final boolean isHandled() { if (handler == null) { return false; } return handler.isHandled(); }