private native JavaScriptObject initCodeMirrorJSO(TextAreaElement tae) /*-{ var cm = $wnd.CodeMirror.fromTextArea(tae, { mode: "xml", lineNumbers: true, lineWrapping: false, indentUnit: 4, autoCloseTags: true, foldGutter: true, gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"] }); return cm; }-*/;
@Override public int getMaxLength() { String maxLengthAtt = TextAreaElement.as(this.getElement()).getAttribute("maxLength"); if (maxLengthAtt != null && maxLengthAtt.length() > 0) { return Integer.valueOf(maxLengthAtt); } return -1; }
public void setText(String value) { if (AbstractHtmlElementView.clientSide) { TextAreaElement.as(this.getElement()).setValue(value); } else { this.setElementAttribute("value", value); } }
public void setText(String text) { if (isTextArea) { TextAreaElement.as(element).setValue(text); } else { InputElement.as(element).setValue(text); } }
public String getText() { if (isTextArea) { return TextAreaElement.as(element).getValue(); } else { return InputElement.as(element).getValue(); } }
@Override public String value () { TextAreaElement valueHolder = getWidget().getElement().getFirstChild() .getFirstChild().getNextSibling().<TextAreaElement> cast(); return valueHolder.getValue(); }
public NullableTextArea(Element elem) { super(elem); inputElem = TextAreaElement.as(elem); }
public void setRows(int rows) { this.rows = rows; TextAreaElement.as(this.getElement()).setRows(rows); }
public int setRows() { return TextAreaElement.as(this.getElement()).getRows(); }
public String getValue() { return TextAreaElement.as(this.getElement()).getValue(); }
/** * This constructor may be used by subclasses to explicitly use an existing * element. This element must be a <textarea> element. * * @param element the element to be used */ protected TextArea(final Element element) { super(element.<Element>cast()); TextAreaElement.as(element); element.addClassName(Styles.FORM_CONTROL); }
/** * Get the TextAreaElement for the widget * * @return TextAreaElement element of the widget */ private TextAreaElement getTextAreaElement() { return getElement().cast(); }