0001: /*
0002: * Copyright 2005 Joe Walker
0003: *
0004: * Licensed under the Apache License, Version 2.0 (the "License");
0005: * you may not use this file except in compliance with the License.
0006: * You may obtain a copy of the License at
0007: *
0008: * http://www.apache.org/licenses/LICENSE-2.0
0009: *
0010: * Unless required by applicable law or agreed to in writing, software
0011: * distributed under the License is distributed on an "AS IS" BASIS,
0012: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0013: * See the License for the specific language governing permissions and
0014: * limitations under the License.
0015: */
0016: package jsx3.gui;
0017:
0018: import org.directwebremoting.ScriptBuffer;
0019: import org.directwebremoting.proxy.ScriptProxy;
0020: import org.directwebremoting.proxy.io.Context;
0021:
0022: /**
0023: * This jsx3.gui.TextBox class allows integration of a standard HTML text input into the JSX DOM. This allows the text box to be treated like a JSX object, including positioning, serialization, updates, and data mapping/binding, etc.
0024: * @author Joe Walker [joe at getahead dot org]
0025: * @author DRAPGEN - Dwr Reverse Ajax Proxy GENerator
0026: */
0027: public class TextBox extends jsx3.gui.Block {
0028: /**
0029: * All reverse ajax proxies need context to work from
0030: * @param scriptProxy The place we are writing scripts to
0031: * @param context The script that got us to where we are now
0032: */
0033: public TextBox(Context context, String extension,
0034: ScriptProxy scriptProxy) {
0035: super (context, extension, scriptProxy);
0036: }
0037:
0038: /**
0039: * instance initializer
0040: * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application
0041: * @param vntLeft either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0042: * @param vntTop either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0043: * @param vntWidth either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0044: * @param vntHeight either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0045: * @param strValue this value to appear in the textbox/textarea. This value will be set as the defaultValue for the text box when it is initialized; if edits are made by the user, these edits can be accessed via [object].getValue(); if the initial value is needed, use [object].getDefaultValue();
0046: * @param TYPE one of two valid types: jsx3.gui.TextBox.TYPETEXT, jsx3.gui.TextBox.TYPETEXTAREA. If null is passed, jsx3.gui.TextBox.DEFAULTTYPE is used
0047: */
0048: public TextBox(String strName, String vntLeft, int vntTop,
0049: int vntWidth, String vntHeight, String strValue, String TYPE) {
0050: super ((Context) null, (String) null, (ScriptProxy) null);
0051: ScriptBuffer script = new ScriptBuffer();
0052: script.appendCall("new TextBox", strName, vntLeft, vntTop,
0053: vntWidth, vntHeight, strValue, TYPE);
0054: setInitScript(script);
0055: }
0056:
0057: /**
0058: * instance initializer
0059: * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application
0060: * @param vntLeft either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0061: * @param vntTop either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0062: * @param vntWidth either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0063: * @param vntHeight either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0064: * @param strValue this value to appear in the textbox/textarea. This value will be set as the defaultValue for the text box when it is initialized; if edits are made by the user, these edits can be accessed via [object].getValue(); if the initial value is needed, use [object].getDefaultValue();
0065: * @param TYPE one of two valid types: jsx3.gui.TextBox.TYPETEXT, jsx3.gui.TextBox.TYPETEXTAREA. If null is passed, jsx3.gui.TextBox.DEFAULTTYPE is used
0066: */
0067: public TextBox(String strName, String vntLeft, int vntTop,
0068: String vntWidth, int vntHeight, String strValue, String TYPE) {
0069: super ((Context) null, (String) null, (ScriptProxy) null);
0070: ScriptBuffer script = new ScriptBuffer();
0071: script.appendCall("new TextBox", strName, vntLeft, vntTop,
0072: vntWidth, vntHeight, strValue, TYPE);
0073: setInitScript(script);
0074: }
0075:
0076: /**
0077: * instance initializer
0078: * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application
0079: * @param vntLeft either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0080: * @param vntTop either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0081: * @param vntWidth either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0082: * @param vntHeight either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0083: * @param strValue this value to appear in the textbox/textarea. This value will be set as the defaultValue for the text box when it is initialized; if edits are made by the user, these edits can be accessed via [object].getValue(); if the initial value is needed, use [object].getDefaultValue();
0084: * @param TYPE one of two valid types: jsx3.gui.TextBox.TYPETEXT, jsx3.gui.TextBox.TYPETEXTAREA. If null is passed, jsx3.gui.TextBox.DEFAULTTYPE is used
0085: */
0086: public TextBox(String strName, int vntLeft, String vntTop,
0087: int vntWidth, String vntHeight, String strValue, String TYPE) {
0088: super ((Context) null, (String) null, (ScriptProxy) null);
0089: ScriptBuffer script = new ScriptBuffer();
0090: script.appendCall("new TextBox", strName, vntLeft, vntTop,
0091: vntWidth, vntHeight, strValue, TYPE);
0092: setInitScript(script);
0093: }
0094:
0095: /**
0096: * instance initializer
0097: * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application
0098: * @param vntLeft either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0099: * @param vntTop either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0100: * @param vntWidth either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0101: * @param vntHeight either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0102: * @param strValue this value to appear in the textbox/textarea. This value will be set as the defaultValue for the text box when it is initialized; if edits are made by the user, these edits can be accessed via [object].getValue(); if the initial value is needed, use [object].getDefaultValue();
0103: * @param TYPE one of two valid types: jsx3.gui.TextBox.TYPETEXT, jsx3.gui.TextBox.TYPETEXTAREA. If null is passed, jsx3.gui.TextBox.DEFAULTTYPE is used
0104: */
0105: public TextBox(String strName, String vntLeft, String vntTop,
0106: String vntWidth, int vntHeight, String strValue, String TYPE) {
0107: super ((Context) null, (String) null, (ScriptProxy) null);
0108: ScriptBuffer script = new ScriptBuffer();
0109: script.appendCall("new TextBox", strName, vntLeft, vntTop,
0110: vntWidth, vntHeight, strValue, TYPE);
0111: setInitScript(script);
0112: }
0113:
0114: /**
0115: * instance initializer
0116: * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application
0117: * @param vntLeft either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0118: * @param vntTop either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0119: * @param vntWidth either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0120: * @param vntHeight either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0121: * @param strValue this value to appear in the textbox/textarea. This value will be set as the defaultValue for the text box when it is initialized; if edits are made by the user, these edits can be accessed via [object].getValue(); if the initial value is needed, use [object].getDefaultValue();
0122: * @param TYPE one of two valid types: jsx3.gui.TextBox.TYPETEXT, jsx3.gui.TextBox.TYPETEXTAREA. If null is passed, jsx3.gui.TextBox.DEFAULTTYPE is used
0123: */
0124: public TextBox(String strName, int vntLeft, int vntTop,
0125: String vntWidth, int vntHeight, String strValue, String TYPE) {
0126: super ((Context) null, (String) null, (ScriptProxy) null);
0127: ScriptBuffer script = new ScriptBuffer();
0128: script.appendCall("new TextBox", strName, vntLeft, vntTop,
0129: vntWidth, vntHeight, strValue, TYPE);
0130: setInitScript(script);
0131: }
0132:
0133: /**
0134: * instance initializer
0135: * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application
0136: * @param vntLeft either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0137: * @param vntTop either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0138: * @param vntWidth either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0139: * @param vntHeight either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0140: * @param strValue this value to appear in the textbox/textarea. This value will be set as the defaultValue for the text box when it is initialized; if edits are made by the user, these edits can be accessed via [object].getValue(); if the initial value is needed, use [object].getDefaultValue();
0141: * @param TYPE one of two valid types: jsx3.gui.TextBox.TYPETEXT, jsx3.gui.TextBox.TYPETEXTAREA. If null is passed, jsx3.gui.TextBox.DEFAULTTYPE is used
0142: */
0143: public TextBox(String strName, String vntLeft, String vntTop,
0144: String vntWidth, String vntHeight, String strValue,
0145: String TYPE) {
0146: super ((Context) null, (String) null, (ScriptProxy) null);
0147: ScriptBuffer script = new ScriptBuffer();
0148: script.appendCall("new TextBox", strName, vntLeft, vntTop,
0149: vntWidth, vntHeight, strValue, TYPE);
0150: setInitScript(script);
0151: }
0152:
0153: /**
0154: * instance initializer
0155: * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application
0156: * @param vntLeft either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0157: * @param vntTop either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0158: * @param vntWidth either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0159: * @param vntHeight either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0160: * @param strValue this value to appear in the textbox/textarea. This value will be set as the defaultValue for the text box when it is initialized; if edits are made by the user, these edits can be accessed via [object].getValue(); if the initial value is needed, use [object].getDefaultValue();
0161: * @param TYPE one of two valid types: jsx3.gui.TextBox.TYPETEXT, jsx3.gui.TextBox.TYPETEXTAREA. If null is passed, jsx3.gui.TextBox.DEFAULTTYPE is used
0162: */
0163: public TextBox(String strName, int vntLeft, String vntTop,
0164: int vntWidth, int vntHeight, String strValue, String TYPE) {
0165: super ((Context) null, (String) null, (ScriptProxy) null);
0166: ScriptBuffer script = new ScriptBuffer();
0167: script.appendCall("new TextBox", strName, vntLeft, vntTop,
0168: vntWidth, vntHeight, strValue, TYPE);
0169: setInitScript(script);
0170: }
0171:
0172: /**
0173: * instance initializer
0174: * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application
0175: * @param vntLeft either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0176: * @param vntTop either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0177: * @param vntWidth either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0178: * @param vntHeight either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0179: * @param strValue this value to appear in the textbox/textarea. This value will be set as the defaultValue for the text box when it is initialized; if edits are made by the user, these edits can be accessed via [object].getValue(); if the initial value is needed, use [object].getDefaultValue();
0180: * @param TYPE one of two valid types: jsx3.gui.TextBox.TYPETEXT, jsx3.gui.TextBox.TYPETEXTAREA. If null is passed, jsx3.gui.TextBox.DEFAULTTYPE is used
0181: */
0182: public TextBox(String strName, String vntLeft, String vntTop,
0183: int vntWidth, int vntHeight, String strValue, String TYPE) {
0184: super ((Context) null, (String) null, (ScriptProxy) null);
0185: ScriptBuffer script = new ScriptBuffer();
0186: script.appendCall("new TextBox", strName, vntLeft, vntTop,
0187: vntWidth, vntHeight, strValue, TYPE);
0188: setInitScript(script);
0189: }
0190:
0191: /**
0192: * instance initializer
0193: * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application
0194: * @param vntLeft either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0195: * @param vntTop either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0196: * @param vntWidth either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0197: * @param vntHeight either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0198: * @param strValue this value to appear in the textbox/textarea. This value will be set as the defaultValue for the text box when it is initialized; if edits are made by the user, these edits can be accessed via [object].getValue(); if the initial value is needed, use [object].getDefaultValue();
0199: * @param TYPE one of two valid types: jsx3.gui.TextBox.TYPETEXT, jsx3.gui.TextBox.TYPETEXTAREA. If null is passed, jsx3.gui.TextBox.DEFAULTTYPE is used
0200: */
0201: public TextBox(String strName, int vntLeft, String vntTop,
0202: String vntWidth, String vntHeight, String strValue,
0203: String TYPE) {
0204: super ((Context) null, (String) null, (ScriptProxy) null);
0205: ScriptBuffer script = new ScriptBuffer();
0206: script.appendCall("new TextBox", strName, vntLeft, vntTop,
0207: vntWidth, vntHeight, strValue, TYPE);
0208: setInitScript(script);
0209: }
0210:
0211: /**
0212: * instance initializer
0213: * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application
0214: * @param vntLeft either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0215: * @param vntTop either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0216: * @param vntWidth either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0217: * @param vntHeight either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0218: * @param strValue this value to appear in the textbox/textarea. This value will be set as the defaultValue for the text box when it is initialized; if edits are made by the user, these edits can be accessed via [object].getValue(); if the initial value is needed, use [object].getDefaultValue();
0219: * @param TYPE one of two valid types: jsx3.gui.TextBox.TYPETEXT, jsx3.gui.TextBox.TYPETEXTAREA. If null is passed, jsx3.gui.TextBox.DEFAULTTYPE is used
0220: */
0221: public TextBox(String strName, int vntLeft, int vntTop,
0222: int vntWidth, String vntHeight, String strValue, String TYPE) {
0223: super ((Context) null, (String) null, (ScriptProxy) null);
0224: ScriptBuffer script = new ScriptBuffer();
0225: script.appendCall("new TextBox", strName, vntLeft, vntTop,
0226: vntWidth, vntHeight, strValue, TYPE);
0227: setInitScript(script);
0228: }
0229:
0230: /**
0231: * instance initializer
0232: * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application
0233: * @param vntLeft either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0234: * @param vntTop either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0235: * @param vntWidth either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0236: * @param vntHeight either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0237: * @param strValue this value to appear in the textbox/textarea. This value will be set as the defaultValue for the text box when it is initialized; if edits are made by the user, these edits can be accessed via [object].getValue(); if the initial value is needed, use [object].getDefaultValue();
0238: * @param TYPE one of two valid types: jsx3.gui.TextBox.TYPETEXT, jsx3.gui.TextBox.TYPETEXTAREA. If null is passed, jsx3.gui.TextBox.DEFAULTTYPE is used
0239: */
0240: public TextBox(String strName, String vntLeft, int vntTop,
0241: String vntWidth, String vntHeight, String strValue,
0242: String TYPE) {
0243: super ((Context) null, (String) null, (ScriptProxy) null);
0244: ScriptBuffer script = new ScriptBuffer();
0245: script.appendCall("new TextBox", strName, vntLeft, vntTop,
0246: vntWidth, vntHeight, strValue, TYPE);
0247: setInitScript(script);
0248: }
0249:
0250: /**
0251: * instance initializer
0252: * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application
0253: * @param vntLeft either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0254: * @param vntTop either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0255: * @param vntWidth either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0256: * @param vntHeight either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0257: * @param strValue this value to appear in the textbox/textarea. This value will be set as the defaultValue for the text box when it is initialized; if edits are made by the user, these edits can be accessed via [object].getValue(); if the initial value is needed, use [object].getDefaultValue();
0258: * @param TYPE one of two valid types: jsx3.gui.TextBox.TYPETEXT, jsx3.gui.TextBox.TYPETEXTAREA. If null is passed, jsx3.gui.TextBox.DEFAULTTYPE is used
0259: */
0260: public TextBox(String strName, int vntLeft, String vntTop,
0261: String vntWidth, int vntHeight, String strValue, String TYPE) {
0262: super ((Context) null, (String) null, (ScriptProxy) null);
0263: ScriptBuffer script = new ScriptBuffer();
0264: script.appendCall("new TextBox", strName, vntLeft, vntTop,
0265: vntWidth, vntHeight, strValue, TYPE);
0266: setInitScript(script);
0267: }
0268:
0269: /**
0270: * instance initializer
0271: * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application
0272: * @param vntLeft either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0273: * @param vntTop either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0274: * @param vntWidth either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0275: * @param vntHeight either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0276: * @param strValue this value to appear in the textbox/textarea. This value will be set as the defaultValue for the text box when it is initialized; if edits are made by the user, these edits can be accessed via [object].getValue(); if the initial value is needed, use [object].getDefaultValue();
0277: * @param TYPE one of two valid types: jsx3.gui.TextBox.TYPETEXT, jsx3.gui.TextBox.TYPETEXTAREA. If null is passed, jsx3.gui.TextBox.DEFAULTTYPE is used
0278: */
0279: public TextBox(String strName, String vntLeft, int vntTop,
0280: int vntWidth, int vntHeight, String strValue, String TYPE) {
0281: super ((Context) null, (String) null, (ScriptProxy) null);
0282: ScriptBuffer script = new ScriptBuffer();
0283: script.appendCall("new TextBox", strName, vntLeft, vntTop,
0284: vntWidth, vntHeight, strValue, TYPE);
0285: setInitScript(script);
0286: }
0287:
0288: /**
0289: * instance initializer
0290: * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application
0291: * @param vntLeft either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0292: * @param vntTop either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0293: * @param vntWidth either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0294: * @param vntHeight either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0295: * @param strValue this value to appear in the textbox/textarea. This value will be set as the defaultValue for the text box when it is initialized; if edits are made by the user, these edits can be accessed via [object].getValue(); if the initial value is needed, use [object].getDefaultValue();
0296: * @param TYPE one of two valid types: jsx3.gui.TextBox.TYPETEXT, jsx3.gui.TextBox.TYPETEXTAREA. If null is passed, jsx3.gui.TextBox.DEFAULTTYPE is used
0297: */
0298: public TextBox(String strName, int vntLeft, int vntTop,
0299: String vntWidth, String vntHeight, String strValue,
0300: String TYPE) {
0301: super ((Context) null, (String) null, (ScriptProxy) null);
0302: ScriptBuffer script = new ScriptBuffer();
0303: script.appendCall("new TextBox", strName, vntLeft, vntTop,
0304: vntWidth, vntHeight, strValue, TYPE);
0305: setInitScript(script);
0306: }
0307:
0308: /**
0309: * instance initializer
0310: * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application
0311: * @param vntLeft either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0312: * @param vntTop either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0313: * @param vntWidth either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0314: * @param vntHeight either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0315: * @param strValue this value to appear in the textbox/textarea. This value will be set as the defaultValue for the text box when it is initialized; if edits are made by the user, these edits can be accessed via [object].getValue(); if the initial value is needed, use [object].getDefaultValue();
0316: * @param TYPE one of two valid types: jsx3.gui.TextBox.TYPETEXT, jsx3.gui.TextBox.TYPETEXTAREA. If null is passed, jsx3.gui.TextBox.DEFAULTTYPE is used
0317: */
0318: public TextBox(String strName, int vntLeft, int vntTop,
0319: int vntWidth, int vntHeight, String strValue, String TYPE) {
0320: super ((Context) null, (String) null, (ScriptProxy) null);
0321: ScriptBuffer script = new ScriptBuffer();
0322: script.appendCall("new TextBox", strName, vntLeft, vntTop,
0323: vntWidth, vntHeight, strValue, TYPE);
0324: setInitScript(script);
0325: }
0326:
0327: /**
0328: * instance initializer
0329: * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application
0330: * @param vntLeft either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0331: * @param vntTop either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0332: * @param vntWidth either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0333: * @param vntHeight either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0334: * @param strValue this value to appear in the textbox/textarea. This value will be set as the defaultValue for the text box when it is initialized; if edits are made by the user, these edits can be accessed via [object].getValue(); if the initial value is needed, use [object].getDefaultValue();
0335: * @param TYPE one of two valid types: jsx3.gui.TextBox.TYPETEXT, jsx3.gui.TextBox.TYPETEXTAREA. If null is passed, jsx3.gui.TextBox.DEFAULTTYPE is used
0336: */
0337: public TextBox(String strName, String vntLeft, String vntTop,
0338: int vntWidth, String vntHeight, String strValue, String TYPE) {
0339: super ((Context) null, (String) null, (ScriptProxy) null);
0340: ScriptBuffer script = new ScriptBuffer();
0341: script.appendCall("new TextBox", strName, vntLeft, vntTop,
0342: vntWidth, vntHeight, strValue, TYPE);
0343: setInitScript(script);
0344: }
0345:
0346: /**
0347: * texbox type 0
0348: */
0349: public static final int TYPETEXT = 0;
0350:
0351: /**
0352: * text area type 1
0353: */
0354: public static final int TYPETEXTAREA = 1;
0355:
0356: /**
0357: * password type 2
0358: */
0359: public static final int TYPEPASSWORD = 2;
0360:
0361: /**
0362: * wrap text (default)
0363: */
0364: public static final int WRAPYES = 1;
0365:
0366: /**
0367: * no wrap
0368: */
0369: public static final int WRAPNO = 0;
0370:
0371: /**
0372: * none
0373: */
0374: public static final String OVERFLOWNORMAL = "";
0375:
0376: /**
0377: * as needed by content
0378: */
0379: public static final String OVERFLOWAUTO = "auto";
0380:
0381: /**
0382: * CSS color property
0383: */
0384: public static final String DEFAULTBACKGROUNDCOLOR = "#ffffff";
0385:
0386: /**
0387: * none
0388: */
0389: public static final String VALIDATIONNONE = "none";
0390:
0391: /**
0392: * us ssn
0393: */
0394: public static final String VALIDATIONSSN = "ssn";
0395:
0396: /**
0397: * telephone
0398: */
0399: public static final String VALIDATIONPHONE = "phone";
0400:
0401: /**
0402: * email
0403: */
0404: public static final String VALIDATIONEMAIL = "email";
0405:
0406: /**
0407: * numbers only
0408: */
0409: public static final String VALIDATIONNUMBER = "number";
0410:
0411: /**
0412: * letter
0413: */
0414: public static final String VALIDATIONLETTER = "letter";
0415:
0416: /**
0417: * uszip
0418: */
0419: public static final String VALIDATIONUSZIP = "uszip";
0420:
0421: /**
0422: * jsx30textbox
0423: */
0424: public static final String DEFAULTCLASSNAME = "jsx30textbox";
0425:
0426: /**
0427: * if TYPE for the object is jsx3.gui.TextBox.TYPETEXT, and this returns a positive integer, the maxlen property for the textbox will be set to this value; returns null if no value found
0428: * @param callback positive integer
0429: */
0430: @SuppressWarnings("unchecked")
0431: public void getMaxLength(
0432: org.directwebremoting.proxy.Callback<Integer> callback) {
0433: ScriptBuffer script = new ScriptBuffer();
0434: String callbackPrefix = "";
0435:
0436: if (callback != null) {
0437: callbackPrefix = "var reply = ";
0438: }
0439:
0440: script.appendCall(callbackPrefix + getContextPath()
0441: + "getMaxLength");
0442:
0443: if (callback != null) {
0444: String key = org.directwebremoting.extend.CallbackHelper
0445: .saveCallback(callback, Integer.class);
0446: script
0447: .appendCall("__System.activateCallback", key,
0448: "reply");
0449: }
0450:
0451: getScriptProxy().addScript(script);
0452: }
0453:
0454: /**
0455: * if TYPE for the object is jsx3.gui.TextBox.TYPETEXT, setting this to a positive integer affects the maxlen property for the textbox;
0456: returns a reference to self to facilitate method chaining
0457: * @param intMaxLength positive integer, maxlen for the number of characters accepted by the textbox
0458: * @return this object
0459: */
0460: public jsx3.gui.TextBox setMaxLength(int intMaxLength) {
0461: ScriptBuffer script = new ScriptBuffer();
0462: script.appendCall(getContextPath() + "setMaxLength",
0463: intMaxLength);
0464: getScriptProxy().addScript(script);
0465: return this ;
0466: }
0467:
0468: /**
0469: * Returns the type of TextBox. Default: jsx3.gui.TextBox.TYPETEXT
0470: * @param callback one of: jsx3.gui.TextBox.TYPETEXT, jsx3.gui.TextBox.TYPETEXTAREA, jsx3.gui.TextBox.TYPEPASSWORD
0471: */
0472: @SuppressWarnings("unchecked")
0473: public void getType(
0474: org.directwebremoting.proxy.Callback<Integer> callback) {
0475: ScriptBuffer script = new ScriptBuffer();
0476: String callbackPrefix = "";
0477:
0478: if (callback != null) {
0479: callbackPrefix = "var reply = ";
0480: }
0481:
0482: script
0483: .appendCall(callbackPrefix + getContextPath()
0484: + "getType");
0485:
0486: if (callback != null) {
0487: String key = org.directwebremoting.extend.CallbackHelper
0488: .saveCallback(callback, Integer.class);
0489: script
0490: .appendCall("__System.activateCallback", key,
0491: "reply");
0492: }
0493:
0494: getScriptProxy().addScript(script);
0495: }
0496:
0497: /**
0498: * Sets the type of jsx3.gui.TextBox
0499: returns a reference to self to facilitate method chaining
0500: * @param TYPE one of: jsx3.gui.TextBox.TYPETEXT, jsx3.gui.TextBox.TYPETEXTAREA, jsx3.gui.TextBox.TYPEPASSWORD
0501: * @return this object
0502: */
0503: public jsx3.gui.TextBox setType(int TYPE) {
0504: ScriptBuffer script = new ScriptBuffer();
0505: script.appendCall(getContextPath() + "setType", TYPE);
0506: getScriptProxy().addScript(script);
0507: return this ;
0508: }
0509:
0510: /**
0511: * logically tries to determine the value for the text box by 1) checking for value of on-screen VIEW; 2) checking for 'value' property for in-memory MODEL 3) checking getDefaultValue() for value when object was first initialized. Default: [empty string]
0512: * @param callback value for object
0513: */
0514: @SuppressWarnings("unchecked")
0515: public void getValue(
0516: org.directwebremoting.proxy.Callback<String> callback) {
0517: ScriptBuffer script = new ScriptBuffer();
0518: String callbackPrefix = "";
0519:
0520: if (callback != null) {
0521: callbackPrefix = "var reply = ";
0522: }
0523:
0524: script.appendCall(callbackPrefix + getContextPath()
0525: + "getValue");
0526:
0527: if (callback != null) {
0528: String key = org.directwebremoting.extend.CallbackHelper
0529: .saveCallback(callback, String.class);
0530: script
0531: .appendCall("__System.activateCallback", key,
0532: "reply");
0533: }
0534:
0535: getScriptProxy().addScript(script);
0536: }
0537:
0538: /**
0539: * Returns value of textbox object when it was first initialized. Default: [empty string]
0540: * @param callback default value for object
0541: */
0542: @SuppressWarnings("unchecked")
0543: public void getDefaultValue(
0544: org.directwebremoting.proxy.Callback<String> callback) {
0545: ScriptBuffer script = new ScriptBuffer();
0546: String callbackPrefix = "";
0547:
0548: if (callback != null) {
0549: callbackPrefix = "var reply = ";
0550: }
0551:
0552: script.appendCall(callbackPrefix + getContextPath()
0553: + "getDefaultValue");
0554:
0555: if (callback != null) {
0556: String key = org.directwebremoting.extend.CallbackHelper
0557: .saveCallback(callback, String.class);
0558: script
0559: .appendCall("__System.activateCallback", key,
0560: "reply");
0561: }
0562:
0563: getScriptProxy().addScript(script);
0564: }
0565:
0566: /**
0567: * updates value property for both on-screen VIEW (if object is painted) and in-memory MODEL;
0568: returns a reference to self to facilitate method chaining
0569: * @param strValue value for the textbox/textarea
0570: * @return this object
0571: */
0572: public jsx3.gui.TextBox setValue(String strValue) {
0573: ScriptBuffer script = new ScriptBuffer();
0574: script.appendCall(getContextPath() + "setValue", strValue);
0575: getScriptProxy().addScript(script);
0576: return this ;
0577: }
0578:
0579: /**
0580: * set during object initialization; useful for tracking edits/updates to an object by doing a string comparison between getValue() and getDefaultValue();
0581: returns a reference to self to facilitate method chaining
0582: * @param strValue default value for the textbox/textarea
0583: * @return this object
0584: */
0585: public jsx3.gui.TextBox setDefaultValue(String strValue) {
0586: ScriptBuffer script = new ScriptBuffer();
0587: script.appendCall(getContextPath() + "setDefaultValue",
0588: strValue);
0589: getScriptProxy().addScript(script);
0590: return this ;
0591: }
0592:
0593: /**
0594: * Returns the text-wrapping/ word-breaking property for object if object type is jsx3.gui.TextBox.TYPETEXTAREA. Default: jsx3.gui.TextBox.WRAPYES
0595: * @param callback one of: jsx3.gui.TextBox.WRAPYES jsx3.gui.TextBox.WRAPNO
0596: */
0597: @SuppressWarnings("unchecked")
0598: public void getWrap(
0599: org.directwebremoting.proxy.Callback<String> callback) {
0600: ScriptBuffer script = new ScriptBuffer();
0601: String callbackPrefix = "";
0602:
0603: if (callback != null) {
0604: callbackPrefix = "var reply = ";
0605: }
0606:
0607: script
0608: .appendCall(callbackPrefix + getContextPath()
0609: + "getWrap");
0610:
0611: if (callback != null) {
0612: String key = org.directwebremoting.extend.CallbackHelper
0613: .saveCallback(callback, String.class);
0614: script
0615: .appendCall("__System.activateCallback", key,
0616: "reply");
0617: }
0618:
0619: getScriptProxy().addScript(script);
0620: }
0621:
0622: /**
0623: * Sets the text-wrapping/ word-breaking property for object if object type is jsx3.gui.TextBox.TYPETEXTAREA.
0624: * @param bWrap one of: jsx3.gui.TextBox.WRAPYES jsx3.gui.TextBox.WRAPNO
0625: * @return this object.
0626: */
0627: public jsx3.gui.TextBox setWrap(boolean bWrap) {
0628: ScriptBuffer script = new ScriptBuffer();
0629: script.appendCall(getContextPath() + "setWrap", bWrap);
0630: getScriptProxy().addScript(script);
0631: return this ;
0632: }
0633:
0634: /**
0635: * Returns the ID (CONSTANT) for one of the pre-canned regular expression filters that can be used to validate the user's response. Default: jsx3.gui.TextBox.VALIDATIONNONE
0636: * @param callback one of: jsx3.gui.TextBox.VALIDATIONNONE, jsx3.gui.TextBox.VALIDATIONSSN, jsx3.gui.TextBox.VALIDATIONPHONE, jsx3.gui.TextBox.VALIDATIONEMAIL, jsx3.gui.TextBox.VALIDATIONNUMBER, jsx3.gui.TextBox.VALIDATIONLETTER, jsx3.gui.TextBox.VALIDATIONUSZIP
0637: */
0638: @SuppressWarnings("unchecked")
0639: public void getValidationType(
0640: org.directwebremoting.proxy.Callback<String> callback) {
0641: ScriptBuffer script = new ScriptBuffer();
0642: String callbackPrefix = "";
0643:
0644: if (callback != null) {
0645: callbackPrefix = "var reply = ";
0646: }
0647:
0648: script.appendCall(callbackPrefix + getContextPath()
0649: + "getValidationType");
0650:
0651: if (callback != null) {
0652: String key = org.directwebremoting.extend.CallbackHelper
0653: .saveCallback(callback, String.class);
0654: script
0655: .appendCall("__System.activateCallback", key,
0656: "reply");
0657: }
0658:
0659: getScriptProxy().addScript(script);
0660: }
0661:
0662: /**
0663: * when set, applies one of the pre-canned regular expression filters that can be used to validate the user's response;
0664: returns a reference to self to facilitate method chaining.
0665: * @param VALIDATIONTYPE one of: jsx3.gui.TextBox.VALIDATIONNONE, jsx3.gui.TextBox.VALIDATIONSSN, jsx3.gui.TextBox.VALIDATIONPHONE, jsx3.gui.TextBox.VALIDATIONEMAIL, jsx3.gui.TextBox.VALIDATIONNUMBER, jsx3.gui.TextBox.VALIDATIONLETTER, jsx3.gui.TextBox.VALIDATIONUSZIP
0666: * @return this object
0667: */
0668: public jsx3.gui.TextBox setValidationType(String VALIDATIONTYPE) {
0669: ScriptBuffer script = new ScriptBuffer();
0670: script.appendCall(getContextPath() + "setValidationType",
0671: VALIDATIONTYPE);
0672: getScriptProxy().addScript(script);
0673: return this ;
0674: }
0675:
0676: /**
0677: * Returns the custom validation expression (a regular expression pattern to match). If this method returns
0678: a valid regular expression (as a string), it will be applied instead of the pre-canned regular expression. Default: null
0679: returned by the method, getValidationType; null is returned if the expression is not found
0680: * @param callback valid regular expression such as ^\d{3}-\d{2}-\d{4}$
0681: */
0682: @SuppressWarnings("unchecked")
0683: public void getValidationExpression(
0684: org.directwebremoting.proxy.Callback<String> callback) {
0685: ScriptBuffer script = new ScriptBuffer();
0686: String callbackPrefix = "";
0687:
0688: if (callback != null) {
0689: callbackPrefix = "var reply = ";
0690: }
0691:
0692: script.appendCall(callbackPrefix + getContextPath()
0693: + "getValidationExpression");
0694:
0695: if (callback != null) {
0696: String key = org.directwebremoting.extend.CallbackHelper
0697: .saveCallback(callback, String.class);
0698: script
0699: .appendCall("__System.activateCallback", key,
0700: "reply");
0701: }
0702:
0703: getScriptProxy().addScript(script);
0704: }
0705:
0706: /**
0707: * Sets the custom validation expression (a regular expression pattern to match).
0708: returns a reference to self to facilitate method chaining.
0709: * @param strValidationExpression valid regular expression such as ^\d{3}-\d{2}-\d{4}$
0710: If null is passed custom value is removed and [object].getValidationType() is used instead
0711: * @return this object
0712: */
0713: public jsx3.gui.TextBox setValidationExpression(
0714: String strValidationExpression) {
0715: ScriptBuffer script = new ScriptBuffer();
0716: script.appendCall(getContextPath() + "setValidationExpression",
0717: strValidationExpression);
0718: getScriptProxy().addScript(script);
0719: return this ;
0720: }
0721:
0722: /**
0723: * validates form field, ensuring it contains the correct data set
0724: * @param callback true if field contains a valid value given @VALIDATIONTYPE
0725: */
0726: @SuppressWarnings("unchecked")
0727: public void doValidate(
0728: org.directwebremoting.proxy.Callback<Boolean> callback) {
0729: ScriptBuffer script = new ScriptBuffer();
0730: String callbackPrefix = "";
0731:
0732: if (callback != null) {
0733: callbackPrefix = "var reply = ";
0734: }
0735:
0736: script.appendCall(callbackPrefix + getContextPath()
0737: + "doValidate");
0738:
0739: if (callback != null) {
0740: String key = org.directwebremoting.extend.CallbackHelper
0741: .saveCallback(callback, Boolean.class);
0742: script
0743: .appendCall("__System.activateCallback", key,
0744: "reply");
0745: }
0746:
0747: getScriptProxy().addScript(script);
0748: }
0749:
0750: /**
0751: * call to designate an error or alert the user's attention to the textbox on-screen. Causes the textbox to 'flash/blink'
0752: */
0753: public void beep() {
0754: ScriptBuffer script = new ScriptBuffer();
0755: script.appendCall(getContextPath() + "beep");
0756: getScriptProxy().addScript(script);
0757: }
0758:
0759: /**
0760: * Binds the given key sequence to a callback function. Any object that has a key binding (specified with
0761: setKeyBinding()) will call this method when painted to register the key sequence with an appropriate
0762: ancestor of this form control. Any key down event that bubbles up to the ancestor without being intercepted
0763: and matches the given key sequence will invoke the given callback function.
0764:
0765: As of 3.2: The hot key will be registered with the first ancestor found that is either a
0766: jsx3.gui.Window, a jsx3.gui.Dialog, or the root block of a jsx3.app.Server.
0767: * @param fctCallback JavaScript function to execute when the given sequence is keyed by the user.
0768: * @param strKeys a plus-delimited ('+') key sequence such as <code>ctrl+s</code> or
0769: <code>ctrl+shift+alt+h</code> or <code>shift+a</code>, etc. Any combination of shift, ctrl, and alt are
0770: supported, including none. Also supported as the final token are <code>enter</code>, <code>esc</code>,
0771: <code>tab</code>, <code>del</code>, and <code>space</code>. To specify the final token as a key code, the
0772: last token can be the key code contained in brackets, <code>[13]</code>.
0773: * @return the registered hot key.
0774: */
0775: @SuppressWarnings("unchecked")
0776: public jsx3.gui.HotKey doKeyBinding(
0777: org.directwebremoting.proxy.CodeBlock fctCallback,
0778: String strKeys) {
0779: String extension = "doKeyBinding(\"" + fctCallback + "\", \""
0780: + strKeys + "\").";
0781: try {
0782: java.lang.reflect.Constructor<jsx3.gui.HotKey> ctor = jsx3.gui.HotKey.class
0783: .getConstructor(Context.class, String.class,
0784: ScriptProxy.class);
0785: return ctor.newInstance(this , extension, getScriptProxy());
0786: } catch (Exception ex) {
0787: throw new IllegalArgumentException("Unsupported type: "
0788: + jsx3.gui.HotKey.class.getName());
0789: }
0790: }
0791:
0792: /**
0793: * Resets the validation state of this control.
0794: * @return this object.
0795: */
0796: @SuppressWarnings("unchecked")
0797: public jsx3.gui.Form doReset() {
0798: String extension = "doReset().";
0799: try {
0800: java.lang.reflect.Constructor<jsx3.gui.Form> ctor = jsx3.gui.Form.class
0801: .getConstructor(Context.class, String.class,
0802: ScriptProxy.class);
0803: return ctor.newInstance(this , extension, getScriptProxy());
0804: } catch (Exception ex) {
0805: throw new IllegalArgumentException("Unsupported type: "
0806: + jsx3.gui.Form.class.getName());
0807: }
0808: }
0809:
0810: /**
0811: * Resets the validation state of this control.
0812: * @param returnType The expected return type
0813: * @return this object.
0814: */
0815: @SuppressWarnings("unchecked")
0816: public <T> T doReset(Class<T> returnType) {
0817: String extension = "doReset().";
0818: try {
0819: java.lang.reflect.Constructor<T> ctor = returnType
0820: .getConstructor(Context.class, String.class,
0821: ScriptProxy.class);
0822: return ctor.newInstance(this , extension, getScriptProxy());
0823: } catch (Exception ex) {
0824: throw new IllegalArgumentException(
0825: "Unsupported return type: " + returnType.getName());
0826: }
0827: }
0828:
0829: /**
0830: * Returns the background color of this control when it is disabled.
0831: * @param callback valid CSS property value, (i.e., red, #ff0000)
0832: */
0833: @SuppressWarnings("unchecked")
0834: public void getDisabledBackgroundColor(
0835: org.directwebremoting.proxy.Callback<String> callback) {
0836: ScriptBuffer script = new ScriptBuffer();
0837: String callbackPrefix = "";
0838:
0839: if (callback != null) {
0840: callbackPrefix = "var reply = ";
0841: }
0842:
0843: script.appendCall(callbackPrefix + getContextPath()
0844: + "getDisabledBackgroundColor");
0845:
0846: if (callback != null) {
0847: String key = org.directwebremoting.extend.CallbackHelper
0848: .saveCallback(callback, String.class);
0849: script
0850: .appendCall("__System.activateCallback", key,
0851: "reply");
0852: }
0853:
0854: getScriptProxy().addScript(script);
0855: }
0856:
0857: /**
0858: * Returns the font color to use when this control is disabled.
0859: * @param callback valid CSS property value, (i.e., red, #ff0000)
0860: */
0861: @SuppressWarnings("unchecked")
0862: public void getDisabledColor(
0863: org.directwebremoting.proxy.Callback<String> callback) {
0864: ScriptBuffer script = new ScriptBuffer();
0865: String callbackPrefix = "";
0866:
0867: if (callback != null) {
0868: callbackPrefix = "var reply = ";
0869: }
0870:
0871: script.appendCall(callbackPrefix + getContextPath()
0872: + "getDisabledColor");
0873:
0874: if (callback != null) {
0875: String key = org.directwebremoting.extend.CallbackHelper
0876: .saveCallback(callback, String.class);
0877: script
0878: .appendCall("__System.activateCallback", key,
0879: "reply");
0880: }
0881:
0882: getScriptProxy().addScript(script);
0883: }
0884:
0885: /**
0886: * Returns the state for the form field control. If no enabled state is set, this method returns
0887: STATEENABLED.
0888: * @param callback <code>STATEDISABLED</code> or <code>STATEENABLED</code>.
0889: */
0890: @SuppressWarnings("unchecked")
0891: public void getEnabled(
0892: org.directwebremoting.proxy.Callback<Integer> callback) {
0893: ScriptBuffer script = new ScriptBuffer();
0894: String callbackPrefix = "";
0895:
0896: if (callback != null) {
0897: callbackPrefix = "var reply = ";
0898: }
0899:
0900: script.appendCall(callbackPrefix + getContextPath()
0901: + "getEnabled");
0902:
0903: if (callback != null) {
0904: String key = org.directwebremoting.extend.CallbackHelper
0905: .saveCallback(callback, Integer.class);
0906: script
0907: .appendCall("__System.activateCallback", key,
0908: "reply");
0909: }
0910:
0911: getScriptProxy().addScript(script);
0912: }
0913:
0914: /**
0915: * Returns the key binding that when keyed will fire the execute event for this control.
0916: * @param callback plus-delimited (e.g.,'+') key sequence such as ctrl+s or ctrl+shift+alt+h or shift+a, etc
0917: */
0918: @SuppressWarnings("unchecked")
0919: public void getKeyBinding(
0920: org.directwebremoting.proxy.Callback<String> callback) {
0921: ScriptBuffer script = new ScriptBuffer();
0922: String callbackPrefix = "";
0923:
0924: if (callback != null) {
0925: callbackPrefix = "var reply = ";
0926: }
0927:
0928: script.appendCall(callbackPrefix + getContextPath()
0929: + "getKeyBinding");
0930:
0931: if (callback != null) {
0932: String key = org.directwebremoting.extend.CallbackHelper
0933: .saveCallback(callback, String.class);
0934: script
0935: .appendCall("__System.activateCallback", key,
0936: "reply");
0937: }
0938:
0939: getScriptProxy().addScript(script);
0940: }
0941:
0942: /**
0943: * Returns whether or not this control is required. If the required property has never been set, this method returns
0944: OPTIONAL.
0945: * @param callback <code>REQUIRED</code> or <code>OPTIONAL</code>.
0946: */
0947: @SuppressWarnings("unchecked")
0948: public void getRequired(
0949: org.directwebremoting.proxy.Callback<Integer> callback) {
0950: ScriptBuffer script = new ScriptBuffer();
0951: String callbackPrefix = "";
0952:
0953: if (callback != null) {
0954: callbackPrefix = "var reply = ";
0955: }
0956:
0957: script.appendCall(callbackPrefix + getContextPath()
0958: + "getRequired");
0959:
0960: if (callback != null) {
0961: String key = org.directwebremoting.extend.CallbackHelper
0962: .saveCallback(callback, Integer.class);
0963: script
0964: .appendCall("__System.activateCallback", key,
0965: "reply");
0966: }
0967:
0968: getScriptProxy().addScript(script);
0969: }
0970:
0971: /**
0972: * Returns the validation state of this control. If the validationState property has never been set, this method returns
0973: STATEVALID.
0974: * @param callback <code>STATEINVALID</code> or <code>STATEVALID</code>.
0975: */
0976: @SuppressWarnings("unchecked")
0977: public void getValidationState(
0978: org.directwebremoting.proxy.Callback<Integer> callback) {
0979: ScriptBuffer script = new ScriptBuffer();
0980: String callbackPrefix = "";
0981:
0982: if (callback != null) {
0983: callbackPrefix = "var reply = ";
0984: }
0985:
0986: script.appendCall(callbackPrefix + getContextPath()
0987: + "getValidationState");
0988:
0989: if (callback != null) {
0990: String key = org.directwebremoting.extend.CallbackHelper
0991: .saveCallback(callback, Integer.class);
0992: script
0993: .appendCall("__System.activateCallback", key,
0994: "reply");
0995: }
0996:
0997: getScriptProxy().addScript(script);
0998: }
0999:
1000: /**
1001: * Sets the background color of this form control when it is disabled.
1002: * @param strColor valid CSS property value, (i.e., red, #ff0000)
1003: * @return this object.
1004: */
1005: @SuppressWarnings("unchecked")
1006: public jsx3.gui.Form setDisabledBackgroundColor(String strColor) {
1007: String extension = "setDisabledBackgroundColor(\"" + strColor
1008: + "\").";
1009: try {
1010: java.lang.reflect.Constructor<jsx3.gui.Form> ctor = jsx3.gui.Form.class
1011: .getConstructor(Context.class, String.class,
1012: ScriptProxy.class);
1013: return ctor.newInstance(this , extension, getScriptProxy());
1014: } catch (Exception ex) {
1015: throw new IllegalArgumentException("Unsupported type: "
1016: + jsx3.gui.Form.class.getName());
1017: }
1018: }
1019:
1020: /**
1021: * Sets the background color of this form control when it is disabled.
1022: * @param strColor valid CSS property value, (i.e., red, #ff0000)
1023: * @param returnType The expected return type
1024: * @return this object.
1025: */
1026: @SuppressWarnings("unchecked")
1027: public <T> T setDisabledBackgroundColor(String strColor,
1028: Class<T> returnType) {
1029: String extension = "setDisabledBackgroundColor(\"" + strColor
1030: + "\").";
1031: try {
1032: java.lang.reflect.Constructor<T> ctor = returnType
1033: .getConstructor(Context.class, String.class,
1034: ScriptProxy.class);
1035: return ctor.newInstance(this , extension, getScriptProxy());
1036: } catch (Exception ex) {
1037: throw new IllegalArgumentException(
1038: "Unsupported return type: " + returnType.getName());
1039: }
1040: }
1041:
1042: /**
1043: * Sets the font color to use when this control is disabled.
1044: * @param strColor valid CSS property value, (i.e., red, #ff0000)
1045: * @return this object.
1046: */
1047: @SuppressWarnings("unchecked")
1048: public jsx3.gui.Form setDisabledColor(String strColor) {
1049: String extension = "setDisabledColor(\"" + strColor + "\").";
1050: try {
1051: java.lang.reflect.Constructor<jsx3.gui.Form> ctor = jsx3.gui.Form.class
1052: .getConstructor(Context.class, String.class,
1053: ScriptProxy.class);
1054: return ctor.newInstance(this , extension, getScriptProxy());
1055: } catch (Exception ex) {
1056: throw new IllegalArgumentException("Unsupported type: "
1057: + jsx3.gui.Form.class.getName());
1058: }
1059: }
1060:
1061: /**
1062: * Sets the font color to use when this control is disabled.
1063: * @param strColor valid CSS property value, (i.e., red, #ff0000)
1064: * @param returnType The expected return type
1065: * @return this object.
1066: */
1067: @SuppressWarnings("unchecked")
1068: public <T> T setDisabledColor(String strColor, Class<T> returnType) {
1069: String extension = "setDisabledColor(\"" + strColor + "\").";
1070: try {
1071: java.lang.reflect.Constructor<T> ctor = returnType
1072: .getConstructor(Context.class, String.class,
1073: ScriptProxy.class);
1074: return ctor.newInstance(this , extension, getScriptProxy());
1075: } catch (Exception ex) {
1076: throw new IllegalArgumentException(
1077: "Unsupported return type: " + returnType.getName());
1078: }
1079: }
1080:
1081: /**
1082: * Sets whether this control is enabled. Disabled controls do not respond to user interaction.
1083: * @param intEnabled <code>STATEDISABLED</code> or <code>STATEENABLED</code>. <code>null</code> is
1084: equivalent to <code>STATEENABLED</code>.
1085: * @param bRepaint if <code>true</code> this control is immediately repainted to reflect the new setting.
1086: */
1087: public void setEnabled(int intEnabled, boolean bRepaint) {
1088: ScriptBuffer script = new ScriptBuffer();
1089: script.appendCall(getContextPath() + "setEnabled", intEnabled,
1090: bRepaint);
1091: getScriptProxy().addScript(script);
1092: }
1093:
1094: /**
1095: * Sets the key binding that when keyed will fire the bound execute (jsx3.gui.Interactive.EXECUTE)
1096: event for this control.
1097: * @param strSequence plus-delimited (e.g.,'+') key sequence such as ctrl+s or ctrl+shift+alt+h or shift+a, etc
1098: * @return this object.
1099: */
1100: @SuppressWarnings("unchecked")
1101: public jsx3.gui.Form setKeyBinding(String strSequence) {
1102: String extension = "setKeyBinding(\"" + strSequence + "\").";
1103: try {
1104: java.lang.reflect.Constructor<jsx3.gui.Form> ctor = jsx3.gui.Form.class
1105: .getConstructor(Context.class, String.class,
1106: ScriptProxy.class);
1107: return ctor.newInstance(this , extension, getScriptProxy());
1108: } catch (Exception ex) {
1109: throw new IllegalArgumentException("Unsupported type: "
1110: + jsx3.gui.Form.class.getName());
1111: }
1112: }
1113:
1114: /**
1115: * Sets the key binding that when keyed will fire the bound execute (jsx3.gui.Interactive.EXECUTE)
1116: event for this control.
1117: * @param strSequence plus-delimited (e.g.,'+') key sequence such as ctrl+s or ctrl+shift+alt+h or shift+a, etc
1118: * @param returnType The expected return type
1119: * @return this object.
1120: */
1121: @SuppressWarnings("unchecked")
1122: public <T> T setKeyBinding(String strSequence, Class<T> returnType) {
1123: String extension = "setKeyBinding(\"" + strSequence + "\").";
1124: try {
1125: java.lang.reflect.Constructor<T> ctor = returnType
1126: .getConstructor(Context.class, String.class,
1127: ScriptProxy.class);
1128: return ctor.newInstance(this , extension, getScriptProxy());
1129: } catch (Exception ex) {
1130: throw new IllegalArgumentException(
1131: "Unsupported return type: " + returnType.getName());
1132: }
1133: }
1134:
1135: /**
1136: * Sets whether or not this control is required.
1137: * @param required {int} <code>REQUIRED</code> or <code>OPTIONAL</code>.
1138: * @return this object.
1139: */
1140: @SuppressWarnings("unchecked")
1141: public jsx3.gui.Form setRequired(int required) {
1142: String extension = "setRequired(\"" + required + "\").";
1143: try {
1144: java.lang.reflect.Constructor<jsx3.gui.Form> ctor = jsx3.gui.Form.class
1145: .getConstructor(Context.class, String.class,
1146: ScriptProxy.class);
1147: return ctor.newInstance(this , extension, getScriptProxy());
1148: } catch (Exception ex) {
1149: throw new IllegalArgumentException("Unsupported type: "
1150: + jsx3.gui.Form.class.getName());
1151: }
1152: }
1153:
1154: /**
1155: * Sets whether or not this control is required.
1156: * @param required {int} <code>REQUIRED</code> or <code>OPTIONAL</code>.
1157: * @param returnType The expected return type
1158: * @return this object.
1159: */
1160: @SuppressWarnings("unchecked")
1161: public <T> T setRequired(int required, Class<T> returnType) {
1162: String extension = "setRequired(\"" + required + "\").";
1163: try {
1164: java.lang.reflect.Constructor<T> ctor = returnType
1165: .getConstructor(Context.class, String.class,
1166: ScriptProxy.class);
1167: return ctor.newInstance(this , extension, getScriptProxy());
1168: } catch (Exception ex) {
1169: throw new IllegalArgumentException(
1170: "Unsupported return type: " + returnType.getName());
1171: }
1172: }
1173:
1174: /**
1175: * Sets the validation state of this control. The validation state of a control is not serialized.
1176: * @param intState <code>STATEINVALID</code> or <code>STATEVALID</code>.
1177: * @return this object.
1178: */
1179: @SuppressWarnings("unchecked")
1180: public jsx3.gui.Form setValidationState(int intState) {
1181: String extension = "setValidationState(\"" + intState + "\").";
1182: try {
1183: java.lang.reflect.Constructor<jsx3.gui.Form> ctor = jsx3.gui.Form.class
1184: .getConstructor(Context.class, String.class,
1185: ScriptProxy.class);
1186: return ctor.newInstance(this , extension, getScriptProxy());
1187: } catch (Exception ex) {
1188: throw new IllegalArgumentException("Unsupported type: "
1189: + jsx3.gui.Form.class.getName());
1190: }
1191: }
1192:
1193: /**
1194: * Sets the validation state of this control. The validation state of a control is not serialized.
1195: * @param intState <code>STATEINVALID</code> or <code>STATEVALID</code>.
1196: * @param returnType The expected return type
1197: * @return this object.
1198: */
1199: @SuppressWarnings("unchecked")
1200: public <T> T setValidationState(int intState, Class<T> returnType) {
1201: String extension = "setValidationState(\"" + intState + "\").";
1202: try {
1203: java.lang.reflect.Constructor<T> ctor = returnType
1204: .getConstructor(Context.class, String.class,
1205: ScriptProxy.class);
1206: return ctor.newInstance(this , extension, getScriptProxy());
1207: } catch (Exception ex) {
1208: throw new IllegalArgumentException(
1209: "Unsupported return type: " + returnType.getName());
1210: }
1211: }
1212:
1213: }
|