use of com.google.web.bindery.event.shared.EventBus in project activityinfo by bedatadriven.
the class AppEntryPoint method onModuleLoad.
@Override
public void onModuleLoad() {
LOGGER.info("user.agent = " + System.getProperty("user.agent"));
LOGGER.info("gxt.user.agent = " + System.getProperty("gxt.user.agent"));
LOGGER.info("gxt.device = " + System.getProperty("gxt.device"));
Icons.INSTANCE.ensureInjected();
AppCache appCache = new AppCache();
AppCacheMonitor3 monitor = new AppCacheMonitor3(appCache);
monitor.start();
EventBus eventBus = new SimpleEventBus();
PlaceController placeController = new PlaceController(eventBus);
ConnectionListener connectionListener = new ConnectionListener();
connectionListener.start();
ActivityInfoClientAsync client = new ActivityInfoClientAsyncImpl(findServerUrl());
HttpStore httpStore = new HttpStore(connectionListener.getOnline(), client, Scheduler.get());
OfflineStore offlineStore = new OfflineStore(httpStore, IDBFactoryImpl.create());
FormStore formStore = new FormStoreImpl(httpStore, offlineStore, Scheduler.get());
LocalStorage storage = LocalStorage.create();
Viewport viewport = new Viewport();
AppFrame appFrame = new AppFrame(appCache, httpStore, offlineStore);
ActivityMapper activityMapper = new AppActivityMapper(formStore, storage);
ActivityManager activityManager = new ActivityManager(activityMapper, eventBus);
activityManager.setDisplay(appFrame.getDisplayWidget());
AppPlaceHistoryMapper historyMapper = new AppPlaceHistoryMapper();
PlaceHistoryHandler historyHandler = new PlaceHistoryHandler(historyMapper);
historyHandler.register(placeController, eventBus, DEFAULT_PLACE);
// Start synchronizer...
RecordSynchronizer synchronizer = new RecordSynchronizer(httpStore, offlineStore);
viewport.add(appFrame);
RootLayoutPanel.get().add(viewport);
historyHandler.handleCurrentHistory();
}
use of com.google.web.bindery.event.shared.EventBus in project webprotege by protegeproject.
the class LoggedInUser_TestCase method setUp.
@Before
public void setUp() {
when(otherUserDetails.getUserId()).thenReturn(otherUserId);
when(otherUserInSession.getUserDetails()).thenReturn(otherUserDetails);
when(guestUserInSession.getUserDetails()).thenReturn(UserDetails.getGuestUserDetails());
EventBus eventBus = new SimpleEventBus();
loggedInUser = new LoggedInUser(eventBus);
eventBus.addHandler(ON_USER_LOGGED_IN, userLoggedInHandler);
eventBus.addHandler(ON_USER_LOGGED_OUT, userLoggedOutHandler);
}
use of com.google.web.bindery.event.shared.EventBus in project webprotege by protegeproject.
the class OWLEntityDescriptionBrowserPortletPresenter method startPortlet.
@Override
public void startPortlet(PortletUi portletUi, WebProtegeEventBus eventBus) {
portletUi.setWidget(new ScrollPanel(html));
eventBus.addProjectEventHandler(getProjectId(), CLASS_FRAME_CHANGED, event -> handleEntityChange(event.getEntity()));
eventBus.addProjectEventHandler(getProjectId(), ObjectPropertyFrameChangedEvent.TYPE, event -> handleEntityChange(event.getEntity()));
eventBus.addProjectEventHandler(getProjectId(), DataPropertyFrameChangedEvent.TYPE, (DataPropertyFrameChangedEventHandler) event -> handleEntityChange(event.getEntity()));
eventBus.addProjectEventHandler(getProjectId(), AnnotationPropertyFrameChangedEvent.TYPE, event -> handleEntityChange(event.getEntity()));
eventBus.addProjectEventHandler(getProjectId(), NamedIndividualFrameChangedEvent.TYPE, event -> handleEntityChange(event.getEntity()));
eventBus.addProjectEventHandler(getProjectId(), AnnotationPropertyFrameChangedEvent.TYPE, event -> handleEntityChange(event.getEntity()));
handleAfterSetEntity(getSelectedEntity());
}
Aggregations