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/4bde8ebc1b0ddf6e7b4b to your computer and use it in GitHub Desktop.
Save Pacane/4bde8ebc1b0ddf6e7b4b to your computer and use it in GitHub Desktop.
RootPresenter
public class RootPresenter extends Presenter<RootPresenter.MyView, RootPresenter.MyProxy> {
interface MyView extends View {
}
@ProxyStandard
@NameToken(NameTokens.home)
interface MyProxy extends ProxyPlace<RootPresenter> {
}
public static final Object SLOT_COMPUTERS = new Object();
public static final Object SLOT_HACKERS = new Object();
private final WidgetsFactory widgetsFactory;
@Inject
RootPresenter(
EventBus eventBus,
MyView view,
MyProxy proxy,
WidgetsFactory widgetsFactory) {
super(eventBus, view, proxy, ApplicationPresenter.SLOT_SetMainContent);
this.widgetsFactory = widgetsFactory;
}
@Override
protected void onBind() {
super.onBind();
HackerPresenter zeroCool = widgetsFactory.createHacker("Zer0C00L");
HackerPresenter acidBurn = widgetsFactory.createHacker("AcidBurn");
addToSlot(SLOT_HACKERS, zeroCool);
addToSlot(SLOT_HACKERS, acidBurn);
ComputerPresenter computerA = widgetsFactory.createComputer("A");
ComputerPresenter computerB = widgetsFactory.createComputer("B");
addToSlot(SLOT_COMPUTERS, computerA);
addToSlot(SLOT_COMPUTERS, computerB);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment