本文整理汇总了Java中com.google.web.bindery.event.shared.SimpleEventBus类的典型用法代码示例。如果您正苦于以下问题:Java SimpleEventBus类的具体用法?Java SimpleEventBus怎么用?Java SimpleEventBus使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SimpleEventBus类属于com.google.web.bindery.event.shared包,在下文中一共展示了SimpleEventBus类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initDigitalObjectEditor
import com.google.web.bindery.event.shared.SimpleEventBus; //导入依赖的package包/类
private Canvas initDigitalObjectEditor(DigitalObjectEditor childEditor, SimpleEventBus eventBus) {
childEditor.setImportView(true);
RelationDataSource relationDataSource = RelationDataSource.getInstance();
relationDataSource.addRelationChangeHandler(new RelationChangeHandler() {
@Override
public void onRelationChange(RelationChangeEvent event) {
// issue 262: isVisible seems to be always true and isAttached is always null.
// Add test isDrawn that seems to change for dettached widgets.
if (batchItemGrid.isVisible() && batchItemGrid.isDrawn()) {
updateCache();
}
}
});
ActivityManager activityManager = new ActivityManager(
new ChildActivities(childEditor), eventBus);
VLayout editorsLayout = new VLayout();
editorsLayout.addStyleName("defaultBorder");
activityManager.setDisplay(new ChildEditorDisplay(editorsLayout));
return editorsLayout;
}
示例2: EditorWorkFlow
import com.google.web.bindery.event.shared.SimpleEventBus; //导入依赖的package包/类
public EditorWorkFlow(EventBus ebus, PlaceController placeController,
ActivityManager activityManager, Layout delegate,
PresenterFactory presenterFactory, ClientMessages i18n) {
this.presenterFactory = presenterFactory;
this.i18n = i18n;
this.ebus = (ebus != null) ? ebus : new SimpleEventBus();
// PlaceController uses delegate to ask user with blocking Window.confirm
// whether to leave the current place.
// In order to use non blocking SmartGWT dialog
// it will be necessary to override PlaceController.goto method.
this.placeController = (placeController != null) ? placeController
: new PlaceController(this.ebus);
this.activityManager = (activityManager != null) ? activityManager
: new ActivityManager(new EditorActivityMapper(), this.ebus);
this.activityManager.setDisplay(new EditorDisplay(delegate));
EditorPlaceHistoryMapper historyMapper = GWT.create(EditorPlaceHistoryMapper.class);
placeHistoryHandler = new PlaceHistoryHandler(historyMapper);
placeHistoryHandler.register(this.placeController, this.ebus, Place.NOWHERE);
}
示例3: configure
import com.google.web.bindery.event.shared.SimpleEventBus; //导入依赖的package包/类
@Override
protected void configure() {
bind(EventBus.class).to(SimpleEventBus.class).asEagerSingleton();
bind(ActivityMapper.class).to(AppActivityMapper.class).asEagerSingleton();
// Views (singletons due to expense of construction)
bind(WelcomeView.class).to(WelcomeViewImpl.class).asEagerSingleton();
bind(CharacterView.class).to(CharacterViewImpl.class).asEagerSingleton();
// Factories for presenters
install(new GinFactoryModuleBuilder()
.implement(CharacterPresenter.class, CharacterActivity.class)
.build(CharacterPresenterFactory.class));
install(new GinFactoryModuleBuilder()
.implement(WelcomePresenter.class, WelcomeActivity.class)
.build(WelcomePresenterFactory.class));
}
示例4: configure
import com.google.web.bindery.event.shared.SimpleEventBus; //导入依赖的package包/类
@Override
protected void configure() {
// Binding application critical architecture
bind(ActivityMapper.class).to(ApplicationActivityMapper.class).in(Singleton.class);;
bind(Place.class).annotatedWith(DefaultPlace.class).to(StartupPlace.class).in(Singleton.class);
bind(PlaceController.class).to(ApplicationPlaceController.class).in(Singleton.class);
bind(BitcoinPlaceRouter.class).to(ApplicationPlaceController.class).in(Singleton.class);
bind(PlaceHistoryMapper.class).to(ApplicationPlaceHistoryMapper.class).in(Singleton.class);
bind(EventBus.class).to(SimpleEventBus.class).in(Singleton.class);
bind(ColorPicker.class).to(SimpleColorPicker.class).in(Singleton.class);
// Binding views
bind(StartupView.class).to(StartupViewImpl.class).in(Singleton.class);
bind(TransactionView.class).to(TransactionViewImpl.class);
bind(BlockView.class).to(BlockViewImpl.class);
bind(MineView.class).to(MineViewImpl.class);
bind(ScriptView.class).to(ScriptViewImpl.class);
bind(ConfigView.class).to(ConfigViewImpl.class);
bind(ContributeView.class).to(ContributeViewImpl.class);
bind(RPCResponseView.class).to(RPCResponseViewImpl.class);
bind(AddressView.class).to(AddressViewImpl.class);
install(new GinFactoryModuleBuilder().build(ActivityFactory.class));
}
示例5: ApplicationRootView
import com.google.web.bindery.event.shared.SimpleEventBus; //导入依赖的package包/类
@Inject
public ApplicationRootView(final PlaceHistoryMapper historyMapper, final PlaceController placeController, final UserApplicationConfig appConfig,
NotificationPanel notificationPanel, ThemeSwitcher themeSwitcher) {
this.placeController = placeController;
this.notificationPanel = notificationPanel;
this.themeSwitcher = themeSwitcher;
EventBus simpleEventBus = new SimpleEventBus();
notificationPanel.setEventBus(simpleEventBus);
NotificationUtil.setEventBus(simpleEventBus);
initWidget(UI_BINDER.createAndBindUi(this));
applicationTitle.setText(appConfig.getApplicationTitle());
applicationSubTitle.setText(appConfig.getApplicationSubTitle());
contributeLink.setHref("#" + historyMapper.getToken(new ContributePlace()));
}
示例6: testEventBinder
import com.google.web.bindery.event.shared.SimpleEventBus; //导入依赖的package包/类
public void testEventBinder() {
EventBus eventBus = new SimpleEventBus();
TestPresenter presenter = new TestPresenter();
TestPresenter.MyEventBinder binder = GWT.create(TestPresenter.MyEventBinder.class);
binder.bindEventHandlers(presenter, eventBus);
// Test one event
assertEquals(0, presenter.firstEventsHandled);
eventBus.fireEvent(new FirstEvent());
assertEquals(1, presenter.firstEventsHandled);
assertEquals(1, presenter.firstEventsWithoutParameterHandled);
assertEquals(1, presenter.firstAndSecondEventsHandled);
// Test another event twice
assertEquals(0, presenter.secondEventsHandled);
eventBus.fireEvent(new SecondEvent());
eventBus.fireEvent(new SecondEvent());
assertEquals(2, presenter.secondEventsHandled);
assertEquals(3, presenter.firstAndSecondEventsHandled);
}
示例7: testEventBinder_withHandlersInSuperclass
import com.google.web.bindery.event.shared.SimpleEventBus; //导入依赖的package包/类
public void testEventBinder_withHandlersInSuperclass() {
EventBus eventBus = new SimpleEventBus();
SubPresenter presenter = new SubPresenter();
SubPresenter.MyEventBinder binder = GWT.create(SubPresenter.MyEventBinder.class);
binder.bindEventHandlers(presenter, eventBus);
eventBus.fireEvent(new FirstEvent());
eventBus.fireEvent(new SecondEvent());
eventBus.fireEvent(new ThirdEvent());
// FirstEvent has a handler in both classes, so it should be handled twice
assertEquals(1, presenter.firstEventsHandled);
assertEquals(1, presenter.firstEventsWithoutParameterHandled);
assertEquals(1, presenter.subclassFirstEventsHandled);
// SecondEvent's handler is overridden in the subclass, so it should only be handled there
assertEquals(0, presenter.secondEventsHandled);
assertEquals(1, presenter.subclassSecondEventsHandled);
// ThirdEvent is only handled in the superclass
assertEquals(1, presenter.thirdEventsHandled);
// First+Second events are handled in superclass
assertEquals(2, presenter.firstAndSecondEventsHandled);
}
示例8: configure
import com.google.web.bindery.event.shared.SimpleEventBus; //导入依赖的package包/类
@Override
protected void configure()
{
// Views
bind(RootView.class).to(RootViewImpl.class).in(Singleton.class);
bind(RegionContainer.class).to(SimpleLayoutPanelRegionContainer.class);
bind(NorthView1.class).to(NothView1Impl.class);
bind(WestView.class).to(WestViewImpl.class);
// Presenters
bind(RootView.Presenter.class).to(RootPresenter.class).in(Singleton.class);
bind(AppPlaceHistoryMapper.class);
bind(PlaceControllerHolder.class).in(Singleton.class);
bind(EventBus.class).to(SimpleEventBus.class);
bind(NorthPlaceToActivityVisitor.class);
bind(NorthActivityForPlace1.class);
bind(WestPlaceToActivityVisitor.class);
// Make this activity a singleton to always use the same activity in west region
bind(WestSingletonActivity.class).in(Singleton.class);
}
示例9: ClientFactoryImpl
import com.google.web.bindery.event.shared.SimpleEventBus; //导入依赖的package包/类
public ClientFactoryImpl() {
eventBus = new SimpleEventBus();
placeController = new PlaceController(eventBus);
seattleView = new SeattleViewGwtImpl();
swipeMenu = new SwipeMenu();
dbService = GWT.create(TrafficFlowDataService.class);
}
示例10: OptionalEditor
import com.google.web.bindery.event.shared.SimpleEventBus; //导入依赖的package包/类
private OptionalEditor(ClientMessages i18n, Layout previewContainer) {
SimpleEventBus eventBus = new SimpleEventBus();
embeddedPlaces = new PlaceController(eventBus);
DigitalObjectEditor embeddedEditor = new DigitalObjectEditor(i18n, embeddedPlaces, true);
embeddedEditor.setOptionalView(true);
ActivityManager activityManager = new ActivityManager(
new ChildActivities(embeddedEditor), eventBus);
activityManager.setDisplay(new ChildEditorDisplay(previewContainer));
}
示例11: EventBasedWebSocketListener
import com.google.web.bindery.event.shared.SimpleEventBus; //导入依赖的package包/类
/**
* Construct the listener using a SimpleEventBus.
*/
public EventBasedWebSocketListener()
{
this( new SimpleEventBus() );
}
示例12: configure
import com.google.web.bindery.event.shared.SimpleEventBus; //导入依赖的package包/类
@Override
protected void configure() {
bind(EventBus.class).to(SimpleEventBus.class);
bind(Shell.class).in(Singleton.class);
bind(MessageDisplay.class).to(StatusBar.class).in(Singleton.class);
install(new GinFactoryModuleBuilder().build(PanelFactory.class));
}
示例13: configure
import com.google.web.bindery.event.shared.SimpleEventBus; //导入依赖的package包/类
@Override
protected void configure() {
bind(EventBus.class).to(SimpleEventBus.class).in(Singleton.class);
// PlaceHistoryMapper instantiate new places based on the browser URL.
// You
// only need one of those for the entire app.
bind(PlaceHistoryMapper.class).to(ApplicationPlaceHistoryMapper.class)
.in(Singleton.class);
// / ActivityMapper maps the place to a new activity instance.
// You should have one activity mapper for each display area.
bind(ActivityMapper.class).to(ActivityMapperImpl.class).in(
Singleton.class);
}
示例14: DefaultValidatorMixin
import com.google.web.bindery.event.shared.SimpleEventBus; //导入依赖的package包/类
/**
* Instantiates a new abstract validator mixin.
*
* @param inputWidget the input widget
* @param errorHandler the error handler
*/
public DefaultValidatorMixin(W inputWidget, ErrorHandler errorHandler) {
this.inputWidget = inputWidget;
this.errorHandler = errorHandler;
eventBus = new SimpleEventBus();
setupBlurValidation();
setupValueChangeValidation();
}
示例15: configure
import com.google.web.bindery.event.shared.SimpleEventBus; //导入依赖的package包/类
@Override
protected void configure() {
bind(App.class).to(DesktopApp.class).in(Singleton.class);
bind(EventBus.class).to(SimpleEventBus.class).asEagerSingleton();
bind(PlaceController.class).toProvider(PlaceControllerProvider.class).in(Singleton.class);
install(new GinFactoryModuleBuilder().build(AppActivityMapper.Factory.class));
bind(ActivityMapper.class).to(AppActivityMapper.class).in(Singleton.class);
bind(PlaceHistoryMapper.class).to(AppPlaceHistoryMapper.class).in(Singleton.class);
bind(AppRequestFactory.class).toProvider(AppRequestFactoryProvider.class).in(Singleton.class);
bind(Messages.class).in(Singleton.class);
bind(Constants.class).in(Singleton.class);
// Views
bind(ShellDisplay.class).to(ShellView.class).asEagerSingleton();
bind(EventsDisplay.class).to(EventsView.class).asEagerSingleton();
bind(EventDetailDisplay.class).to(EventDetailView.class).asEagerSingleton();
bind(SubjectDisplay.class).to(SubjectView.class).asEagerSingleton();
// Presenters
bind(ShellDisplay.Presenter.class).to(ShellPresenter.class).in(Singleton.class);
bind(EventsDisplay.Presenter.class).to(EventsPresenter.class);
bind(EventDetailDisplay.Presenter.class).to(EventDetailPresenter.class);
bind(SubjectDisplay.Presenter.class).to(SubjectPresenter.class);
}