@Before public void setUp() throws Exception { EventBus eventBus = new SimpleEventBus(); eventHandler = new EventCollectingAppRegistryEventHandler(); eventBus.addHandler(AppRegistryEvent.class, eventHandler); appDescriptorRegistry = new AppDescriptorRegistry(eventBus); TypeMappingImpl typeMapping = new TypeMappingImpl(); Node2BeanTransformerImpl transformer = new Node2BeanTransformerImpl(new PreConfiguredBeanUtils()); ComponentsTestUtil.setInstance( Node2BeanProcessor.class, new Node2BeanProcessorImpl(typeMapping, transformer)); ComponentsTestUtil.setImplementation(AppDescriptor.class, ConfiguredAppDescriptor.class); }
@Inject public SampleMainSubApp( final SubAppContext subAppContext, @Named(AppEventBus.NAME) EventBus appEventBus, SampleMainView sampleMainView, NavigationPresenter navigationPresenter, final ContentDisplayPresenter contentDisplayPresenter) { super(subAppContext, sampleMainView); this.sampleMainView = sampleMainView; this.contentDisplayPresenter = contentDisplayPresenter; this.navigationPresenter = navigationPresenter; appEventBus.addHandler( ContentItemSelectedEvent.class, new ContentItemSelectedEvent.Handler() { @Override public void onContentItemSelected(String name) { contentDisplayPresenter.setResourceToDisplay(name); } }); }