1 16 package com.google.gwt.user.client.ui; 17 18 import com.google.gwt.user.client.DOM; 19 20 37 public class TextArea extends TextBoxBase { 38 39 42 public TextArea() { 43 super(DOM.createTextArea()); 44 setStyleName("gwt-TextArea"); 45 } 46 47 53 public int getCharacterWidth() { 54 return DOM.getElementPropertyInt(getElement(), "cols"); 55 } 56 57 public int getCursorPos() { 58 return getImpl().getTextAreaCursorPos(getElement()); 59 } 60 61 public int getSelectionLength() { 62 return getImpl().getSelectionLength(getElement()); 63 } 64 65 70 public int getVisibleLines() { 71 return DOM.getElementPropertyInt(getElement(), "rows"); 72 } 73 74 80 public void setCharacterWidth(int width) { 81 DOM.setElementPropertyInt(getElement(), "cols", width); 82 } 83 84 89 public void setVisibleLines(int lines) { 90 DOM.setElementPropertyInt(getElement(), "rows", lines); 91 } 92 } 93 | Popular Tags |