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

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

Introduction

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

Prototype

public void setReadOnly(boolean readOnly) 

Source Link

Document

This control is read-only.

Usage

From source file:com.cgxlib.xq.client.plugins.widgets.TextBoxBaseWidgetFactory.java

License:Apache License

protected void copyAttributes(Element src, Element dest) {
    InputElement source = src.cast();//from ww  w .j a  v a 2 s .  com
    InputElement destination = dest.cast();

    destination.setAccessKey(source.getAccessKey());
    destination.setDefaultValue(source.getDefaultValue());
    destination.setDisabled(source.isDisabled());
    if (source.getMaxLength() > 0)
        destination.setMaxLength(source.getMaxLength());
    destination.setReadOnly(source.isReadOnly());
    destination.setSize(source.getSize());
    destination.setName(source.getName());
    destination.setValue(source.getValue());
}

From source file:com.sencha.gxt.cell.core.client.form.TriggerFieldCell.java

License:sencha.com license

public void setEditable(XElement parent, boolean editable) {
    this.editable = editable;

    getAppearance().setEditable(parent, editable);

    InputElement inputElem = getAppearance().getInputElement(parent).cast();
    if (!isReadOnly()) {
        inputElem.setReadOnly(!editable);
    }/*from   ww w .ja  v a 2s . c o  m*/
}

From source file:gwtquery.plugins.enhance.client.gwt.TextBoxBaseWidgetFactory.java

License:Apache License

protected void copyAttributes(Element src, Element dest) {
    InputElement source = src.cast();/* w  w w  . j  ava2  s  .c  o m*/
    InputElement destination = dest.cast();

    destination.setAccessKey(source.getAccessKey());
    destination.setDefaultValue(source.getDefaultValue());
    destination.setDisabled(source.isDisabled());
    if (source.getMaxLength() > 0)
        destination.setMaxLength(source.getMaxLength());
    destination.setReadOnly(source.isReadOnly());
    destination.setSize(source.getSize());
    destination.setName(source.getName());
    destination.setValue(source.getValue());

}

From source file:ru.codeinside.gses.vaadin.client.VJsonFormIntegration.java

License:Mozilla Public License

private Frame createFrameWrap() {
    if (browserElement == null) {
        return null;
    }//from   ww w  . java  2s .c o m
    Frame frameWrap = Frame.wrap(browserElement);
    frameWrap.addLoadHandler(new LoadHandler() {
        @Override
        public void onLoad(LoadEvent event) {
            Scheduler.get().scheduleFixedDelay(new Scheduler.RepeatingCommand() {
                @Override
                public boolean execute() {
                    IFrameElement formFrame = IFrameElement.as(browserElement);
                    Document formDoc = formFrame.getContentDocument();
                    if (formDoc == null) {
                        return true;
                    }
                    NodeList<com.google.gwt.dom.client.Element> elements;
                    elements = formDoc.getElementsByTagName("input");
                    for (int i = 0; i < elements.getLength(); i++) {
                        InputElement input = InputElement.as(elements.getItem(i));
                        if ("button".equalsIgnoreCase(input.getType())) {
                            input.setDisabled(true);
                        } else {
                            input.setReadOnly(true);
                        }
                    }
                    elements = formDoc.getElementsByTagName("button");
                    for (int i = 0; i < elements.getLength(); i++) {
                        ButtonElement button = ButtonElement.as(elements.getItem(i));
                        button.setDisabled(true);
                    }
                    elements = formDoc.getElementsByTagName("select");
                    for (int i = 0; i < elements.getLength(); i++) {
                        SelectElement select = SelectElement.as(elements.getItem(i));
                        select.setDisabled(true);
                    }
                    elements = formDoc.getElementsByTagName("textarea");
                    for (int i = 0; i < elements.getLength(); i++) {
                        TextAreaElement textArea = TextAreaElement.as(elements.getItem(i));
                        textArea.setReadOnly(true);
                    }
                    return false;
                }
            }, 99);
        }
    });
    return frameWrap;
}