/** Binds our {@code p} to the selection in {@code source}, given the {@code options}. */ public <O> void to( final IsListBox source, final ListProperty<O> options, final Function<O, String> optionToDisplay, final Function<O, P> optionToValue) { to(source, options, new ListBoxFunctionsAdaptor<P, O>(optionToDisplay, optionToValue)); }
/** Focuses on {@code focusable} when triggered. */ public void focus(final Focusable focusable) { b.add(hookUpEventRunnable(new DomEventRunnable() { public void run(DomEvent<?> event) { focusable.setFocus(true); if (event != null) { event.preventDefault(); } } })); }
/** Binds our {@code p} to the selection in {@code source}, given the {@code options}. */ public void to(final IsListBox source, final List<P> options) { to(source, options, new ListBoxIdentityAdaptor<P>()); }
/** Executes {@code command} when triggered. */ public void execute(final UiCommand command) { b.add(hookUpRunnable(new Runnable() { public void run() { command.execute(); } })); }
public <O> void to(// final IsListBox source, final List<O> options, final Function<O, String> optionToDisplay, final Function<O, P> optionToValue) { to(source, options, new ListBoxFunctionsAdaptor<P, O>(optionToDisplay, optionToValue)); }
/** Binds our {@code p} to the selection in {@code source}, given the {@code options}. */ public void toMultiple(final IsListBox source, final List<P> options) { toMultiple(source, options, new ListBoxIdentityAdaptor<P>()); }
/** Binds each value in {@code p} to a view created by {@code factory}. */ public void to(final IsInsertPanel panel, final ListViewFactory<P> factory) { to(new InsertPanelListLikeAdapter(panel), factory); }
public WhenIsBinder<P> is(final P value) { return new WhenIsBinder<P>(b, property, new WhenCondition<P>() { public boolean evaluate(P current) { return eq(current, value); } public void setInitialValue(Property<P> property) { property.setInitialValue(value); } }); }
/** @return a fluent {@link EventBinder} against {@code changable}. */ @SuppressWarnings("unchecked") public EventBinder onChange(HasValueChangeHandlers<?> changable) { return new ChangeBinder(this, (HasValueChangeHandlers<Object>) changable); }
public void to(final List<P> values) { b.add(hookUpRunnable(new Runnable() { public void run() { values.add(value); } })); }
/** Cancels the event's default action. */ public void preventDefault() { b.add(hookUpEventRunnable(new DomEventRunnable() { public void run(DomEvent<?> event) { event.preventDefault(); } })); }
public void by(final Comparator<P> comparator) { b.add(hookUpRunnable(new Runnable() { public void run() { list.sort(comparator); } })); } }
/** Toggles {@code property} each time the event is triggered. */ public void toggle(final Property<Boolean> property) { b.add(hookUpEventRunnable(new DomEventRunnable() { public void run(DomEvent<?> event) { property.set(TRUE.equals(property.get()) ? false : true); if (event != null) { event.preventDefault(); } } })); }
/** Fires a {@link PlaceRequestEvent} for {@code request} when triggered. */ public void goTo(final EventBus bus, final PlaceRequest request) { b.add(hookUpRunnable(new Runnable() { public void run() { bus.fireEvent(request.asEvent()); } })); }
public void in(final ListProperty<P> values) { b.add(hookUpRunnable(new Runnable() { public void run() { if (up) { values.moveUp(value); } else { values.moveDown(value); } } })); } }
public void from(final List<P> values) { b.add(hookUpRunnable(new Runnable() { public void run() { values.remove(value); } })); }
public void to(final ListProperty<P> values) { b.add(hookUpRunnable(new Runnable() { public void run() { values.add(value); } })); } }
public void from(final ListProperty<P> values) { b.add(hookUpRunnable(new Runnable() { public void run() { values.remove(value); } })); } }
/** Executes {@code runnable} when triggered. */ public void execute(final Runnable runnable) { b.add(hookUpRunnable(runnable)); }