@Test public void setSelectedWhenKeyIsNotPresentTest() { final Map<String, Boolean> selectionMap = new HashMap<>(); selectionMap.put("archetype 1", true); selectionMap.put("archetype 2", false); doReturn(selectionMap).when(archetypePreferences).getArchetypeSelectionMap(); presenter.setSelected(createArchetypeItem(), true); verify(view, never()).setSelectionCounter(anyString()); }
public void setSelected(final ArchetypeItem archetypeItem, final boolean isSelected) { final Map<String, Boolean> selectionMap = getSelectionMap(); if (selectionMap.containsKey(archetypeItem.getArchetype().getAlias())) { getSelectionMap().put(archetypeItem.getArchetype().getAlias(), isSelected); updateSelectionCounter(); runOnChangedCallback(); } }
AbstractArchetypeTablePresenter implements ArchetypeTablePresenter,
                                                                 HasBusyIndicator { public void setSelected(final ArchetypeItem archetypeItem, final boolean isSelected) { final Map<String, Boolean> selectionMap = getSelectionMap(); if (selectionMap.containsKey(archetypeItem.getArchetype().getAlias())) { getSelectionMap().put(archetypeItem.getArchetype().getAlias(), isSelected); updateSelectionCounter(); runOnChangedCallback(); } } }
AbstractArchetypeTablePresenter implements ArchetypeTablePresenter,
                                                                 HasBusyIndicator { public void setSelected(final ArchetypeItem archetypeItem, final boolean isSelected) { final Map<String, Boolean> selectionMap = getSelectionMap(); if (selectionMap.containsKey(archetypeItem.getArchetype().getAlias())) { getSelectionMap().put(archetypeItem.getArchetype().getAlias(), isSelected); updateSelectionCounter(); runOnChangedCallback(); } } AbstractArchetypeTablePresenter(final View view,
                                           final ArchetypeListPresenter archetypeListPresenter,
                                           final BusyIndicatorView busyIndicatorView,
                                           final TranslationService ts,
                                           final AddArchetypeModalPresenter addArchetypeModalPresenter,
                                           final ArchetypePreferences archetypePreferences,
                                           final Caller<ArchetypeService> archetypeService,
                                           final PreferenceScopeFactory preferenceScopeFactory,
                                           final Promises promises); }
AbstractArchetypeTablePresenter implements ArchetypeTablePresenter,
                                                                 HasBusyIndicator { public void setSelected(final ArchetypeItem archetypeItem, final boolean isSelected) { final Map<String, Boolean> selectionMap = getSelectionMap(); if (selectionMap.containsKey(archetypeItem.getArchetype().getAlias())) { getSelectionMap().put(archetypeItem.getArchetype().getAlias(), isSelected); updateSelectionCounter(); runOnChangedCallback(); } } AbstractArchetypeTablePresenter(final View view,
                                           final ArchetypeListPresenter archetypeListPresenter,
                                           final BusyIndicatorView busyIndicatorView,
                                           final TranslationService ts,
                                           final AddArchetypeModalPresenter addArchetypeModalPresenter,
                                           final ArchetypePreferences archetypePreferences,
                                           final Caller<ArchetypeService> archetypeService,
                                           final PreferenceScopeFactory preferenceScopeFactory,
                                           final Promises promises); void onArchetypeListUpdatedEvent(@Observes final ArchetypeListUpdatedEvent event); abstract Promise<Void> makeDefaultValue(String alias,
                                                   boolean updateList); abstract Promise<Void> loadPreferences(PaginatedArchetypeList paginatedList); abstract boolean canMakeChanges(); @Override void showBusyIndicator(final String message); @Override void hideBusyIndicator(); @Override boolean isSetup(); @Override ArchetypePreferences getPreferences(); @Override boolean isEmpty(); @Override void reset(); @Override Promise<Void> setup(final boolean isRefresh,
                               final Runnable onChangedCallback); View getView(); void setCurrentPage(final int currentPage); void goToPreviousPage(); void goToNextPage(); void goToFirstPage(); void goToLastPage(); void search(final String searchText); void addArchetype(); List<String> getIncluded(); boolean isShowIncludeColumn(); boolean isShowStatusColumn(); boolean isShowDeleteAction(); boolean isShowValidateAction(); void setSelected(final ArchetypeItem archetypeItem,
                            final boolean isSelected); void updateSelectionCounter(); Promise<Void> savePreferences(final PreferenceScope scope,
                                         final boolean updateList); Promise<Void> savePreferences(final PreferenceScopeResolutionStrategyInfo strategyInfo,
                                         final boolean updateList); }
AbstractArchetypeTablePresenter implements ArchetypeTablePresenter,
                                                                 HasBusyIndicator { public void setSelected(final ArchetypeItem archetypeItem, final boolean isSelected) { final Map<String, Boolean> selectionMap = getSelectionMap(); if (selectionMap.containsKey(archetypeItem.getArchetype().getAlias())) { getSelectionMap().put(archetypeItem.getArchetype().getAlias(), isSelected); updateSelectionCounter(); runOnChangedCallback(); } } AbstractArchetypeTablePresenter(final View view,
                                           final ArchetypeListPresenter archetypeListPresenter,
                                           final BusyIndicatorView busyIndicatorView,
                                           final TranslationService ts,
                                           final AddArchetypeModalPresenter addArchetypeModalPresenter,
                                           final ArchetypePreferences archetypePreferences,
                                           final Caller<ArchetypeService> archetypeService,
                                           final PreferenceScopeFactory preferenceScopeFactory,
                                           final Promises promises); void onArchetypeListUpdatedEvent(@Observes final ArchetypeListUpdatedEvent event); abstract Promise<Void> makeDefaultValue(String alias,
                                                   boolean updateList); abstract Promise<Void> loadPreferences(PaginatedArchetypeList paginatedList); abstract boolean canMakeChanges(); @Override void showBusyIndicator(final String message); @Override void hideBusyIndicator(); @Override boolean isSetup(); @Override ArchetypePreferences getPreferences(); @Override boolean isEmpty(); @Override void reset(); @Override Promise<Void> setup(final boolean isRefresh,
                               final Runnable onChangedCallback); View getView(); void setCurrentPage(final int currentPage); void goToPreviousPage(); void goToNextPage(); void goToFirstPage(); void goToLastPage(); void search(final String searchText); void addArchetype(); List<String> getIncluded(); boolean isShowIncludeColumn(); boolean isShowStatusColumn(); boolean isShowDeleteAction(); boolean isShowValidateAction(); void setSelected(final ArchetypeItem archetypeItem,
                            final boolean isSelected); void updateSelectionCounter(); Promise<Void> savePreferences(final PreferenceScope scope,
                                         final boolean updateList); Promise<Void> savePreferences(final PreferenceScopeResolutionStrategyInfo strategyInfo,
                                         final boolean updateList);  }