Skip to content

Commit

Permalink
gwt: Replace deprecated HandlerManager with SimpleEventBus.
Browse files Browse the repository at this point in the history
  • Loading branch information
calin-iorgulescu committed Feb 20, 2015
1 parent fa30e21 commit b799f3a
Show file tree
Hide file tree
Showing 14 changed files with 41 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.logical.shared.ValueChangeEvent;
import com.google.gwt.event.logical.shared.ValueChangeHandler;
import com.google.gwt.event.shared.HandlerManager;
import com.google.gwt.event.shared.EventBus;
import com.google.gwt.user.client.History;
import com.google.gwt.user.client.HistoryListener;
import com.google.gwt.user.client.Window;
Expand All @@ -36,7 +36,7 @@

public class AppController implements HistoryListener {

private HandlerManager eventBus;
private EventBus eventBus;
private HTTPService service;
private HasWidgets container;
private SimplePanel content = new SimplePanel();
Expand All @@ -49,7 +49,7 @@ public class AppController implements HistoryListener {
private HashSet<String> coursesTags;
private HashMap<String, Course> idToCourse;

public AppController(HandlerManager eventBus, HTTPService service) {
public AppController(EventBus eventBus, HTTPService service) {
this.eventBus = eventBus;
this.service = service;
bindHistory();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
import ro.pub.cs.vmchecker.client.event.ErrorDisplayEvent;

import com.google.gwt.core.client.GWT;
import com.google.gwt.event.shared.HandlerManager;
import com.google.gwt.event.shared.EventBus;
import ro.pub.cs.vmchecker.client.i18n.VmcheckerConstants;

public class ExceptionHandler {

private static ExceptionHandler exceptionHandlerSingleton;

private HandlerManager eventBus;
private EventBus eventBus;
private static VmcheckerConstants constants = GWT
.create(VmcheckerConstants.class);

Expand All @@ -23,7 +23,7 @@ public static ExceptionHandler getInstance() {
return exceptionHandlerSingleton;
}

public void setEventBus(HandlerManager eventBus) {
public void setEventBus(EventBus eventBus) {
this.eventBus = eventBus;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
import ro.pub.cs.vmchecker.client.service.HTTPService;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.event.shared.HandlerManager;
import com.google.gwt.event.shared.SimpleEventBus;
import com.google.gwt.user.client.ui.RootPanel;

public class Vmchecker implements EntryPoint {

public void onModuleLoad() {
HandlerManager eventBus = new HandlerManager(null);
SimpleEventBus eventBus = new SimpleEventBus();
try {
HTTPService rpcService = new HTTPService(eventBus);
AppController appCtrl = new AppController(eventBus, rpcService);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import com.google.gwt.event.logical.shared.HasSelectionHandlers;
import com.google.gwt.event.logical.shared.SelectionEvent;
import com.google.gwt.event.logical.shared.SelectionHandler;
import com.google.gwt.event.shared.HandlerManager;
import com.google.gwt.event.shared.EventBus;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.FormPanel;
Expand Down Expand Up @@ -55,7 +55,7 @@ public interface ResultsWidget {
HasHTML getResultContainer();
}

private HandlerManager eventBus;
private EventBus eventBus;
private HTTPService service;
private static VmcheckerConstants constants = GWT
.create(VmcheckerConstants.class);
Expand All @@ -69,7 +69,7 @@ public interface ResultsWidget {
private StatementWidget statementWidget = new ro.pub.cs.vmchecker.client.ui.StatementWidget();
private ResultsWidget resultsWidget = new ro.pub.cs.vmchecker.client.ui.ResultsWidget();

public AssignmentBoardPresenter(HandlerManager eventBus, HTTPService service, String courseId, AssignmentBoardPresenter.Widget widget) {
public AssignmentBoardPresenter(EventBus eventBus, HTTPService service, String courseId, AssignmentBoardPresenter.Widget widget) {

this.eventBus = eventBus;
this.service = service;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import com.google.gwt.event.dom.client.HasKeyPressHandlers;
import com.google.gwt.event.logical.shared.SelectionEvent;
import com.google.gwt.event.logical.shared.SelectionHandler;
import com.google.gwt.event.shared.HandlerManager;
import com.google.gwt.event.shared.EventBus;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.AbstractImagePrototype;
Expand Down Expand Up @@ -69,7 +69,7 @@ public interface UploadLargeWidget {
Tree getFileListTree();
}

private HandlerManager eventBus;
private EventBus eventBus;
private HTTPService service;
private String courseId;
private Assignment assignment;
Expand All @@ -85,7 +85,7 @@ public interface UploadLargeWidget {
.create(VmcheckerImages.class);


public AssignmentBoardUploadPresenter(HandlerManager eventBus, HTTPService service) {
public AssignmentBoardUploadPresenter(EventBus eventBus, HTTPService service) {
this.eventBus = eventBus;
this.service = service;
listenSubmitUpload();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.HasClickHandlers;
import com.google.gwt.event.shared.HandlerManager;
import com.google.gwt.event.shared.EventBus;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.HasWidgets;
import com.google.gwt.user.client.ui.Widget;

public class AssignmentPresenter implements Presenter {

private HandlerManager eventBus;
private EventBus eventBus;
private HTTPService service;
private AssignmentWidget widget;

Expand All @@ -42,7 +42,7 @@ public interface AssignmentWidget {
HasClickHandlers getViewStatsButton();
}

public AssignmentPresenter(HandlerManager eventBus, HTTPService service, String courseId,
public AssignmentPresenter(EventBus eventBus, HTTPService service, String courseId,
User user, AssignmentWidget widget) {
this.eventBus = eventBus;
this.service = service;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.HasChangeHandlers;
import com.google.gwt.event.dom.client.HasClickHandlers;
import com.google.gwt.event.shared.HandlerManager;
import com.google.gwt.event.shared.EventBus;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.HasText;
Expand All @@ -26,7 +26,7 @@

public class HeaderPresenter implements Presenter {

private HandlerManager eventBus;
private EventBus eventBus;
private HTTPService service;
private HeaderWidget widget;
private HasWidgets container;
Expand All @@ -45,7 +45,7 @@ public interface HeaderWidget {
int getSelectedCourseIndex();
}

public HeaderPresenter(HandlerManager eventBus, HTTPService service, HeaderWidget widget) {
public HeaderPresenter(EventBus eventBus, HTTPService service, HeaderWidget widget) {
this.eventBus = eventBus;
this.service = service;
bindWidget(widget);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import com.google.gwt.event.dom.client.KeyCodes;
import com.google.gwt.event.dom.client.KeyPressEvent;
import com.google.gwt.event.dom.client.KeyPressHandler;
import com.google.gwt.event.shared.HandlerManager;
import com.google.gwt.event.shared.EventBus;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.rpc.AsyncCallback;
Expand All @@ -37,13 +37,13 @@ public interface Widget {
HasKeyPressHandlers[] getEnterSources();
}

private HandlerManager eventBus;
private EventBus eventBus;
private HTTPService service;
private static LoginConstants constants = GWT
.create(LoginConstants.class);
private Widget widget;

public LoginPresenter(HandlerManager eventBus, HTTPService service, Widget widget) {
public LoginPresenter(EventBus eventBus, HTTPService service, Widget widget) {
this.eventBus = eventBus;
this.service = service;
bindWidget(widget);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package ro.pub.cs.vmchecker.client.presenter;

import com.google.gwt.event.dom.client.HasClickHandlers;
import com.google.gwt.event.shared.HandlerManager;
import com.google.gwt.event.shared.EventBus;
import com.google.gwt.user.client.ui.HasWidgets;

public class MenuPresenter implements Presenter {
Expand All @@ -11,10 +11,10 @@ public interface Widget extends HasClickHandlers {
public int getSelectedIndex();
}

private HandlerManager eventBus;
private EventBus eventBus;
private MenuPresenter.Widget widget;

public MenuPresenter(HandlerManager eventBus, MenuPresenter.Widget widget) {
public MenuPresenter(EventBus eventBus, MenuPresenter.Widget widget) {
this.eventBus = eventBus;
bindWidget(widget);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.shared.HandlerManager;
import com.google.gwt.event.shared.EventBus;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.HTMLTable;
import com.google.gwt.user.client.ui.HasWidgets;
Expand Down Expand Up @@ -56,7 +56,7 @@ public void onClick(ClickEvent event) {
}


private HandlerManager eventBus;
private EventBus eventBus;
private HTTPService service;
private static VmcheckerConstants constants = GWT
.create(VmcheckerConstants.class);
Expand All @@ -68,7 +68,7 @@ public void onClick(ClickEvent event) {
private Assignment[] assignments;
private ArrayList<ResultInfo> teamResultsInfo, studentResultsInfo;

public StatisticsPresenter(HandlerManager eventBus, HTTPService service,
public StatisticsPresenter(EventBus eventBus, HTTPService service,
String courseId, User user, Assignment[] assignments, StatisticsPresenter.Widget widget) {
this.eventBus = eventBus;
this.service = service;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.HasChangeHandlers;
import com.google.gwt.event.dom.client.HasClickHandlers;
import com.google.gwt.event.shared.HandlerManager;
import com.google.gwt.event.shared.EventBus;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.HasText;
Expand All @@ -27,7 +27,7 @@
import com.google.gwt.core.client.GWT;
public class StatusPresenter implements Presenter {

private HandlerManager eventBus;
private EventBus eventBus;
private HTTPService service;
private StatusWidget widget;
private HasWidgets container;
Expand All @@ -44,7 +44,7 @@ public interface StatusWidget {
void setStatusType(StatusChangedEvent.StatusType type);
}

public StatusPresenter(HandlerManager eventBus, HTTPService service, StatusWidget widget) {
public StatusPresenter(EventBus eventBus, HTTPService service, StatusWidget widget) {
this.eventBus = eventBus;
this.service = service;
this.widget = widget;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import ro.pub.cs.vmchecker.client.service.json.JSONDecoder;

import com.google.gwt.core.client.GWT;
import com.google.gwt.event.shared.HandlerManager;
import com.google.gwt.event.shared.EventBus;
import com.google.gwt.http.client.Request;
import com.google.gwt.http.client.RequestBuilder;
import com.google.gwt.http.client.RequestCallback;
Expand All @@ -25,13 +25,13 @@ public class Delegate<T> {

public static final int requestTimeoutMillis = 10000; /* 10 seconds */

private HandlerManager eventBus;
private EventBus eventBus;
private RequestBuilder rb;
private boolean isGet, attachLocale;
private String url;
private HashMap<String, Request> ongoingRequests;

public Delegate(HandlerManager eventBus, String url, boolean isGet, boolean attachLocale,
public Delegate(EventBus eventBus, String url, boolean isGet, boolean attachLocale,
HashMap<String, Request> ongoingRequests) {
this.eventBus = eventBus;
this.isGet = isGet;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import java.util.HashMap;

import com.google.gwt.core.client.GWT;
import com.google.gwt.event.shared.HandlerManager;
import com.google.gwt.event.shared.EventBus;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.http.client.Request;

Expand Down Expand Up @@ -40,7 +40,7 @@ public class HTTPService {
public static String UPLOAD_MD5_URL = VMCHECKER_SERVICES_URL + "uploadAssignmentMd5";
public static String BEGIN_EVALUATION_URL = VMCHECKER_SERVICES_URL + "beginEvaluation";

private HandlerManager eventBus;
private EventBus eventBus;
private HashMap<String, Request> ongoingRequests = new HashMap<String, Request>();

/**
Expand All @@ -57,7 +57,7 @@ public static String computeServicesURL() {
return uiURL.substring(0, uiURL.substring(0, uiURL.lastIndexOf('/')).lastIndexOf('/') + 1) + SERVICES_SUFFIX + '/';
}

public HTTPService(HandlerManager eventBus) {
public HTTPService(EventBus eventBus) {
this.eventBus = eventBus;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
import ro.pub.cs.vmchecker.client.service.json.JSONDecoder;

import com.google.gwt.core.client.GWT;
import com.google.gwt.event.shared.HandlerManager;
import com.google.gwt.event.shared.EventBus;

public class ServiceError {

private HandlerManager eventBus;
private EventBus eventBus;
private static VmcheckerConstants constants = GWT
.create(VmcheckerConstants.class);
private String URL;

public ServiceError(HandlerManager eventBus, String URL) {
public ServiceError(EventBus eventBus, String URL) {
this.eventBus = eventBus;
this.URL = URL;
}
Expand Down

0 comments on commit b799f3a

Please sign in to comment.