Example usage for com.google.gwt.dom.client InputElement removeAttribute

List of usage examples for com.google.gwt.dom.client InputElement removeAttribute

Introduction

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

Prototype

@Override
    public void removeAttribute(String name) 

Source Link

Usage

From source file:org.eclipse.che.ide.ui.listbox.CustomComboBox.java

License:Open Source License

/**
 * Inserts an item into the list box./*from   ww w.ja v  a  2  s  . com*/
 *
 * @param item
 *         the text of the item to be inserted.
 * @param value
 *         the item's value.
 */
public void insertItem(String item, String value) {
    //create new widget
    final RadioButton radioButton = new RadioButton(optionsGroupName, item);
    //remove the default gwt-RadioButton style
    radioButton.removeStyleName("gwt-RadioButton");
    //set value
    final InputElement inputElement = (InputElement) radioButton.getElement().getElementsByTagName("input")
            .getItem(0);
    inputElement.removeAttribute("tabindex");
    inputElement.setAttribute("value", value);
    //set default state
    if (defaultSelectedIndex > -1 && optionsPanel.getElement().getChildCount() == defaultSelectedIndex) {
        inputElement.setChecked(true);
        currentInputElement.setValue("");
    }
    //add to widget
    optionsPanel.add(radioButton);
}

From source file:org.eclipse.che.ide.ui.listbox.CustomListBox.java

License:Open Source License

/**
 * Inserts an item into the list box.//from   w  w  w .  ja v  a2 s .c  om
 *
 * @param item
 *         the text of the item to be inserted.
 * @param value
 *         the item's value.
 */
public void insertItem(String item, String value) {
    //create new widget
    final RadioButton radioButton = new RadioButton(optionsGroupName, item);
    //remove the default gwt-RadioButton style
    radioButton.removeStyleName("gwt-RadioButton");
    //set value
    final InputElement inputElement = (InputElement) radioButton.getElement().getElementsByTagName("input")
            .getItem(0);
    inputElement.removeAttribute("tabindex");
    inputElement.setAttribute("value", value);
    //set default state
    if (defaultSelectedIndex > -1 && optionsPanel.getElement().getChildCount() == defaultSelectedIndex) {
        inputElement.setChecked(true);
        currentItemLabel.setInnerText(item);
    }
    //add to widget
    optionsPanel.add(radioButton);
}

From source file:org.opencms.gwt.client.ui.input.upload.CmsFileInputFileApiImpl.java

License:Open Source License

/**
 * @see org.opencms.gwt.client.ui.input.upload.I_CmsFileInputService#setAllowMultipleFiles(com.google.gwt.dom.client.InputElement, boolean)
 *///w  w  w  .  j a  v a2 s.  co m
public void setAllowMultipleFiles(InputElement inputElement, boolean allow) {

    if (allow) {
        inputElement.setAttribute("multiple", "");
    } else {
        inputElement.removeAttribute("multiple");
    }
}