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
λ joel-desktop GWTP → λ git master → mvn clean install | |
[INFO] Scanning for projects... | |
[INFO] ------------------------------------------------------------------------ | |
[INFO] Reactor Build Order: | |
[INFO] | |
[INFO] GWT-Platform | |
[INFO] GWTP Build Tools | |
[INFO] GWTP Core | |
[INFO] GWTP Clients common | |
[INFO] GWTP MVP shared |
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 ComputerHackedEvent extends GwtEvent<ComputerHackedEvent.ComputerHackedHandler> { | |
public interface ComputerHackedHandler extends EventHandler { | |
void onSystemHacked(ComputerHackedEvent event); | |
} | |
public static final Type<ComputerHackedHandler> TYPE = new Type<>(); | |
private final String hackerName; | |
public ComputerHackedEvent(String hackerName) { |
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 HackerView extends ViewWithUiHandlers<HackerUiHandlers> | |
implements HackerPresenter.MyView { | |
interface Binder extends UiBinder<Widget, HackerView> { | |
} | |
@UiField | |
Button hackThePlanet; | |
@Inject | |
HackerView(Binder binder) { |
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 HackerPresenter extends PresenterWidget<MyView> | |
implements HackerUiHandlers { | |
public interface MyView extends View, HasUiHandlers<HackerUiHandlers> { | |
} | |
private final String hackerName; | |
@Inject | |
HackerPresenter( | |
EventBus eventBus, |
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 ComputerPresenter extends PresenterWidget<MyView> | |
implements ComputerHackedEvent.ComputerHackedHandler { | |
public interface MyView extends View { | |
void setComputerName(String computerName); | |
void displayStatus(String computerName, String hackerName); | |
} | |
private final String computerName; | |
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(); |
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 RootView extends ViewImpl | |
implements RootPresenter.MyView { | |
interface Binder extends UiBinder<Widget, RootView> { | |
} | |
@UiField | |
HTMLPanel computers; | |
@UiField | |
HTMLPanel hackers; | |
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
import com.google.web.bindery.event.shared.HandlerRegistration; | |
public interface HasComputerHackedHandlers { | |
HandlerRegistration addComputerHackedHandler(ComputerHackedEvent.ComputerHackedHandler handler, Object source); | |
} |
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 HandlerRegistration addComputerHackedHandler(ComputerHackedEvent.ComputerHackedHandler handler, Object source) { | |
HandlerRegistration hr = getEventBus().addHandlerToSource(ComputerHackedEvent.TYPE, source, handler); | |
registerHandler(hr); | |
return hr; | |
} |
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
// GWT | |
eventBus.addHandler(eventType, handler) | |
eventBus.addHandlerToSource(eventType, source, handler) | |
eventBus.fireEvent(event) | |
eventBus.fireEventFromSource(event, source) | |
// GWTP | |
presenterWidget.addHandler(eventType, handler) // deprecated | |
presenterWidget.addRegisteredHandler(eventType, handler) |
OlderNewer