/** * Schedules the command. * * <p> * Protected so that subclasses can override to use an alternative scheduler. * </p> * * @param command the command to execute */ protected void scheduleFinally(ScheduledCommand command) { Scheduler.get().scheduleFinally(command); }
private static void schedule() { if (!needsInjection) { needsInjection = true; Scheduler.get().scheduleFinally(flusher); } }
/** * Schedules a layout. The duration and callback passed to this method will * supercede any previous call that has not yet been executed. * * @param duration * @param callback */ public void schedule(int duration, AnimationCallback callback) { this.duration = duration; this.callback = callback; canceled = false; if (!scheduled) { scheduled = true; Scheduler.get().scheduleFinally(this); } }
/** * Schedules a {@link SelectionChangeEvent} to fire at the * end of the current event loop. */ protected void scheduleSelectionChangeEvent() { setEventCancelled(false); if (!isEventScheduled()) { setEventScheduled(true); Scheduler.get().scheduleFinally(new ScheduledCommand() { public void execute() { setEventScheduled(false); if (isEventCancelled()) { setEventCancelled(false); return; } fireSelectionChangeEvent(); } }); } }
/** * Returns a mutable {@link RequestContext} and enqueues the given receiver to * be called as though it had been passed directly to * {@link RequestContext#fire(Receiver)}. */ public C get(Receiver<Void> receiver) { if (openContext == null) { openContext = createContext(requestFactory); openContextImpl = (AbstractRequestContext) openContext; openContextImpl.setFireDisabled(true); getScheduler().scheduleFinally(new ScheduledCommand() { @Override public void execute() { assert !openContextImpl.isLocked() : "AbstractRequestContext.fire() should have been a no-op"; openContextImpl.setFireDisabled(false); openContext.fire(); openContext = null; openContextImpl = null; } }); } if (receiver != null) { // Queue a final callback receiver openContextImpl.fire(receiver); } return openContext; }
@Override protected final void tick() { if (m_refire) { m_refire = false; Scheduler.get().scheduleFinally(m_action); } }
private void checkAnswersToGive() { if( fCallbackingScheduled ) return; fCallbackingScheduled = true; Scheduler.get().scheduleFinally( checkResults ); }
private void checkAnswersToGive() { if( fCallbackingScheduled ) return; fCallbackingScheduled = true; Scheduler.get().scheduleFinally( checkResults ); }
@Override protected void extend(final ServerConnector target) { // non tree updates in V7 :(, map might not exist when this is called Scheduler.get().scheduleFinally(new ScheduledCommand() { @Override public void execute() { getMap().addControl(getControl()); } }); }
/** * Set focus to current window. Current method is not intended to be called by user. Service * method used by {@link WindowManager} to control the focus between window switch. */ protected final void focus() { Scheduler.get().scheduleFinally(this::doFocus); }
/** * Schedules the command. * * <p> * Protected so that subclasses can override to use an alternative scheduler. * </p> * * @param command the command to execute */ protected void scheduleFinally(ScheduledCommand command) { Scheduler.get().scheduleFinally(command); }
private static void schedule() { if (!needsInjection) { needsInjection = true; Scheduler.get().scheduleFinally(flusher); } }
Scheduler.get().scheduleFinally(new Scheduler.ScheduledCommand() { @Override public void execute() {
@Override public void onElementResize(ElementResizeEvent e) { if(!alreadyLayouted) { NavigationBarConnector.this.getWidget().avoidCaptionOverlap(); Scheduler.get().scheduleFinally(doResetLayouting); alreadyLayouted = true; } } };
public void testScheduleThenCancelSchedules() { target.schedule(); target.cancel(); verify(scheduler).scheduleFinally(target); verifyNoMoreInteractions(scheduler); }
public void testScheduleIsIdempotent() { target.schedule(); target.schedule(); verify(scheduler).scheduleFinally(target); verifyNoMoreInteractions(scheduler); }
public void testScheduleIsIdempotent() { target.schedule(); target.schedule(); verify(scheduler).scheduleFinally(target); verifyNoMoreInteractions(scheduler); }
public void testScheduleAfterCancelDoesNotReschedule() { target.schedule(); target.cancel(); target.schedule(); verify(scheduler).scheduleFinally(target); verifyNoMoreInteractions(scheduler); }
public void testScheduleAfterPassDoesReschedule() { target.schedule(); target.cancel(); target.execute(); target.schedule(); verify(scheduler, times(2)).scheduleFinally(target); verifyNoMoreInteractions(scheduler); }
public void onDeleteRow( DeleteRowEvent event ) { model.getData().remove( event.getIndex() ); model.getAnalysisData().remove( event.getIndex() ); Scheduler.get().scheduleFinally( new Command() { public void execute() { updateSystemControlledColumnValues(); } } ); //Log deletion of row model.getAuditLog().add( new DeleteRowAuditLogEntry( identity.getName(), event.getIndex() ) ); }