Search in sources :

Example 6 with Option

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();
}
Also used : LinkedHashSet(java.util.LinkedHashSet) Option(org.gwtbootstrap3.extras.select.client.ui.Option)

Example 7 with Option

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);
}
Also used : ValidationState(org.gwtbootstrap3.client.ui.constants.ValidationState) ChangeEvent(com.google.gwt.event.dom.client.ChangeEvent) ChangeHandler(com.google.gwt.event.dom.client.ChangeHandler) Option(org.gwtbootstrap3.extras.select.client.ui.Option) PostConstruct(javax.annotation.PostConstruct)

Example 8 with Option

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;
}
Also used : Option(org.gwtbootstrap3.extras.select.client.ui.Option)

Example 9 with 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;
}
Also used : Option(org.gwtbootstrap3.extras.select.client.ui.Option)

Example 10 with Option

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();
}
Also used : Option(org.gwtbootstrap3.extras.select.client.ui.Option)

Aggregations

Option (org.gwtbootstrap3.extras.select.client.ui.Option)17 QName (org.kie.workbench.common.dmn.api.property.dmn.QName)3 GWT (com.google.gwt.core.client.GWT)1 ParagraphElement (com.google.gwt.dom.client.ParagraphElement)1 ChangeEvent (com.google.gwt.event.dom.client.ChangeEvent)1 ChangeHandler (com.google.gwt.event.dom.client.ChangeHandler)1 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)1 EventBus (com.google.gwt.event.shared.EventBus)1 DOM (com.google.gwt.user.client.DOM)1 Window (com.google.gwt.user.client.Window)1 FlexTable (com.google.gwt.user.client.ui.FlexTable)1 FlexCellFormatter (com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter)1 HTML (com.google.gwt.user.client.ui.HTML)1 HasHorizontalAlignment (com.google.gwt.user.client.ui.HasHorizontalAlignment)1 HasVerticalAlignment (com.google.gwt.user.client.ui.HasVerticalAlignment)1 HorizontalPanel (com.google.gwt.user.client.ui.HorizontalPanel)1 Image (com.google.gwt.user.client.ui.Image)1 Label (com.google.gwt.user.client.ui.Label)1 Widget (com.google.gwt.user.client.ui.Widget)1 HTMLButtonElement (elemental2.dom.HTMLButtonElement)1