当前位置: 首页>>代码示例>>Java>>正文


Java SimpleEventBus类代码示例

本文整理汇总了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;
}
 
开发者ID:proarc,项目名称:proarc,代码行数:23,代码来源:ImportBatchItemEditor.java

示例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);
}
 
开发者ID:proarc,项目名称:proarc,代码行数:21,代码来源:EditorWorkFlow.java

示例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));
}
 
开发者ID:dharmab,项目名称:sheets,代码行数:19,代码来源:SheetsGinModule.java

示例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));
}
 
开发者ID:JornC,项目名称:bitcoin-transaction-explorer,代码行数:25,代码来源:ApplicationClientModule.java

示例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()));
}
 
开发者ID:JornC,项目名称:bitcoin-transaction-explorer,代码行数:20,代码来源:ApplicationRootView.java

示例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);
}
 
开发者ID:google,项目名称:gwteventbinder,代码行数:21,代码来源:EventBinderTest.java

示例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);
}
 
开发者ID:google,项目名称:gwteventbinder,代码行数:26,代码来源:EventBinderTest.java

示例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);
}
 
开发者ID:ronanquillevere,项目名称:GWT-Multi-Activities,代码行数:25,代码来源:MyModule.java

示例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);
}
 
开发者ID:waynedyck,项目名称:mgwt-traffic-flow,代码行数:8,代码来源:ClientFactoryImpl.java

示例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));
}
 
开发者ID:proarc,项目名称:proarc,代码行数:10,代码来源:DigitalObjectEditor.java

示例11: EventBasedWebSocketListener

import com.google.web.bindery.event.shared.SimpleEventBus; //导入依赖的package包/类
/**
 * Construct the listener using a SimpleEventBus.
 */
public EventBasedWebSocketListener()
{
  this( new SimpleEventBus() );
}
 
开发者ID:realityforge,项目名称:gwt-websockets,代码行数:8,代码来源:EventBasedWebSocketListener.java

示例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));
}
 
开发者ID:jitlogic,项目名称:zico,代码行数:8,代码来源:ClientModule.java

示例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);

}
 
开发者ID:jlSites,项目名称:funWithGwt,代码行数:16,代码来源:MvpModule.java

示例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();
}
 
开发者ID:gwtbootstrap3,项目名称:gwtbootstrap3,代码行数:15,代码来源:DefaultValidatorMixin.java

示例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);
}
 
开发者ID:burakince,项目名称:open-course-organizer,代码行数:29,代码来源:DesktopModule.java


注:本文中的com.google.web.bindery.event.shared.SimpleEventBus类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。