當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。