Last active
August 29, 2015 14:21
-
-
Save Pacane/4bde8ebc1b0ddf6e7b4b to your computer and use it in GitHub Desktop.
RootPresenter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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