1 16 package com.google.gwt.user.client.ui.impl; 17 18 import com.google.gwt.user.client.DOM; 19 import com.google.gwt.user.client.Element; 20 import com.google.gwt.user.client.Event; 21 import com.google.gwt.user.client.ui.RichTextArea; 22 23 27 public class RichTextAreaImpl { 28 29 protected Element elem; 30 31 public RichTextAreaImpl() { 32 elem = createElement(); 33 } 34 35 public Element getElement() { 36 return elem; 37 } 38 39 public String getHTML() { 40 return DOM.getElementProperty(elem, "value"); 41 } 42 43 public String getText() { 44 return DOM.getElementProperty(elem, "value"); 45 } 46 47 public void hookEvents(RichTextArea owner) { 48 DOM.setEventListener(elem, owner); 49 } 50 51 public void initElement() { 52 DOM.sinkEvents(elem, Event.MOUSEEVENTS | Event.KEYEVENTS | Event.ONCHANGE 53 | Event.ONCLICK); 54 } 55 56 public boolean isBasicEditingSupported() { 57 return false; 58 } 59 60 public boolean isExtendedEditingSupported() { 61 return false; 62 } 63 64 public native void setFocus(boolean focused) ; 71 72 public void setHTML(String html) { 73 DOM.setElementProperty(elem, "value", html); 74 } 75 76 public void setText(String text) { 77 DOM.setElementProperty(elem, "value", text); 78 } 79 80 public void unhookEvents() { 81 DOM.setEventListener(elem, null); 82 } 83 84 protected Element createElement() { 85 return DOM.createTextArea(); 86 } 87 } 88 | Popular Tags |