/** * Executes all scheduled {@link RepeatingCommand}s once. Does not execute the commands * newly scheduled by the initial commands. Removes the commands that returned {@code false}. * * <p>After this method completes, {@link #getRepeatingCommands} returns only the commands * that are still scheduled. * * @return whether some commands are still scheduled (returned {@code true}) or * new commands have been scheduled after the execution */ public boolean executeRepeatingCommands() { List<RepeatingCommand> commands = new ArrayList<RepeatingCommand>(repeatingCommands); repeatingCommands.clear(); for (RepeatingCommand command : commands) { boolean reschedule; try { reschedule = command.execute(); } catch (Throwable e) { reschedule = false; GWT.reportUncaughtException(e); } if (reschedule) { repeatingCommands.add(command); } } return !repeatingCommands.isEmpty(); }
/** * Executes all scheduled {@link RepeatingCommand}s once. Does not execute the commands * newly scheduled by the initial commands. Removes the commands that returned {@code false}. * * <p>After this method completes, {@link #getRepeatingCommands} returns only the commands * that are still scheduled. * * @return whether some commands are still scheduled (returned {@code true}) or * new commands have been scheduled after the execution */ public boolean executeRepeatingCommands() { List<RepeatingCommand> commands = new ArrayList<RepeatingCommand>(repeatingCommands); repeatingCommands.clear(); for (RepeatingCommand command : commands) { boolean reschedule; try { reschedule = command.execute(); } catch (Throwable e) { reschedule = false; GWT.reportUncaughtException(e); } if (reschedule) { repeatingCommands.add(command); } } return !repeatingCommands.isEmpty(); }
/** An ugly way to temporarily defer executing commands. * * Currently used for {@link StubCellTable}, whose {@link PublicHasDataPresenter} very * strictly assumes that {@link scheduledFinally} commands will not execute right away. */ public void runWithDeferred(Runnable run) { deferredLevel++; run.run(); // if the users nests runWithDeferred calls, e.g. uses one in a test while // we also add one in StubCellTable, don't execute the deferred commands // until the last one is complete deferredLevel--; if (deferredLevel == 0) { for (Iterator<ScheduledCommand> i = deferred.iterator(); i.hasNext();) { i.next().execute(); i.remove(); } for (Iterator<RepeatingCommand> i = repeating.iterator(); i.hasNext();) { i.next().execute(); i.remove(); } } }
private void executeReaptingCommnand(List<RepeatingCommand> commands) { List<RepeatingCommand> toRemove = new ArrayList<>(); int i = 0; while (i < commands.size()) { RepeatingCommand current = commands.get(i); if (!current.execute()) { toRemove.add(current); } i++; } for (RepeatingCommand rc : toRemove) { commands.remove(rc); } }
public boolean executeRepeating() { return getRepeating().execute(); }
public boolean executeRepeating() { return getRepeating().execute(); }
public boolean executeRepeating() { return getRepeating().execute(); }
private void executeReaptingCommnand(List<RepeatingCommand> commands) { List<RepeatingCommand> toRemove = new ArrayList<>(); int i = 0; while (i < commands.size()) { RepeatingCommand current = commands.get(i); if (!current.execute()) { toRemove.add(current); } i++; } for (RepeatingCommand rc : toRemove) { commands.remove(rc); } }
/** * Called from scheduledFixedInterval to give $entry a static function. */ private static boolean execute(RepeatingCommand cmd) { return cmd.execute(); }
private static void executeRepeatingCommand(RepeatingCommand cmd) { boolean repeat = true; while (repeat) { repeat = cmd.execute(); } }
private void processPendingCommands() { for (RepeatingCommand command : scheduler.getRepeatingCommands()) { command.execute(); } }
/** * Called from scheduledFixedInterval to give $entry a static function. */ private static boolean execute(RepeatingCommand cmd) { return cmd.execute(); }
@Override public void scheduleFinally(final RepeatingCommand cmd) { if (executeImmediately()) { cmd.execute(); } else { repeating.add(cmd); } }
/** * Called from scheduledFixedInterval to give $entry a static function. */ private static boolean execute(RepeatingCommand cmd) { return cmd.execute(); }
private static void executeRepeatingCommand(RepeatingCommand cmd) { boolean repeat = true; while (repeat) { repeat = cmd.execute(); } }
/** * Executes all scheduled {@link RepeatingCommand}s once. Does not execute the commands * newly scheduled by the initial commands. Removes the commands that returned {@code false}. * * <p>After this method completes, {@link #getRepeatingCommands} returns only the commands * that are still scheduled. * * @return whether some commands are still scheduled (returned {@code true}) or * new commands have been scheduled after the execution */ public boolean executeRepeatingCommands() { List<RepeatingCommand> commands = new ArrayList<RepeatingCommand>(repeatingCommands); repeatingCommands.clear(); for (RepeatingCommand command : commands) { boolean reschedule; try { reschedule = command.execute(); } catch (Throwable e) { reschedule = false; GWT.reportUncaughtException(e); } if (reschedule) { repeatingCommands.add(command); } } return !repeatingCommands.isEmpty(); }
public boolean executeRepeating() { return getRepeating().execute(); }
/** * Called from scheduledFixedInterval to give $entry a static function. */ private static boolean execute(RepeatingCommand cmd) { return cmd.execute(); }