@Test public void testOnDefaultKnowledgeSessionChanged() { final KBaseModel kBaseModel = new KBaseModel(); kBaseModel.setDefault(true); knowledgeBaseItemPresenter.kBaseModel = kBaseModel; knowledgeBaseItemPresenter.onDefaultKnowledgeSessionChanged(new DefaultKnowledgeBaseChange(kBaseModel)); Assert.assertTrue(kBaseModel.isDefault()); }
public void onDefaultKnowledgeSessionChanged(@Observes final DefaultKnowledgeBaseChange event) { if (!event.getNewDefault().equals(kBaseModel)) { kBaseModel.setDefault(false); } }
KnowledgeBaseItemPresenter extends ListItemPresenter<KBaseModel, KnowledgeBasesPresenter, KnowledgeBaseItemPresenter.View> { public void onDefaultKnowledgeSessionChanged(@Observes final DefaultKnowledgeBaseChange event) { if (!event.getNewDefault().equals(kBaseModel)) { kBaseModel.setDefault(false); } } }
KnowledgeBaseItemPresenter extends ListItemPresenter<KBaseModel, KnowledgeBasesPresenter, KnowledgeBaseItemPresenter.View> { public void onDefaultKnowledgeSessionChanged(@Observes final DefaultKnowledgeBaseChange event) { if (!event.getNewDefault().equals(kBaseModel)) { kBaseModel.setDefault(false); } } @Inject  KnowledgeBaseItemPresenter(final View view,
                                      final Event<DefaultKnowledgeBaseChange> defaultKnowledgeBaseChangeEvent,
                                      final KnowledgeSessionsModal knowledgeSessionsModal,
                                      final IncludedKnowledgeBasesListPresenter includedKnowledgeBasesListPresenter,
                                      final PackageListPresenter packageListPresenter); }
KnowledgeBaseItemPresenter extends ListItemPresenter<KBaseModel, KnowledgeBasesPresenter, KnowledgeBaseItemPresenter.View> { public void onDefaultKnowledgeSessionChanged(@Observes final DefaultKnowledgeBaseChange event) { if (!event.getNewDefault().equals(kBaseModel)) { kBaseModel.setDefault(false); } } @Inject  KnowledgeBaseItemPresenter(final View view,
                                      final Event<DefaultKnowledgeBaseChange> defaultKnowledgeBaseChangeEvent,
                                      final KnowledgeSessionsModal knowledgeSessionsModal,
                                      final IncludedKnowledgeBasesListPresenter includedKnowledgeBasesListPresenter,
                                      final PackageListPresenter packageListPresenter); @Override KnowledgeBaseItemPresenter setup(final KBaseModel kBaseModel,
                                            final KnowledgeBasesPresenter parentPresenter); @Override void remove(); void onNameChange(final String name); void fireChangeEvent(); @Override KBaseModel getObject(); void addNewIncludedKnowledgeBase(); void addPackage(); void showKnowledgeSessionsModal(); void signalAddedOrRemoved(); void setDefault(final boolean isDefault); void onDefaultKnowledgeSessionChanged(@Observes final DefaultKnowledgeBaseChange event); }
KnowledgeBaseItemPresenter extends ListItemPresenter<KBaseModel, KnowledgeBasesPresenter, KnowledgeBaseItemPresenter.View> { public void onDefaultKnowledgeSessionChanged(@Observes final DefaultKnowledgeBaseChange event) { if (!event.getNewDefault().equals(kBaseModel)) { kBaseModel.setDefault(false); } } @Inject  KnowledgeBaseItemPresenter(final View view,
                                      final Event<DefaultKnowledgeBaseChange> defaultKnowledgeBaseChangeEvent,
                                      final KnowledgeSessionsModal knowledgeSessionsModal,
                                      final IncludedKnowledgeBasesListPresenter includedKnowledgeBasesListPresenter,
                                      final PackageListPresenter packageListPresenter); @Override KnowledgeBaseItemPresenter setup(final KBaseModel kBaseModel,
                                            final KnowledgeBasesPresenter parentPresenter); @Override void remove(); void onNameChange(final String name); void fireChangeEvent(); @Override KBaseModel getObject(); void addNewIncludedKnowledgeBase(); void addPackage(); void showKnowledgeSessionsModal(); void signalAddedOrRemoved(); void setDefault(final boolean isDefault); void onDefaultKnowledgeSessionChanged(@Observes final DefaultKnowledgeBaseChange event);  }