@Override public TextArea createWidget() { final TextArea textArea = new TextArea(); textArea.addKeyDownHandler(KeyDownEvent::stopPropagation); textArea.addMouseDownHandler(MouseDownEvent::stopPropagation); return textArea; }
/** * Creates a TextArea widget that wraps an existing <textarea> * element. * <p/> * This element must already be attached to the document. If the element is * removed from the document, you must call * {@link RootPanel#detachNow(Widget)}. * * @param element the element to be wrapped * @return TextArea */ public static TextArea wrap(final Element element) { // Assert that the element is attached. assert Document.get().getBody().isOrHasChild(element); final TextArea textArea = new TextArea(element); // Mark it attached and remember it for cleanup. textArea.onAttach(); RootPanel.detachOnWindowClose(textArea); return textArea; }
/** * Creates a TextArea widget that wraps an existing <textarea> * element. * <p/> * This element must already be attached to the document. If the element is * removed from the document, you must call * {@link RootPanel#detachNow(Widget)}. * * @param element the element to be wrapped * @return TextArea */ public static TextArea wrap(final Element element) { // Assert that the element is attached. assert Document.get().getBody().isOrHasChild(element); final TextArea textArea = new TextArea(element); // Mark it attached and remember it for cleanup. textArea.onAttach(); RootPanel.detachOnWindowClose(textArea); return textArea; }
@Override protected FormGroup getFormGroup(RenderMode renderMode) { DefaultFormGroup formGroup = formGroupsInstance.get(); if (renderMode.equals(RenderMode.PRETTY_MODE)) { HTML html = new HTML(); formGroup.render(html, field); } else { String inputId = generateUniqueId(); textArea = new TextArea(); textArea.setId(inputId); textArea.setName(fieldNS); textArea.setPlaceholder(field.getPlaceHolder()); textArea.setVisibleLines(field.getRows()); textArea.setEnabled(!field.getReadOnly()); textArea.setVisibleLines(field.getRows()); formGroup.render(inputId, textArea, field); } return formGroup; }