01: /*
02: * GWT-Ext Widget Library
03: * Copyright(c) 2007-2008, GWT-Ext.
04: * licensing@gwt-ext.com
05: *
06: * http://www.gwt-ext.com/license
07: */
08:
09: package com.gwtext.client.widgets.form;
10:
11: import com.google.gwt.core.client.JavaScriptObject;
12: import com.gwtext.client.util.JavaScriptObjectHelper;
13:
14: /**
15: * Multiline text field. Can be used as a direct replacement for traditional textarea fields, plus adds support for auto-sizing.
16: *
17: */
18: public class TextArea extends TextField {
19:
20: private static JavaScriptObject configPrototype;
21:
22: static {
23: init();
24: }
25:
26: private static native void init()/*-{
27: var c = new $wnd.Ext.form.TextArea();
28: @com.gwtext.client.widgets.form.TextArea::configPrototype = c.initialConfig;
29: }-*/;
30:
31: protected JavaScriptObject getConfigPrototype() {
32: return configPrototype;
33: }
34:
35: public String getXType() {
36: return "textarea";
37: }
38:
39: /**
40: * Constructs a new TextArea.
41: */
42: public TextArea() {
43: }
44:
45: public TextArea(String fieldLabel) {
46: super (fieldLabel);
47: }
48:
49: public TextArea(String fieldLabel, String name) {
50: super (fieldLabel, name);
51: }
52:
53: public TextArea(JavaScriptObject jsObj) {
54: super (jsObj);
55: }
56:
57: protected native JavaScriptObject create(JavaScriptObject jsObj) /*-{
58: return new $wnd.Ext.form.TextArea(jsObj);
59: }-*/;
60:
61: // --- config properties ---
62:
63: /**
64: * The maximum height to allow when grow = true (defaults to 1000).
65: *
66: * @param growMax the max height
67: */
68: public void setGrowMax(int growMax) {
69: super .setGrowMax(growMax);
70: }
71:
72: /**
73: * The minimum height to allow when grow = true (defaults to 60).
74: *
75: * @param growMin the min height
76: */
77: public void setGrowMin(int growMin) {
78: super .setGrowMin(growMin);
79: }
80:
81: /**
82: * True to prevent scrollbars from appearing regardless of how much text is in the field (equivalent to setting
83: * overflow: hidden, defaults to false).
84: *
85: * @param preventScrollbars true to prevent scrollbars
86: * @throws IllegalStateException this property cannot be changed after the Component has been rendered
87: */
88: public void setPreventScrollbars(boolean preventScrollbars)
89: throws IllegalStateException {
90: setAttribute("preventScrollbars", preventScrollbars, true);
91: }
92: }
|