@Test public void saveListenersAreFiredOnSave() { IExecutionListener saveListener = createStrictMock(IExecutionListener.class); reset(saveListener); saveListener.preExecute(org.eclipse.ui.IWorkbenchCommandConstants.FILE_SAVE, null); expectLastCall().times(1); saveListener.postExecuteSuccess(org.eclipse.ui.IWorkbenchCommandConstants.FILE_SAVE, null); expectLastCall().times(1); replay(saveListener); eclipse.addCommandServiceListener(saveListener); eclipseMockCtrl.issueSaveEvent(SaveEventKind.SAVE); verify(saveListener); }
@Override public void addCommandServiceListener(IExecutionListener iel) { final ICommandService service = (ICommandService) PlatformUI.getWorkbench().getService(ICommandService.class); service.addExecutionListener(iel); }
@Override public void removeCommandServiceListener(IExecutionListener iel) { final ICommandService service = (ICommandService) PlatformUI.getWorkbench().getService(ICommandService.class); service.removeExecutionListener(iel); }
public void issueSaveEvent(SaveEventKind kind) { for (IExecutionListener listener : this.saveListeners) { listener.preExecute(kind.getEclipseActionID(), null); listener.postExecuteSuccess(kind.getEclipseActionID(), null); } }
static IExecutionListener getTagListener() { return tagMarker; }
static IExecutionListener getExecListener(boolean isReverse){ return (isReverse ? StaticRevExecection.revexecutionListener : StaticExecection.executionListener); }
static IExecutionListener getCopyExecListener(boolean isReverse) { return (isReverse ? StaticRevCopyExecection.revcopyexecutionListener : StaticCopyExecection.copyexecutionListener); }
public MinderBinder(String commandId, String contextId, String keyString, IExecutionListener enhancer) { this.commandId = commandId; this.contextId = contextId; this.keyString = keyString; this.enhancer = enhancer; }
public IExecutionListener getEnhancer() { return enhancer; }
/** * Adds an {@link IExecutionListener} to the Eclipse workbench's command service. * * @param iel * The listener to be added. */ public void addCommandServiceListener(IExecutionListener iel);
/** * Removes an {@link IExecutionListener} from the Eclipse workbench's command service. * * @param iel * The listener to be removed. */ void removeCommandServiceListener(IExecutionListener iel);
/** * Adds an execution listener to the command service. This listener will be * notified as commands are executed. * <p> * <b>Note:</b> listeners should be removed when no longer necessary. If * not, they will be removed when the IServiceLocator used to acquire this * service is disposed. * </p> * * @param listener * The listener to add; must not be <code>null</code>. * @see #removeExecutionListener(IExecutionListener) */ public void addExecutionListener(IExecutionListener listener);
/** * Removes an execution listener from the command service. * * @param listener * The listener to remove; must not be <code>null</code>. */ public void removeExecutionListener(IExecutionListener listener);