@Test public void testSetup() { final ServerTemplateKey serverTemplateKey = new ServerTemplateKey( "ServerTemplateKeyId", "ServerTemplateKeyName" ); presenter.setup( serverTemplateKey, Collections.singletonList( serverTemplateKey ) ); verify( view ).clean(); verify( view ).addTemplate( serverTemplateKey.getId(), serverTemplateKey.getName() ); }
public void setup(final ServerTemplateKey firstTemplate, final Collection<ServerTemplateKey> serverTemplateKeys) { view.clean(); serverTemplates.clear(); addTemplate(checkNotNull("serverTemplate2BeSelected", firstTemplate)); for (final ServerTemplateKey serverTemplateKey : serverTemplateKeys) { if (!serverTemplateKey.equals(firstTemplate)) { addTemplate(serverTemplateKey); } } }
ServerNavigationPresenter { public void setup(final ServerTemplateKey firstTemplate, final Collection<ServerTemplateKey> serverTemplateKeys) { view.clean(); serverTemplates.clear(); addTemplate(checkNotNull("serverTemplate2BeSelected", firstTemplate)); for (final ServerTemplateKey serverTemplateKey : serverTemplateKeys) { if (!serverTemplateKey.equals(firstTemplate)) { addTemplate(serverTemplateKey); } } } }
ServerNavigationPresenter { public void setup(final ServerTemplateKey firstTemplate, final Collection<ServerTemplateKey> serverTemplateKeys) { view.clean(); serverTemplates.clear(); addTemplate(checkNotNull("serverTemplate2BeSelected", firstTemplate)); for (final ServerTemplateKey serverTemplateKey : serverTemplateKeys) { if (!serverTemplateKey.equals(firstTemplate)) { addTemplate(serverTemplateKey); } } } @Inject  ServerNavigationPresenter(final Logger logger,
                                     final View view,
                                     final Event<AddNewServerTemplate> addNewServerTemplateEvent,
                                     final Event<ServerTemplateListRefresh> serverTemplateListRefreshEvent,
                                     final Event<ServerTemplateSelected> serverTemplateSelectedEvent); }
ServerNavigationPresenter { public void setup(final ServerTemplateKey firstTemplate, final Collection<ServerTemplateKey> serverTemplateKeys) { view.clean(); serverTemplates.clear(); addTemplate(checkNotNull("serverTemplate2BeSelected", firstTemplate)); for (final ServerTemplateKey serverTemplateKey : serverTemplateKeys) { if (!serverTemplateKey.equals(firstTemplate)) { addTemplate(serverTemplateKey); } } } @Inject  ServerNavigationPresenter(final Logger logger,
                                     final View view,
                                     final Event<AddNewServerTemplate> addNewServerTemplateEvent,
                                     final Event<ServerTemplateListRefresh> serverTemplateListRefreshEvent,
                                     final Event<ServerTemplateSelected> serverTemplateSelectedEvent); @PostConstruct void init(); View getView(); void setup(final ServerTemplateKey firstTemplate,
                      final Collection<ServerTemplateKey> serverTemplateKeys); void onSelect(@Observes final ServerTemplateSelected serverTemplateSelected); void onServerTemplateUpdated(@Observes final ServerTemplateUpdated serverTemplateUpdated); void select(final String id); void clear(); void refresh(); void newTemplate(); }
ServerNavigationPresenter { public void setup(final ServerTemplateKey firstTemplate, final Collection<ServerTemplateKey> serverTemplateKeys) { view.clean(); serverTemplates.clear(); addTemplate(checkNotNull("serverTemplate2BeSelected", firstTemplate)); for (final ServerTemplateKey serverTemplateKey : serverTemplateKeys) { if (!serverTemplateKey.equals(firstTemplate)) { addTemplate(serverTemplateKey); } } } @Inject  ServerNavigationPresenter(final Logger logger,
                                     final View view,
                                     final Event<AddNewServerTemplate> addNewServerTemplateEvent,
                                     final Event<ServerTemplateListRefresh> serverTemplateListRefreshEvent,
                                     final Event<ServerTemplateSelected> serverTemplateSelectedEvent); @PostConstruct void init(); View getView(); void setup(final ServerTemplateKey firstTemplate,
                      final Collection<ServerTemplateKey> serverTemplateKeys); void onSelect(@Observes final ServerTemplateSelected serverTemplateSelected); void onServerTemplateUpdated(@Observes final ServerTemplateUpdated serverTemplateUpdated); void select(final String id); void clear(); void refresh(); void newTemplate();  }