@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()));
  }
Esempio n. 2
0
  @Override
  public void onBind() {
    super.onBind();

    add(new HeaderPresenter(state.allTodos), view.headerPlaceholder());
    add(new MainPresenter(state), view.mainPlaceholder());
    add(new FooterPresenter(state), view.footerPlaceholder());
    view.root().addAndReplaceElement(newInfoView(), view.infoPlaceholder());

    binder.when(state.allTodos.size()).is(0).hide(view.main(), view.footer());
  }