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

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

Introduction

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

Prototype

@Override
    public String getId() 

Source Link

Usage

From source file:ch.unifr.pai.twice.multipointer.client.widgets.MultiFocusTextBox.java

License:Apache License

public void replaceTextInput(InputElement el) {
    if (!el.isDisabled() && !el.getAttribute("multifocus").equals("true")) {
        replacedElement = el;//from w w w .  ja v a  2 s  .co  m
        RootPanel.get().add(this);
        setValue(el.getValue());
        currentWidth = el.getOffsetWidth();
        currentHeight = el.getOffsetHeight();
        this.getElement().getStyle().setPosition(Position.RELATIVE);
        this.getElement().getStyle().setPadding(0, Unit.PX);
        this.getElement().setId(el.getId());
        refreshDisplay();
    }
}

From source file:org.eclipse.che.ide.ext.git.client.compare.selectablechangespanel.CheckBoxRender.java

License:Open Source License

private void setCheckBoxState(Path nodePath, InputElement checkBoxInputElement) {
    if (indeterminate.contains(nodePath)) {
        checkBoxInputElement.setId(checkBoxInputElement.getId() + "-indeterminate");
        setIndeterminate(checkBoxInputElement);
    } else if (!unselected.contains(nodePath)) {
        checkBoxInputElement.setChecked(true);
        checkBoxInputElement.setId(checkBoxInputElement.getId() + "-checked");
    } else {/*from w  ww . java2s.co m*/
        checkBoxInputElement.setId(checkBoxInputElement.getId() + "-unchecked");
    }
}

From source file:rocket.widget.client.RadioButton.java

License:Apache License

/**
 * Replace the current input element with a new one.
 * //from w  ww.ja v a2  s  .co  m
 * @param newElement
 *            the new input element
 */
protected void replaceInputElement(final Element newElement) {
    // Collect information we need to set

    final InputElement oldInputElement = this.getElement().cast();

    int tabIndex = getTabIndex();
    boolean checked = isChecked();
    boolean enabled = isEnabled();
    String uid = oldInputElement.getId();
    String accessKey = oldInputElement.getAccessKey();

    // Clear out the old input element
    setChecked(false);
    oldInputElement.setId("");
    oldInputElement.setAccessKey("");

    // Quickly do the actual replace
    final Element parent = oldInputElement.getParentElement().cast();
    final int index = DOM.getChildIndex(parent, (Element) oldInputElement.cast());
    parent.removeChild(oldInputElement);
    DOM.insertChild(parent, (Element) newElement.cast(), index);
    this.invokeReplaceElement(newElement);

    // Setup the new element
    DOM.sinkEvents((Element) oldInputElement.cast(), DOM.getEventsSunk(this.getElement()));
    DOM.setEventListener((Element) oldInputElement.cast(), this);
    oldInputElement.setId(uid);
    if (accessKey != "") {
        oldInputElement.setAccessKey(accessKey);
    }
    setTabIndex(tabIndex);
    setChecked(checked);
    setEnabled(enabled);
}