use of org.gwtbootstrap3.extras.select.client.ui.Option in project kie-wb-common by kiegroup.
the class TimeZonePickerViewImpl method populateTzSelector.
void populateTzSelector() {
tzSelect.clear();
if (tzSelectType.equals(TZSelectType.COUNTRY)) {
for (int i = 0; i < zones.size(); i++) {
Option option = new Option();
option.setText(zones.get(i).name);
option.setValue(zones.get(i).offsetAsString + "");
if (new Double(zones.get(i).offsetAsDouble).equals(new Double(defaultOffset / 60))) {
option.setSelected(true);
userTimeZone = option.getValue();
}
tzSelect.add(option);
}
} else {
zones.stream().filter(distinctByKey(p -> p.offsetAsDouble)).sorted((z1, z2) -> Double.valueOf(z1.offsetAsDouble).compareTo(new Double(z2.offsetAsDouble))).collect(Collectors.toCollection(LinkedHashSet::new)).forEach(zone -> {
Option option = new Option();
option.setText(zone.offsetAsString + "");
option.setValue(zone.offsetAsString + "");
if (new Double(zone.offsetAsDouble).equals(new Double(defaultOffset / 60))) {
option.setSelected(true);
userTimeZone = option.getValue();
}
tzSelect.add(option);
});
}
tzSelect.refresh();
}
use of org.gwtbootstrap3.extras.select.client.ui.Option in project kie-wb-common by kiegroup.
the class ContainerRulesConfigView method init.
@PostConstruct
public void init() {
version.addChangeHandler(new ChangeHandler() {
@Override
public void onChange(ChangeEvent event) {
if (!version.getText().trim().isEmpty()) {
StyleHelper.addUniqueEnumStyleName(versionForm, ValidationState.class, ValidationState.NONE);
}
}
});
version.getElement().setAttribute("placeholder", getVersionTextBoxPlaceholder());
interval.addChangeHandler(new ChangeHandler() {
@Override
public void onChange(ChangeEvent event) {
if (!interval.getText().trim().isEmpty()) {
StyleHelper.addUniqueEnumStyleName(scannerForm, ValidationState.class, ValidationState.NONE);
}
}
});
interval.getElement().setAttribute("placeholder", getIntervalTextBoxPlaceholder());
interval.getElement().setAttribute("data-original-title", getIntervalTextBoxDataOriginalTitle());
Option ms = new Option();
ms.setText(translationService.format(Constants.ContainerRulesConfigView_Milliseconds));
ms.setValue(ContainerRulesConfigPresenter.MS);
ms.setSelected(true);
intervalTimeUnit.add(ms);
Option s = new Option();
s.setText(translationService.format(Constants.ContainerRulesConfigView_Seconds));
s.setValue(ContainerRulesConfigPresenter.S);
intervalTimeUnit.add(s);
Option m = new Option();
m.setText(translationService.format(Constants.ContainerRulesConfigView_Minutes));
m.setValue(ContainerRulesConfigPresenter.M);
intervalTimeUnit.add(m);
Option h = new Option();
h.setText(translationService.format(Constants.ContainerRulesConfigView_Hours));
h.setValue(ContainerRulesConfigPresenter.H);
intervalTimeUnit.add(h);
Option d = new Option();
d.setText(translationService.format(Constants.ContainerRulesConfigView_Days));
d.setValue(ContainerRulesConfigPresenter.D);
intervalTimeUnit.add(d);
}
use of org.gwtbootstrap3.extras.select.client.ui.Option in project kie-wb-common by kiegroup.
the class UIUtil method newOption.
public static Option newOption(final String text, final String value) {
final Option option = new Option();
option.setValue(value);
option.setText(text);
return option;
}
use of org.gwtbootstrap3.extras.select.client.ui.Option in project kie-wb-common by kiegroup.
the class RuleSelector method makeRuleNameOption.
Option makeRuleNameOption(final String ruleName, final String value) {
final Option o = GWT.create(Option.class);
final String simpleRuleName = getSimpleRuleName(ruleName);
o.setText(simpleRuleName);
o.setValue(value);
return o;
}
use of org.gwtbootstrap3.extras.select.client.ui.Option in project kie-wb-common by kiegroup.
the class PackageListBox method noPackage.
void noPackage() {
clearSelect();
final Option option = new Option();
option.setText(CommonConstants.INSTANCE.ItemUndefinedPath());
select.add(option);
select.setEnabled(false);
refreshSelect();
}
Aggregations