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

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

Introduction

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

Prototype

@Override
    public Style getStyle() 

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();//from   w  w  w  .jav a  2 s.  c  o 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.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.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 .  j ava  2 s  .  com*/
    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++;
}

From source file:org.xwiki.gwt.wysiwyg.client.plugin.font.FontFamilyPicker.java

License:Open Source License

/**
 * {@inheritDoc}/*from  w  ww  . j a v  a  2s . c o  m*/
 * 
 * @see CachedListBoxPicker#setValue(int, String)
 */
public void setValue(int index, String value) {
    super.setValue(index, value);
    OptionElement option = getSelectElement().getOptions().getItem(index);
    option.getStyle().setProperty(Style.FONT_FAMILY.getJSName(), value);
}

From source file:org.xwiki.gwt.wysiwyg.client.plugin.font.FontSizePicker.java

License:Open Source License

/**
 * {@inheritDoc}//from  w w w. j av a2s  . c  o  m
 * 
 * @see CachedListBoxPicker#setValue(int, String)
 */
public void setValue(int index, String value) {
    super.setValue(index, value);
    OptionElement option = getSelectElement().getOptions().getItem(index);
    option.getStyle().setProperty(Style.FONT_SIZE.getJSName(), value);
}