@Test public void testSetTimeCycleLanguageOptions() { final List<Option> generatedOptions = new ArrayList<>(); Supplier<Option> optionSupplier = () -> { Option option = mock(Option.class); generatedOptions.add(option); return option; }; List<Pair<String, String>> options = new ArrayList<>(); options.add(Pair.newPair("option1Desc", "option1Value")); options.add(Pair.newPair("option2Desc", "option2Value")); view.setOptionSupplier(optionSupplier); view.setTimeCycleLanguageOptions(options, "selectedValue"); assertEquals(options.size(), generatedOptions.size()); for (int i = 0; i < options.size(); i++) { verify(generatedOptions.get(i)).setTextContent(options.get(i).getK1()); verify(generatedOptions.get(i)).setValue(options.get(i).getK2()); } timeCycleLanguage.setValue("selectedValue"); }
@Override public void setTimeCycleLanguageOptions(List<Pair<String, String>> options, String selectedValue) { options.forEach(option -> timeCycleLanguage.add(newOption(option.getK1(), option.getK2()))); timeCycleLanguage.setValue(selectedValue); }
TimerSettingsFieldEditorView implements IsElement,
                   TimerSettingsFieldEditorPresenter.View { @Override public void setTimeCycleLanguageOptions(List<Pair<String, String>> options, String selectedValue) { options.forEach(option -> timeCycleLanguage.add(newOption(option.getK1(), option.getK2()))); timeCycleLanguage.setValue(selectedValue); } }
TimerSettingsFieldEditorView implements IsElement,
                   TimerSettingsFieldEditorPresenter.View { @Override public void setTimeCycleLanguageOptions(List<Pair<String, String>> options, String selectedValue) { options.forEach(option -> timeCycleLanguage.add(newOption(option.getK1(), option.getK2()))); timeCycleLanguage.setValue(selectedValue); }  }
TimerSettingsFieldEditorView implements IsElement,
                   TimerSettingsFieldEditorPresenter.View { @Override public void setTimeCycleLanguageOptions(List<Pair<String, String>> options, String selectedValue) { options.forEach(option -> timeCycleLanguage.add(newOption(option.getK1(), option.getK2()))); timeCycleLanguage.setValue(selectedValue); }  @Override void init(TimerSettingsFieldEditorPresenter presenter); @PostConstruct void init(); @Override void setTimeDuration(String timeDuration); @Override String getTimeDuration(); @Override void setTimeDate(String timeDate); @Override String getTimeDate(); @Override Date getTimeDateTimePickerValue(); @Override void setTimeCycle(String timeCycle); @Override String getTimeCycle(); @Override void setTimeCycleLanguage(String timeCycleLanguage); @Override String getTimeCycleLanguage(); @Override void setTimeCycleLanguageOptions(List<Pair<String, String>> options,
                                            String selectedValue); @Override void setMultipleTimerChecked(boolean value); @Override void setDurationTimerChecked(boolean value); @Override void setDateTimerChecked(boolean value); @Override void showMultipleTimerParams(boolean show); @Override void showDurationTimerParams(boolean show); @Override void showDateTimerParams(boolean show); @Override void showTimeDate(boolean show); @Override void showTimeDateTimePicker(boolean show); @Override void setTimeDateTimePickerValue(String value); @Override void setTimeDateTimePickerValue(Date value); @Override void clear(); @Override Date parseFromISO(final String value); @Override String formatToISO(final Date value); @Override void setReadOnly(final boolean readOnly); }
TimerSettingsFieldEditorView implements IsElement,
                   TimerSettingsFieldEditorPresenter.View { @Override public void setTimeCycleLanguageOptions(List<Pair<String, String>> options, String selectedValue) { options.forEach(option -> timeCycleLanguage.add(newOption(option.getK1(), option.getK2()))); timeCycleLanguage.setValue(selectedValue); }  @Override void init(TimerSettingsFieldEditorPresenter presenter); @PostConstruct void init(); @Override void setTimeDuration(String timeDuration); @Override String getTimeDuration(); @Override void setTimeDate(String timeDate); @Override String getTimeDate(); @Override Date getTimeDateTimePickerValue(); @Override void setTimeCycle(String timeCycle); @Override String getTimeCycle(); @Override void setTimeCycleLanguage(String timeCycleLanguage); @Override String getTimeCycleLanguage(); @Override void setTimeCycleLanguageOptions(List<Pair<String, String>> options,
                                            String selectedValue); @Override void setMultipleTimerChecked(boolean value); @Override void setDurationTimerChecked(boolean value); @Override void setDateTimerChecked(boolean value); @Override void showMultipleTimerParams(boolean show); @Override void showDurationTimerParams(boolean show); @Override void showDateTimerParams(boolean show); @Override void showTimeDate(boolean show); @Override void showTimeDateTimePicker(boolean show); @Override void setTimeDateTimePickerValue(String value); @Override void setTimeDateTimePickerValue(Date value); @Override void clear(); @Override Date parseFromISO(final String value); @Override String formatToISO(final Date value); @Override void setReadOnly(final boolean readOnly);  }