public void set(final C presenter) { if (current == presenter) { return; } if (current != null) { parent.removePresenter(current); } current = presenter; parent.addPresenter(current); }
@Override public void onBind() { super.onBind(); wasBound = true; } }
protected static <P extends Presenter> P bind(P presenter) { presenter.bind(); return presenter; } }
@Test public void getViewShouldNotFailIfUnbound() { TestPresenter p = new TestPresenter(); p.getView(); }
@Override protected void onUnbind() { super.onUnbind(); if (children != null) { for (final Presenter child : children) { child.unbind(); } } binder.unbind(); }
@Override public void onUnbind() { super.onUnbind(); wasUnbound = true; } }
public Presenter getCurrent() { return current.get(); } }
public void set(final Presenter presenter) { current.set(presenter); }
@Override public void onBind() { super.onBind(); wasBound = true; }
private static <P extends Presenter> P bind(P p) { p.bind(); return p; } }
@Override public void onUnbind() { super.onUnbind(); } }
@Override public void onBind() { super.onBind(); }
@Override protected void onBind() { super.onBind(); // allow handler registrations binder.bind(); // bind anybody that got added before we were bound if (children != null) { for (final Presenter child : children) { child.bind(); } } }
@Override protected void onBind() { super.onBind(); addPresenter(child); } }
@Override public void onBind() { super.onBind(); registerHandler(view.addAttachHandler(new OnViewAttached())); }
@Override public void onBind() { super.onBind(); // two-way binding between checked and view.box() binder.bind(checked).to(view.box()); // one-way binding between our derived value and view.label()'s text binder.bind(() -> checked.isTrue() ? "Checked!" : "Not checked").to(textOf(view.label())); }
@Override public void onBind() { super.onBind(); { Property<IsAnchor> current = basicProperty("current"); set("anchors", view.rootAnchors(), current, view.a1()); set("anchors", view.rootAnchors(), current, view.a2()); set("anchors", view.rootAnchors(), current, view.a3()); set("anchors", view.rootAnchors(), current, view.a4()); } { Property<IsLabel> current = basicProperty("current"); set("labels", view.rootLabels(), current, view.l1()); set("labels", view.rootLabels(), current, view.l2()); set("labels", view.rootLabels(), current, view.l3()); set("labels", view.rootLabels(), current, view.l4()); } }