com.google.web.bindery.event.shared.EventBus Java Examples

The following examples show how to use com.google.web.bindery.event.shared.EventBus. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ActivemqMetricPresenter.java    From core with GNU Lesser General Public License v2.1 6 votes vote down vote up
@Inject
public ActivemqMetricPresenter(
        EventBus eventBus, MyView view, MyProxy proxy,
        DispatchAsync dispatcher, Dispatcher circuit,
        ApplicationMetaData metaData, RevealStrategy revealStrategy,
        ServerStore serverStore, BeanFactory factory, PlaceManager placemanager,
        SecurityFramework securityFramework, StatementContext statementContext,
        ResourceDescriptionRegistry descriptionRegistry) {
    super(eventBus, view, proxy, circuit);

    this.dispatcher = dispatcher;
    this.revealStrategy = revealStrategy;
    this.serverStore = serverStore;
    this.placemanager = placemanager;
    this.securityFramework = securityFramework;
    this.statementContext = statementContext;
    this.descriptionRegistry = descriptionRegistry;
    this.loadJMSCmd = new LoadJMSCmd(dispatcher, factory, metaData);
}
 
Example #2
Source File: DataSourceMetricPresenter.java    From core with GNU Lesser General Public License v2.1 6 votes vote down vote up
@Inject
public DataSourceMetricPresenter(
        EventBus eventBus, MyView view, MyProxy proxy,
        DispatchAsync dispatcher, Dispatcher circuit,
        ApplicationMetaData metaData, RevealStrategy revealStrategy, StatementContext statementContext,
        ServerStore serverStore, ResourceDescriptionRegistry descriptionRegistry) {
    super(eventBus, view, proxy, circuit);

    this.dispatcher = dispatcher;
    this.revealStrategy = revealStrategy;
    this.serverStore = serverStore;
    this.descriptionRegistry = descriptionRegistry;
    this.statementContext = statementContext;

    this.loadDSCmd = new LoadDataSourceCmd(dispatcher, metaData);

}
 
Example #3
Source File: SocketBindingPresenter.java    From core with GNU Lesser General Public License v2.1 6 votes vote down vote up
@Inject
public SocketBindingPresenter(
        EventBus eventBus, MyView view, MyProxy proxy,
        PlaceManager placeManager, DispatchAsync dispatcher,
        BeanFactory factory, RevealStrategy revealStrategy,
        ApplicationMetaData propertyMetaData, Dispatcher circuit) {
    super(eventBus, view, proxy);

    this.placeManager = placeManager;
    this.dispatcher = dispatcher;
    this.factory = factory;
    this.revealStrategy = revealStrategy;
    this.metaData = propertyMetaData;
    this.circuit = circuit;

    this.entityAdapter = new EntityAdapter<SocketBinding>(SocketBinding.class, metaData);
    this.remoteSocketAdapter = new EntityAdapter<RemoteSocketBinding>(RemoteSocketBinding.class, metaData);
    this.localSocketAdapter = new EntityAdapter<LocalSocketBinding>(LocalSocketBinding.class, metaData);
    this.socketGroupAdapter = new EntityAdapter<SocketGroup>(SocketGroup.class, metaData);

    ModelNode address = new ModelNode();
    address.setEmptyList();
    loadInterfacesCmd = new LoadInterfacesCmd(dispatcher, address, metaData);
}
 
Example #4
Source File: PropertiesStrategy.java    From core with GNU Lesser General Public License v2.1 6 votes vote down vote up
PropertyEditorAdapter(final InteractionUnit<StereoTypes> interactionUnit, EventBus coordinator, final ModelNode modelDescription)
{
    this.interactionUnit = interactionUnit;
    this.coordinator = coordinator;

    DMRMapping dmrMapping = (DMRMapping)
            this.interactionUnit.findMapping(MappingType.DMR);

    ModelNode attDesc = modelDescription.get("attributes").asObject();
    if(dmrMapping.getObjects().size()>0
            && attDesc .hasDefined(dmrMapping.getObjects().get(0)))
    {
        // mapped to ModelType.Object
        objectName = dmrMapping.getObjects().get(0);
        ModelNode description = attDesc.get(objectName).asObject();
        Log.debug(description.toString());

    }
    else
    {
        Log.warn(interactionUnit.getId() + "is missing valid DMR mapping");
    }

    this.editor = new ModelNodePropertyEditor(PropertyEditorAdapter.this, true);

}
 
Example #5
Source File: JMXPresenter.java    From core with GNU Lesser General Public License v2.1 6 votes vote down vote up
@Inject
public JMXPresenter(
        EventBus eventBus, MyView view, MyProxy proxy,
        DispatchAsync dispatcher,
        StatementContext statementContext,
        RevealStrategy revealStrategy,
        ApplicationMetaData metaData, BeanFactory factory) {

    super(eventBus, view, proxy);
    this.statementContext = statementContext;

    this.revealStrategy = revealStrategy;
    this.metaData = metaData;
    this.dispatcher = dispatcher;
    this.beanMetaData = metaData.getBeanMetaData(JMXSubsystem.class);
    this.adapter = new EntityAdapter<JMXSubsystem>(JMXSubsystem.class, metaData);
    this.factory = factory;
}
 
Example #6
Source File: EditorWorkFlow.java    From proarc with GNU General Public License v3.0 6 votes vote down vote up
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);
}
 
Example #7
Source File: NavigationTracker.java    From core with GNU Lesser General Public License v2.1 6 votes vote down vote up
@Inject
public NavigationTracker(
        @GaAccount final String gaAccount,
        final EventBus eventBus, GoogleAnalytics delegate) {

    this.analytics = delegate;
    this.eventBus = eventBus;

   // if (GWT.isScript()) {
        Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() {
            @Override
            public void execute() {
                analytics.init(gaAccount);
                bind();
            }
        });
   // }
}
 
Example #8
Source File: PicketLinkFinder.java    From core with GNU Lesser General Public License v2.1 6 votes vote down vote up
@Inject
public PicketLinkFinder(final EventBus eventBus, final MyView view, final MyProxy proxy,
        final DispatchAsync dispatcher, final BootstrapContext bootstrapContext,
        final SecurityFramework securityFramework, final StatementContext statementContext,
        final ResourceDescriptionRegistry descriptionRegistry, final PlaceManager placeManager) {
    super(eventBus, view, proxy);

    this.dispatcher = dispatcher;
    this.bootstrapContext = bootstrapContext;
    this.securityContext = securityFramework.getSecurityContext(NameTokens.PicketLinkFinder);
    this.statementContext = statementContext;
    this.descriptionRegistry = descriptionRegistry;
    this.crud = new CrudOperationDelegate(statementContext, dispatcher);
    this.securityDomains = new ArrayList<>();
    this.placeManager = placeManager;
}
 
Example #9
Source File: EJB3Presenter.java    From core with GNU Lesser General Public License v2.1 6 votes vote down vote up
@Inject
public EJB3Presenter(
        EventBus eventBus, MyView view, MyProxy proxy,
        PlaceManager placeManager, RevealStrategy revealStrategy,
        DispatchAsync dispatcher, CoreGUIContext statementContext,
        SecurityFramework securityFramework, ResourceDescriptionRegistry descriptionRegistry) {
    super(eventBus, view, proxy);

    this.placeManager = placeManager;
    this.revealStrategy = revealStrategy;
    this.dispatcher = dispatcher;
    this.securityFramework = securityFramework;
    this.descriptionRegistry = descriptionRegistry;

    this.statementContext = statementContext;

    this.operationDelegate = new CrudOperationDelegate(this.statementContext, dispatcher);

}
 
Example #10
Source File: ApplicationRootView.java    From bitcoin-transaction-explorer with MIT License 6 votes vote down vote up
@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()));
}
 
Example #11
Source File: LoggerPresenter.java    From core with GNU Lesser General Public License v2.1 6 votes vote down vote up
@Inject
public LoggerPresenter(
        EventBus eventBus, MyView view, MyProxy proxy,
        PlaceManager placeManager, RevealStrategy revealStrategy,
        DispatchAsync dispatcher, CoreGUIContext statementContext,
        SecurityFramework securityFramework, ResourceDescriptionRegistry descriptionRegistry) {
    super(eventBus, view, proxy);

    this.placeManager = placeManager;
    this.revealStrategy = revealStrategy;
    this.dispatcher = dispatcher;
    this.securityFramework = securityFramework;
    this.descriptionRegistry = descriptionRegistry;

    this.statementContext =  statementContext;

    this.operationDelegate = new CrudOperationDelegate(this.statementContext, dispatcher);

}
 
Example #12
Source File: EventBinderTest.java    From gwteventbinder with Apache License 2.0 6 votes vote down vote up
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);
}
 
Example #13
Source File: MailPresenter.java    From core with GNU Lesser General Public License v2.1 6 votes vote down vote up
@Inject
public MailPresenter(EventBus eventBus, MyView view, MyProxy proxy, PlaceManager placeManager,
                     DispatchAsync dispatcher, RevealStrategy revealStrategy, ApplicationMetaData metaData,
                     BeanFactory beanFactory, final ResourceDescriptionRegistry resourceDescriptionRegistry,
        StatementContext statementContext) {

    super(eventBus, view, proxy);

    this.placeManager = placeManager;
    this.revealStrategy = revealStrategy;
    this.dispatcher = dispatcher;
    this.beanFactory = beanFactory;
    this.beanMetaData = metaData.getBeanMetaData(MailSession.class);
    this.adapter = new EntityAdapter<>(MailSession.class, metaData);
    this.serverAdapter = new EntityAdapter<>(MailServerDefinition.class, metaData);
    this.credentialReferenceAdapter = new EntityAdapter<>(CredentialReference.class, metaData);
    this.resourceDescriptionRegistry = resourceDescriptionRegistry;
    this.statementContext = statementContext;
}
 
Example #14
Source File: MasonryPresenter.java    From gwt-material-demo with Apache License 2.0 5 votes vote down vote up
@Inject
MasonryPresenter(
        EventBus eventBus,
        MyView view,
        MyProxy proxy) {
    super(eventBus, view, proxy, ApplicationPresenter.SLOT_MAIN);
}
 
Example #15
Source File: ScrollFirePresenter.java    From gwt-material-demo with Apache License 2.0 5 votes vote down vote up
@Inject
ScrollFirePresenter(
        EventBus eventBus,
        MyView view,
        MyProxy proxy) {
    super(eventBus, view, proxy, ApplicationPresenter.SLOT_MAIN);

}
 
Example #16
Source File: ConfigAdminPresenter.java    From core with GNU Lesser General Public License v2.1 5 votes vote down vote up
@Inject
public ConfigAdminPresenter(EventBus eventBus, MyView view, MyProxy proxy,
        PlaceManager placeManager, DispatchAsync dispatcher,
        BeanFactory factory, RevealStrategy revealStrategy) {
    super(eventBus, view, proxy);

    this.dispatcher = dispatcher;
    this.factory = factory;
    this.revealStrategy = revealStrategy;
}
 
Example #17
Source File: MenuBarPresenter.java    From gwt-material-demo with Apache License 2.0 5 votes vote down vote up
@Inject
MenuBarPresenter(
        EventBus eventBus,
        MyView view,
        MyProxy proxy) {
    super(eventBus, view, proxy, ApplicationPresenter.SLOT_MAIN);

}
 
Example #18
Source File: MsgDestinationsPresenter.java    From core with GNU Lesser General Public License v2.1 5 votes vote down vote up
@Inject
public MsgDestinationsPresenter(EventBus eventBus, MyView view, MyProxy proxy,
        PlaceManager placeManager, DispatchAsync dispatcher, BeanFactory factory,
        RevealStrategy revealStrategy, ApplicationMetaData propertyMetaData, Scheduler scheduler,
        SecurityFramework securityFramework, ResourceDescriptionRegistry descriptionRegistry,
        StatementContext statementContext) {
    super(eventBus, view, proxy);

    this.placeManager = placeManager;
    this.dispatcher = dispatcher;
    this.revealStrategy = revealStrategy;
    this.metaData = propertyMetaData;
    this.scheduler = scheduler;
    this.securityFramework = securityFramework;
    this.descriptionRegistry = descriptionRegistry;
    this.statementContext = statementContext;
    this.securitySettings = new ArrayList<>();

    this.providerAdapter = new EntityAdapter<>(ActivemqMessagingProvider.class, propertyMetaData);
    this.securityAdapter = new EntityAdapter<>(ActivemqSecurityPattern.class, propertyMetaData);
    this.addressingAdapter = new EntityAdapter<>(ActivemqAddressingPattern.class, propertyMetaData);

    this.divertAdapter = new EntityAdapter<>(ActivemqDivert.class, metaData);
    this.jmsQueueAdapter = new EntityAdapter<>(ActivemqJMSQueue.class, metaData);
    this.topicAdapter = new EntityAdapter<>(ActivemqJMSTopic.class, metaData);

    this.loadJMSCmd = new LoadJMSCmd(dispatcher, factory, metaData);
}
 
Example #19
Source File: IconMorphPresenter.java    From gwt-material-demo with Apache License 2.0 5 votes vote down vote up
@Inject
IconMorphPresenter(
        EventBus eventBus,
        MyView view,
        MyProxy proxy) {
    super(eventBus, view, proxy, ApplicationPresenter.SLOT_MAIN);

}
 
Example #20
Source File: CutOutsPresenter.java    From gwt-material-demo with Apache License 2.0 5 votes vote down vote up
@Inject
CutOutsPresenter(
    EventBus eventBus,
    MyView view,
    MyProxy proxy) {
    super(eventBus, view, proxy, ApplicationPresenter.SLOT_MAIN);
}
 
Example #21
Source File: CameraPresenter.java    From gwt-material-demo with Apache License 2.0 5 votes vote down vote up
@Inject
CameraPresenter(
        EventBus eventBus,
        MyView view,
        MyProxy proxy) {
    super(eventBus, view, proxy, ApplicationPresenter.SLOT_MAIN);

}
 
Example #22
Source File: EnvironmentPresenter.java    From core with GNU Lesser General Public License v2.1 5 votes vote down vote up
@Inject
public EnvironmentPresenter(final EventBus eventBus, final MyView view, final MyProxy proxy,
                            final DispatchAsync dispatcher, Dispatcher circuit, final BeanFactory factory,
                            final RevealStrategy revealStrategy) {
    super(eventBus, view, proxy, circuit);
    this.dispatcher = dispatcher;
    this.factory = factory;
    this.revealStrategy = revealStrategy;
}
 
Example #23
Source File: ElytronFactoryPresenter.java    From core with GNU Lesser General Public License v2.1 5 votes vote down vote up
@Inject
public ElytronFactoryPresenter(EventBus eventBus, ElytronFactoryPresenter.MyView view, ElytronFactoryPresenter.MyProxy proxy,
        Dispatcher circuit, RevealStrategy revealStrategy, ElytronStore store,
        SecurityFramework securityFramework, ResourceDescriptionRegistry descriptionRegistry) {
    super(eventBus, view, proxy, circuit);
    this.circuit = circuit;
    this.revealStrategy = revealStrategy;
    this.store = store;
    this.securityFramework = securityFramework;
    this.descriptionRegistry = descriptionRegistry;
}
 
Example #24
Source File: ServletPresenter.java    From core with GNU Lesser General Public License v2.1 5 votes vote down vote up
@Inject
public ServletPresenter(
        EventBus eventBus, MyView view, MyProxy proxy,
        PlaceManager placeManager, RevealStrategy revealStrategy,
        DispatchAsync dispatcher, CoreGUIContext statementContext,
        SecurityFramework securityFramework, ResourceDescriptionRegistry descriptionRegistry) {
    super(eventBus, view, proxy);

    this.placeManager = placeManager;
    this.revealStrategy = revealStrategy;
    this.dispatcher = dispatcher;
    this.securityFramework = securityFramework;
    this.descriptionRegistry = descriptionRegistry;

    this.statementContext =  new FilteringStatementContext(
            statementContext,
            new FilteringStatementContext.Filter() {
                @Override
                public String filter(String key) {
                    if ("selected.container".equals(key))
                        return currentContainer;
                    else
                        return null;
                }

                @Override
                public String[] filterTuple(String key) {
                    return null;
                }
            }
    ) {

    };

    this.operationDelegate = new CrudOperationDelegate(this.statementContext, dispatcher);

}
 
Example #25
Source File: ElytronMapperPresenter.java    From core with GNU Lesser General Public License v2.1 5 votes vote down vote up
@Inject
public ElytronMapperPresenter(EventBus eventBus, ElytronMapperPresenter.MyView view, ElytronMapperPresenter.MyProxy proxy,
        Dispatcher circuit, RevealStrategy revealStrategy, ElytronStore store,
        SecurityFramework securityFramework, ResourceDescriptionRegistry descriptionRegistry) {
    super(eventBus, view, proxy, circuit);
    this.circuit = circuit;
    this.revealStrategy = revealStrategy;
    this.store = store;
    this.securityFramework = securityFramework;
    this.descriptionRegistry = descriptionRegistry;
}
 
Example #26
Source File: HomepagePresenter.java    From core with GNU Lesser General Public License v2.1 5 votes vote down vote up
@Inject
public HomepagePresenter(final EventBus eventBus, final MyView view, final MyProxy proxy,
        final Header header, BootstrapContext bootstrapContext) {
    super(eventBus, view, proxy, MainLayoutPresenter.TYPE_MainContent);
    this.header = header;
    this.bootstrapContext = bootstrapContext;
}
 
Example #27
Source File: MediaPresenter.java    From gwt-material-demo with Apache License 2.0 5 votes vote down vote up
@Inject
MediaPresenter(
        EventBus eventBus,
        MyView view,
        MyProxy proxy) {
    super(eventBus, view, proxy, ApplicationPresenter.SLOT_MAIN);
}
 
Example #28
Source File: RepositoryView.java    From core with GNU Lesser General Public License v2.1 5 votes vote down vote up
@Inject
public RepositoryView(final EventBus eventBus, final SampleRepository sampleRepository) {
    super();
    this.sampleRepository = sampleRepository;
    this.lhsNavigation = new RepositoryNavigation();
    this.editor = new ModelEditor(eventBus);

}
 
Example #29
Source File: HostPropertiesPresenter.java    From core with GNU Lesser General Public License v2.1 5 votes vote down vote up
@Inject
public HostPropertiesPresenter(EventBus eventBus, MyView view, MyProxy proxy, Dispatcher circuit,
                               DispatchAsync dispatcher,BeanFactory factory, HostStore hostStore, CoreGUIContext statementContext) {
    super(eventBus, view, proxy, circuit);

    this.dispatcher = dispatcher;
    this.hostStore = hostStore;
    this.factory = factory;

    this.statementContext = statementContext;
}
 
Example #30
Source File: EventBinderTest.java    From gwteventbinder with Apache License 2.0 5 votes vote down vote up
public void testEventBinder_inDifferentPackage() {
  EventBus eventBus = new SimpleEventBus();
  TestPresenter presenter = new TestPresenter();
  SomeActivity.SomeEventBinder binder = GWT.create(SomeActivity.SomeEventBinder.class);
  binder.bindEventHandlers(presenter, eventBus);

  // Test one event
  assertEquals(0, presenter.firstEventsHandled);
  eventBus.fireEvent(new FirstEvent());
  assertEquals(1, presenter.firstEventsHandled);
}