/** Removes {@code child} as a child presenter, and unbinds it. */ public void removePresenter(final Presenter child) { if (children().remove(child)) { child.unbind(); } else { throw new NoSuchElementException("Presenter was not a child of ours " + child); } }
/** Adds {@code child} as a child presenter, and binds it if we're already bound. */ public <C extends Presenter> C addPresenter(final C child) { if (children().add(child)) { if (isBound()) { child.bind(); } } return child; }