@Override public Void excecute(final IMessageCollector monitor, final ICanceler canceler, final Void value) throws InvocationTargetException, CanceledException { ActionConfigurationBuilder.this.task.execute(); return null; } }).build();
@Override public <E extends Exception> IIf or(final IBlock<E> block) throws E { if (!this.value) { block.execute(); } return this; }
@Override public <E extends Exception> IIf excecute(final IBlock<E> block) throws E { if (this.value) { block.execute(); } return this; }
@Override public IOptional<T, E> or(final IBlock<E> block) { try { block.execute(); return this; } catch (final Exception exception) { return Optional.failed(this.exceptionClass, exception, null); } }
default <E extends Exception> void ifValid(final IBlock<E> block) throws E { if (isValid()) { block.execute(); } }
default <E extends Exception> void isFalse(final IBlock<E> block) throws E { if (get()) { block.execute(); } }
default <E extends Exception> void isTrue(final IBlock<E> block) throws E { if (get()) { block.execute(); } }
default <E extends Exception> void ifValid(final IBlock<E> block) throws E { if (isValid()) { block.execute(); } }
private void execute(final IBlock<RuntimeException> block) { this.limitReachedActions.forEach(a -> remove(a)); this.limitReachedActions.clear(); block.execute(); if (this.counter.get() >= this.limit) { this.limitReachedActions.add(limitReachedAction); add(limitReachedAction); } }
default <T, E extends Exception> IFactory<IBlock<RuntimeException>, IWatcher, RuntimeException> watcherFactory() { return closure -> { final ICancelerListener listener = () -> closure.execute(); addCancelerListener(listener); return new IWatcher() { @Override public void check() throws InterruptedException { ICanceler.this.check(); } @Override public void close() throws RuntimeException { removeCancelerListener(listener); } }; }; }
.setIcon(GuiIcons.EDIT_CLEAR_LOCATIONBAR_ICON) .setTooltip(tooltip) .setProcedure(value -> clearBlock.execute()) .build(); setEnabled(document, enabledDistributor, action);