use of elemental2.dom.HTMLOptionElement in project kie-wb-common by kiegroup.
the class TimeSelectorView method populateTimeZoneSelectorWithIds.
void populateTimeZoneSelectorWithIds() {
RemoveHelper.removeChildren(timeZoneSelector);
timeZoneSelector.appendChild(createNoneOption());
for (int i = 0; i < getTimeZones().size(); i++) {
final DMNSimpleTimeZone timeZone = getTimeZones().get(i);
final HTMLOptionElement option = createOptionWithId(timeZone);
timeZoneSelector.appendChild(option);
}
setPickerValue(getSelectPicker(), getTimeZoneSelectedValue());
timeZoneSelectorRefresh();
}
use of elemental2.dom.HTMLOptionElement in project kie-wb-common by kiegroup.
the class TimeSelectorView method createOptionWithId.
HTMLOptionElement createOptionWithId(final DMNSimpleTimeZone timeZone) {
final String timeZoneId = timeZone.getId();
final HTMLOptionElement option = getNewOption();
option.value = timeZoneId;
option.text = timeZoneId;
return option;
}
use of elemental2.dom.HTMLOptionElement in project kie-wb-common by kiegroup.
the class TimeSelectorView method populateTimeZoneSelectorWithOffSets.
void populateTimeZoneSelectorWithOffSets() {
final List<String> offSets = timeZoneProvider.getTimeZonesOffsets();
RemoveHelper.removeChildren(timeZoneSelector);
timeZoneSelector.appendChild(createNoneOption());
for (int i = 0; i < offSets.size(); i++) {
final HTMLOptionElement option = createOptionWithOffset(offSets.get(i));
timeZoneSelector.appendChild(option);
}
setPickerValue(getSelectPicker(), getTimeZoneSelectedValue());
timeZoneSelectorRefresh();
}
use of elemental2.dom.HTMLOptionElement in project kie-wb-common by kiegroup.
the class TimeSelectorView method createNoneOption.
HTMLOptionElement createNoneOption() {
final HTMLOptionElement none = getNewOption();
none.text = translationService.getValue(NONE_TRANSLATION_KEY);
none.value = NONE_VALUE;
return none;
}
use of elemental2.dom.HTMLOptionElement in project kie-wb-common by kiegroup.
the class TimeSelectorViewTest method testCreateOptionWithId.
@Test
public void testCreateOptionWithId() {
final String optionId = "some id";
final HTMLOptionElement option = new HTMLOptionElement();
final DMNSimpleTimeZone tz = new DMNSimpleTimeZone();
tz.setId(optionId);
doReturn(option).when(view).getNewOption();
view.createOptionWithId(tz);
assertEquals(optionId, option.value);
assertEquals(optionId, option.text);
}
Aggregations