Example usage for com.google.gwt.dom.client OptionElement getClassName

List of usage examples for com.google.gwt.dom.client OptionElement getClassName

Introduction

In this page you can find the example usage for com.google.gwt.dom.client OptionElement getClassName.

Prototype

@Override
    public String getClassName() 

Source Link

Usage

From source file:com.arcbees.chosen.client.SelectParser.java

License:Apache License

private void addOption(OptionElement option, int groupPosition, boolean groupDisabled) {
    String optionText = option.getText();

    OptionItem item = new OptionItem();
    item.arrayIndex = parsed.size();/*  w ww .  j  a va  2 s .c  om*/
    item.optionsIndex = optionsIndex;

    if (optionText != null && optionText.length() > 0) {

        if (groupPosition != -1) {
            ((GroupItem) parsed.get(groupPosition)).children++;
        }

        item.value = option.getValue();

        item.text = option.getLabel();
        if (isNullOrEmpty(item.text)) {
            item.text = option.getText();
        }

        item.html = option.getInnerHTML();
        item.selected = option.isSelected();
        item.disabled = groupDisabled ? groupDisabled : option.isDisabled();
        item.groupArrayIndex = groupPosition;
        item.classes = option.getClassName();
        item.style = getCssText(option.getStyle());
        item.empty = false;

    } else {
        item.empty = true;
        item.groupArrayIndex = -1;
    }

    parsed.add(item);
    optionsIndex++;
}

From source file:com.bearsoft.gwt.ui.widgets.StyledListBox.java

public String getItemStyleName(int aIndex) {
    checkIndex(aIndex);/*ww w .j a  va2 s  .c om*/
    OptionElement option = getElement().<SelectElement>cast().getOptions().getItem(aIndex);
    return option.getClassName();
}

From source file:com.watopi.chosen.client.SelectParser.java

License:Open Source License

private void addOption(OptionElement option, int groupPosition, boolean groupDisabled) {
    String optionText = option.getText();

    OptionItem item = new OptionItem();
    item.arrayIndex = parsed.length();/*from   ww w.ja  va  2s  .co m*/
    item.optionsIndex = optionsIndex;

    if (optionText != null && optionText.length() > 0) {

        if (groupPosition != -1) {
            ((GroupItem) parsed.get(groupPosition)).children++;
        }

        item.value = option.getValue();
        item.text = option.getText();
        item.html = option.getInnerHTML();
        item.selected = option.isSelected();
        item.disabled = groupDisabled ? groupDisabled : option.isDisabled();
        item.groupArrayIndex = groupPosition;
        item.classes = option.getClassName();
        item.style = getCssText(option.getStyle());
        item.empty = false;

    } else {
        item.empty = true;
        item.groupArrayIndex = -1;

    }

    parsed.add(item);
    optionsIndex++;
}