Skip to content

Instantly share code, notes, and snippets.

@Pacane
Last active August 29, 2015 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Pacane/e63706b45d5f9001334c to your computer and use it in GitHub Desktop.
Save Pacane/e63706b45d5f9001334c to your computer and use it in GitHub Desktop.
RootView
public class RootView extends ViewImpl
implements RootPresenter.MyView {
interface Binder extends UiBinder<Widget, RootView> {
}
@UiField
HTMLPanel computers;
@UiField
HTMLPanel hackers;
@Inject
RootView(Binder uiBinder) {
initWidget(uiBinder.createAndBindUi(this));
}
@Override
public void addToSlot(Object slot, IsWidget content) {
super.addToSlot(slot, content);
if (slot == RootPresenter.SLOT_COMPUTERS) {
computers.add(content);
} else if (slot == RootPresenter.SLOT_HACKERS) {
hackers.add(content);
}
}
@Override
public void removeFromSlot(Object slot, IsWidget content) {
super.removeFromSlot(slot, content);
if (slot == RootPresenter.SLOT_COMPUTERS) {
computers.remove(content);
} else if (slot == RootPresenter.SLOT_HACKERS) {
hackers.remove(content);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment