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 class is a wrapper of the standard HTML checkbox.
0024:
0025: This class publishes the following model events:
0026:
0027:
0028: TOGGLE Ð when the state of a checkbox changes through user interaction or when
0029: setState() is called under the deprecated 3.0 model event protocol.
0030:
0031: MENU Ð on a mouseup event with the right button when the button has a bound context menu.
0032: * @author Joe Walker [joe at getahead dot org]
0033: * @author DRAPGEN - Dwr Reverse Ajax Proxy GENerator
0034: */
0035: public class CheckBox extends jsx3.gui.Block {
0036: /**
0037: * All reverse ajax proxies need context to work from
0038: * @param scriptProxy The place we are writing scripts to
0039: * @param context The script that got us to where we are now
0040: */
0041: public CheckBox(Context context, String extension,
0042: ScriptProxy scriptProxy) {
0043: super (context, extension, scriptProxy);
0044: }
0045:
0046: /**
0047: * The instance initializer.
0048: * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application
0049: * @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
0050: * @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
0051: * @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
0052: * @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
0053: * @param strText text/HTML markup to display with the checkbox;
0054: * @param CHECKED if jsx3.gui.CheckBox.CHECKED or null, checkbox is checked; if jsx3.gui.CheckBox.UNCHECKED checkbox is unchecked
0055: */
0056: public CheckBox(String strName, String vntLeft, String vntTop,
0057: int vntWidth, int vntHeight, String strText, int CHECKED) {
0058: super ((Context) null, (String) null, (ScriptProxy) null);
0059: ScriptBuffer script = new ScriptBuffer();
0060: script.appendCall("new CheckBox", strName, vntLeft, vntTop,
0061: vntWidth, vntHeight, strText, CHECKED);
0062: setInitScript(script);
0063: }
0064:
0065: /**
0066: * The instance initializer.
0067: * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application
0068: * @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
0069: * @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
0070: * @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
0071: * @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
0072: * @param strText text/HTML markup to display with the checkbox;
0073: * @param CHECKED if jsx3.gui.CheckBox.CHECKED or null, checkbox is checked; if jsx3.gui.CheckBox.UNCHECKED checkbox is unchecked
0074: */
0075: public CheckBox(String strName, String vntLeft, String vntTop,
0076: String vntWidth, int vntHeight, String strText, int CHECKED) {
0077: super ((Context) null, (String) null, (ScriptProxy) null);
0078: ScriptBuffer script = new ScriptBuffer();
0079: script.appendCall("new CheckBox", strName, vntLeft, vntTop,
0080: vntWidth, vntHeight, strText, CHECKED);
0081: setInitScript(script);
0082: }
0083:
0084: /**
0085: * The instance initializer.
0086: * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application
0087: * @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
0088: * @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
0089: * @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
0090: * @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
0091: * @param strText text/HTML markup to display with the checkbox;
0092: * @param CHECKED if jsx3.gui.CheckBox.CHECKED or null, checkbox is checked; if jsx3.gui.CheckBox.UNCHECKED checkbox is unchecked
0093: */
0094: public CheckBox(String strName, String vntLeft, int vntTop,
0095: String vntWidth, String vntHeight, String strText,
0096: int CHECKED) {
0097: super ((Context) null, (String) null, (ScriptProxy) null);
0098: ScriptBuffer script = new ScriptBuffer();
0099: script.appendCall("new CheckBox", strName, vntLeft, vntTop,
0100: vntWidth, vntHeight, strText, CHECKED);
0101: setInitScript(script);
0102: }
0103:
0104: /**
0105: * The instance initializer.
0106: * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application
0107: * @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
0108: * @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
0109: * @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
0110: * @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
0111: * @param strText text/HTML markup to display with the checkbox;
0112: * @param CHECKED if jsx3.gui.CheckBox.CHECKED or null, checkbox is checked; if jsx3.gui.CheckBox.UNCHECKED checkbox is unchecked
0113: */
0114: public CheckBox(String strName, String vntLeft, int vntTop,
0115: String vntWidth, int vntHeight, String strText, int CHECKED) {
0116: super ((Context) null, (String) null, (ScriptProxy) null);
0117: ScriptBuffer script = new ScriptBuffer();
0118: script.appendCall("new CheckBox", strName, vntLeft, vntTop,
0119: vntWidth, vntHeight, strText, CHECKED);
0120: setInitScript(script);
0121: }
0122:
0123: /**
0124: * The instance initializer.
0125: * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application
0126: * @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
0127: * @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
0128: * @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
0129: * @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
0130: * @param strText text/HTML markup to display with the checkbox;
0131: * @param CHECKED if jsx3.gui.CheckBox.CHECKED or null, checkbox is checked; if jsx3.gui.CheckBox.UNCHECKED checkbox is unchecked
0132: */
0133: public CheckBox(String strName, String vntLeft, int vntTop,
0134: int vntWidth, String vntHeight, String strText, int CHECKED) {
0135: super ((Context) null, (String) null, (ScriptProxy) null);
0136: ScriptBuffer script = new ScriptBuffer();
0137: script.appendCall("new CheckBox", strName, vntLeft, vntTop,
0138: vntWidth, vntHeight, strText, CHECKED);
0139: setInitScript(script);
0140: }
0141:
0142: /**
0143: * The instance initializer.
0144: * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application
0145: * @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
0146: * @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
0147: * @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
0148: * @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
0149: * @param strText text/HTML markup to display with the checkbox;
0150: * @param CHECKED if jsx3.gui.CheckBox.CHECKED or null, checkbox is checked; if jsx3.gui.CheckBox.UNCHECKED checkbox is unchecked
0151: */
0152: public CheckBox(String strName, int vntLeft, int vntTop,
0153: String vntWidth, String vntHeight, String strText,
0154: int CHECKED) {
0155: super ((Context) null, (String) null, (ScriptProxy) null);
0156: ScriptBuffer script = new ScriptBuffer();
0157: script.appendCall("new CheckBox", strName, vntLeft, vntTop,
0158: vntWidth, vntHeight, strText, CHECKED);
0159: setInitScript(script);
0160: }
0161:
0162: /**
0163: * The instance initializer.
0164: * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application
0165: * @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
0166: * @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
0167: * @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
0168: * @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
0169: * @param strText text/HTML markup to display with the checkbox;
0170: * @param CHECKED if jsx3.gui.CheckBox.CHECKED or null, checkbox is checked; if jsx3.gui.CheckBox.UNCHECKED checkbox is unchecked
0171: */
0172: public CheckBox(String strName, String vntLeft, String vntTop,
0173: int vntWidth, String vntHeight, String strText, int CHECKED) {
0174: super ((Context) null, (String) null, (ScriptProxy) null);
0175: ScriptBuffer script = new ScriptBuffer();
0176: script.appendCall("new CheckBox", strName, vntLeft, vntTop,
0177: vntWidth, vntHeight, strText, CHECKED);
0178: setInitScript(script);
0179: }
0180:
0181: /**
0182: * The instance initializer.
0183: * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application
0184: * @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
0185: * @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
0186: * @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
0187: * @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
0188: * @param strText text/HTML markup to display with the checkbox;
0189: * @param CHECKED if jsx3.gui.CheckBox.CHECKED or null, checkbox is checked; if jsx3.gui.CheckBox.UNCHECKED checkbox is unchecked
0190: */
0191: public CheckBox(String strName, int vntLeft, String vntTop,
0192: String vntWidth, int vntHeight, String strText, int CHECKED) {
0193: super ((Context) null, (String) null, (ScriptProxy) null);
0194: ScriptBuffer script = new ScriptBuffer();
0195: script.appendCall("new CheckBox", strName, vntLeft, vntTop,
0196: vntWidth, vntHeight, strText, CHECKED);
0197: setInitScript(script);
0198: }
0199:
0200: /**
0201: * The instance initializer.
0202: * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application
0203: * @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
0204: * @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
0205: * @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
0206: * @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
0207: * @param strText text/HTML markup to display with the checkbox;
0208: * @param CHECKED if jsx3.gui.CheckBox.CHECKED or null, checkbox is checked; if jsx3.gui.CheckBox.UNCHECKED checkbox is unchecked
0209: */
0210: public CheckBox(String strName, int vntLeft, String vntTop,
0211: String vntWidth, String vntHeight, String strText,
0212: int CHECKED) {
0213: super ((Context) null, (String) null, (ScriptProxy) null);
0214: ScriptBuffer script = new ScriptBuffer();
0215: script.appendCall("new CheckBox", strName, vntLeft, vntTop,
0216: vntWidth, vntHeight, strText, CHECKED);
0217: setInitScript(script);
0218: }
0219:
0220: /**
0221: * The instance initializer.
0222: * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application
0223: * @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
0224: * @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
0225: * @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
0226: * @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
0227: * @param strText text/HTML markup to display with the checkbox;
0228: * @param CHECKED if jsx3.gui.CheckBox.CHECKED or null, checkbox is checked; if jsx3.gui.CheckBox.UNCHECKED checkbox is unchecked
0229: */
0230: public CheckBox(String strName, int vntLeft, String vntTop,
0231: int vntWidth, int vntHeight, String strText, int CHECKED) {
0232: super ((Context) null, (String) null, (ScriptProxy) null);
0233: ScriptBuffer script = new ScriptBuffer();
0234: script.appendCall("new CheckBox", strName, vntLeft, vntTop,
0235: vntWidth, vntHeight, strText, CHECKED);
0236: setInitScript(script);
0237: }
0238:
0239: /**
0240: * The instance initializer.
0241: * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application
0242: * @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
0243: * @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
0244: * @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
0245: * @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
0246: * @param strText text/HTML markup to display with the checkbox;
0247: * @param CHECKED if jsx3.gui.CheckBox.CHECKED or null, checkbox is checked; if jsx3.gui.CheckBox.UNCHECKED checkbox is unchecked
0248: */
0249: public CheckBox(String strName, String vntLeft, int vntTop,
0250: int vntWidth, int vntHeight, String strText, int CHECKED) {
0251: super ((Context) null, (String) null, (ScriptProxy) null);
0252: ScriptBuffer script = new ScriptBuffer();
0253: script.appendCall("new CheckBox", strName, vntLeft, vntTop,
0254: vntWidth, vntHeight, strText, CHECKED);
0255: setInitScript(script);
0256: }
0257:
0258: /**
0259: * The instance initializer.
0260: * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application
0261: * @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
0262: * @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
0263: * @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
0264: * @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
0265: * @param strText text/HTML markup to display with the checkbox;
0266: * @param CHECKED if jsx3.gui.CheckBox.CHECKED or null, checkbox is checked; if jsx3.gui.CheckBox.UNCHECKED checkbox is unchecked
0267: */
0268: public CheckBox(String strName, int vntLeft, int vntTop,
0269: int vntWidth, int vntHeight, String strText, int CHECKED) {
0270: super ((Context) null, (String) null, (ScriptProxy) null);
0271: ScriptBuffer script = new ScriptBuffer();
0272: script.appendCall("new CheckBox", strName, vntLeft, vntTop,
0273: vntWidth, vntHeight, strText, CHECKED);
0274: setInitScript(script);
0275: }
0276:
0277: /**
0278: * The instance initializer.
0279: * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application
0280: * @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
0281: * @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
0282: * @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
0283: * @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
0284: * @param strText text/HTML markup to display with the checkbox;
0285: * @param CHECKED if jsx3.gui.CheckBox.CHECKED or null, checkbox is checked; if jsx3.gui.CheckBox.UNCHECKED checkbox is unchecked
0286: */
0287: public CheckBox(String strName, int vntLeft, int vntTop,
0288: int vntWidth, String vntHeight, String strText, int CHECKED) {
0289: super ((Context) null, (String) null, (ScriptProxy) null);
0290: ScriptBuffer script = new ScriptBuffer();
0291: script.appendCall("new CheckBox", strName, vntLeft, vntTop,
0292: vntWidth, vntHeight, strText, CHECKED);
0293: setInitScript(script);
0294: }
0295:
0296: /**
0297: * The instance initializer.
0298: * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application
0299: * @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
0300: * @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
0301: * @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
0302: * @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
0303: * @param strText text/HTML markup to display with the checkbox;
0304: * @param CHECKED if jsx3.gui.CheckBox.CHECKED or null, checkbox is checked; if jsx3.gui.CheckBox.UNCHECKED checkbox is unchecked
0305: */
0306: public CheckBox(String strName, int vntLeft, int vntTop,
0307: String vntWidth, int vntHeight, String strText, int CHECKED) {
0308: super ((Context) null, (String) null, (ScriptProxy) null);
0309: ScriptBuffer script = new ScriptBuffer();
0310: script.appendCall("new CheckBox", strName, vntLeft, vntTop,
0311: vntWidth, vntHeight, strText, CHECKED);
0312: setInitScript(script);
0313: }
0314:
0315: /**
0316: * The instance initializer.
0317: * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application
0318: * @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
0319: * @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
0320: * @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
0321: * @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
0322: * @param strText text/HTML markup to display with the checkbox;
0323: * @param CHECKED if jsx3.gui.CheckBox.CHECKED or null, checkbox is checked; if jsx3.gui.CheckBox.UNCHECKED checkbox is unchecked
0324: */
0325: public CheckBox(String strName, int vntLeft, String vntTop,
0326: int vntWidth, String vntHeight, String strText, int CHECKED) {
0327: super ((Context) null, (String) null, (ScriptProxy) null);
0328: ScriptBuffer script = new ScriptBuffer();
0329: script.appendCall("new CheckBox", strName, vntLeft, vntTop,
0330: vntWidth, vntHeight, strText, CHECKED);
0331: setInitScript(script);
0332: }
0333:
0334: /**
0335: * The instance initializer.
0336: * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application
0337: * @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
0338: * @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
0339: * @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
0340: * @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
0341: * @param strText text/HTML markup to display with the checkbox;
0342: * @param CHECKED if jsx3.gui.CheckBox.CHECKED or null, checkbox is checked; if jsx3.gui.CheckBox.UNCHECKED checkbox is unchecked
0343: */
0344: public CheckBox(String strName, String vntLeft, String vntTop,
0345: String vntWidth, String vntHeight, String strText,
0346: int CHECKED) {
0347: super ((Context) null, (String) null, (ScriptProxy) null);
0348: ScriptBuffer script = new ScriptBuffer();
0349: script.appendCall("new CheckBox", strName, vntLeft, vntTop,
0350: vntWidth, vntHeight, strText, CHECKED);
0351: setInitScript(script);
0352: }
0353:
0354: /**
0355: * 0: unchecked (default)
0356: */
0357: public static final int UNCHECKED = 0;
0358:
0359: /**
0360: * 1: checked
0361: */
0362: public static final int CHECKED = 1;
0363:
0364: /**
0365: * 2: dashed
0366: */
0367: public static final int PARTIAL = 2;
0368:
0369: /**
0370: * jsx30checkbox
0371: */
0372: public static final String DEFAULTCLASSNAME = "jsx30checkbox";
0373:
0374: /**
0375: * Returns state of checkbox when it was first initialized; to get the current state, use: getChecked();
0376: * @param callback one of: jsx3.gui.CheckBox.CHECKED or jsx3.gui.CheckBox.UNCHECKED
0377: */
0378: @SuppressWarnings("unchecked")
0379: public void getDefaultChecked(
0380: org.directwebremoting.proxy.Callback<Integer> callback) {
0381: ScriptBuffer script = new ScriptBuffer();
0382: String callbackPrefix = "";
0383:
0384: if (callback != null) {
0385: callbackPrefix = "var reply = ";
0386: }
0387:
0388: script.appendCall(callbackPrefix + getContextPath()
0389: + "getDefaultChecked");
0390:
0391: if (callback != null) {
0392: String key = org.directwebremoting.extend.CallbackHelper
0393: .saveCallback(callback, Integer.class);
0394: script
0395: .appendCall("__System.activateCallback", key,
0396: "reply");
0397: }
0398:
0399: getScriptProxy().addScript(script);
0400: }
0401:
0402: /**
0403: * Sets state of checkbox when it is first initialized; returns reference to self
0404: * @param CHECKED one of: jsx3.gui.CheckBox.CHECKED or jsx3.gui.CheckBox.UNCHECKED
0405: * @return this object
0406: */
0407: public jsx3.gui.CheckBox setDefaultChecked(int CHECKED) {
0408: ScriptBuffer script = new ScriptBuffer();
0409: script.appendCall(getContextPath() + "setDefaultChecked",
0410: CHECKED);
0411: getScriptProxy().addScript(script);
0412: return this ;
0413: }
0414:
0415: /**
0416: * Returns current state of checkbox; to get the state of the checkbox when it was first initialized, use: getDefaultChecked(). Default: jsx3.gui.CheckBox.CHECKED
0417: * @param callback one of: jsx3.gui.CheckBox.CHECKED or jsx3.gui.CheckBox.UNCHECKED
0418: */
0419: @SuppressWarnings("unchecked")
0420: public void getChecked(
0421: org.directwebremoting.proxy.Callback<Integer> callback) {
0422: ScriptBuffer script = new ScriptBuffer();
0423: String callbackPrefix = "";
0424:
0425: if (callback != null) {
0426: callbackPrefix = "var reply = ";
0427: }
0428:
0429: script.appendCall(callbackPrefix + getContextPath()
0430: + "getChecked");
0431:
0432: if (callback != null) {
0433: String key = org.directwebremoting.extend.CallbackHelper
0434: .saveCallback(callback, Integer.class);
0435: script
0436: .appendCall("__System.activateCallback", key,
0437: "reply");
0438: }
0439:
0440: getScriptProxy().addScript(script);
0441: }
0442:
0443: /**
0444: * Sets the state of this checkbox. This method will execute the TOGGLE model event only under the
0445: deprecated 3.0 model event protocol.
0446: * @param intChecked <code>CHECKED</code> or <code>UNCHECKED</code>
0447: * @return this object
0448: */
0449: public jsx3.gui.CheckBox setChecked(int intChecked) {
0450: ScriptBuffer script = new ScriptBuffer();
0451: script.appendCall(getContextPath() + "setChecked", intChecked);
0452: getScriptProxy().addScript(script);
0453: return this ;
0454: }
0455:
0456: /**
0457: * validates that the checkbox is checked if it is required (e.g., [object].setRequired()); returns (as well as sets as a property on the object) one of: jsx3.gui.Form.STATEVALID jsx3.gui.Form.INSTATEVALID
0458: * @param callback one of: jsx3.gui.Form.STATEVALID jsx3.gui.Form.INSTATEVALID
0459: */
0460: @SuppressWarnings("unchecked")
0461: public void doValidate(
0462: org.directwebremoting.proxy.Callback<Integer> callback) {
0463: ScriptBuffer script = new ScriptBuffer();
0464: String callbackPrefix = "";
0465:
0466: if (callback != null) {
0467: callbackPrefix = "var reply = ";
0468: }
0469:
0470: script.appendCall(callbackPrefix + getContextPath()
0471: + "doValidate");
0472:
0473: if (callback != null) {
0474: String key = org.directwebremoting.extend.CallbackHelper
0475: .saveCallback(callback, Integer.class);
0476: script
0477: .appendCall("__System.activateCallback", key,
0478: "reply");
0479: }
0480:
0481: getScriptProxy().addScript(script);
0482: }
0483:
0484: /**
0485: * Binds the given key sequence to a callback function. Any object that has a key binding (specified with
0486: setKeyBinding()) will call this method when painted to register the key sequence with an appropriate
0487: ancestor of this form control. Any key down event that bubbles up to the ancestor without being intercepted
0488: and matches the given key sequence will invoke the given callback function.
0489:
0490: As of 3.2: The hot key will be registered with the first ancestor found that is either a
0491: jsx3.gui.Window, a jsx3.gui.Dialog, or the root block of a jsx3.app.Server.
0492: * @param fctCallback JavaScript function to execute when the given sequence is keyed by the user.
0493: * @param strKeys a plus-delimited ('+') key sequence such as <code>ctrl+s</code> or
0494: <code>ctrl+shift+alt+h</code> or <code>shift+a</code>, etc. Any combination of shift, ctrl, and alt are
0495: supported, including none. Also supported as the final token are <code>enter</code>, <code>esc</code>,
0496: <code>tab</code>, <code>del</code>, and <code>space</code>. To specify the final token as a key code, the
0497: last token can be the key code contained in brackets, <code>[13]</code>.
0498: * @return the registered hot key.
0499: */
0500: @SuppressWarnings("unchecked")
0501: public jsx3.gui.HotKey doKeyBinding(
0502: org.directwebremoting.proxy.CodeBlock fctCallback,
0503: String strKeys) {
0504: String extension = "doKeyBinding(\"" + fctCallback + "\", \""
0505: + strKeys + "\").";
0506: try {
0507: java.lang.reflect.Constructor<jsx3.gui.HotKey> ctor = jsx3.gui.HotKey.class
0508: .getConstructor(Context.class, String.class,
0509: ScriptProxy.class);
0510: return ctor.newInstance(this , extension, getScriptProxy());
0511: } catch (Exception ex) {
0512: throw new IllegalArgumentException("Unsupported type: "
0513: + jsx3.gui.HotKey.class.getName());
0514: }
0515: }
0516:
0517: /**
0518: * Resets the validation state of this control.
0519: * @return this object.
0520: */
0521: @SuppressWarnings("unchecked")
0522: public jsx3.gui.Form doReset() {
0523: String extension = "doReset().";
0524: try {
0525: java.lang.reflect.Constructor<jsx3.gui.Form> ctor = jsx3.gui.Form.class
0526: .getConstructor(Context.class, String.class,
0527: ScriptProxy.class);
0528: return ctor.newInstance(this , extension, getScriptProxy());
0529: } catch (Exception ex) {
0530: throw new IllegalArgumentException("Unsupported type: "
0531: + jsx3.gui.Form.class.getName());
0532: }
0533: }
0534:
0535: /**
0536: * Resets the validation state of this control.
0537: * @param returnType The expected return type
0538: * @return this object.
0539: */
0540: @SuppressWarnings("unchecked")
0541: public <T> T doReset(Class<T> returnType) {
0542: String extension = "doReset().";
0543: try {
0544: java.lang.reflect.Constructor<T> ctor = returnType
0545: .getConstructor(Context.class, String.class,
0546: ScriptProxy.class);
0547: return ctor.newInstance(this , extension, getScriptProxy());
0548: } catch (Exception ex) {
0549: throw new IllegalArgumentException(
0550: "Unsupported return type: " + returnType.getName());
0551: }
0552: }
0553:
0554: /**
0555: * Returns the background color of this control when it is disabled.
0556: * @param callback valid CSS property value, (i.e., red, #ff0000)
0557: */
0558: @SuppressWarnings("unchecked")
0559: public void getDisabledBackgroundColor(
0560: org.directwebremoting.proxy.Callback<String> callback) {
0561: ScriptBuffer script = new ScriptBuffer();
0562: String callbackPrefix = "";
0563:
0564: if (callback != null) {
0565: callbackPrefix = "var reply = ";
0566: }
0567:
0568: script.appendCall(callbackPrefix + getContextPath()
0569: + "getDisabledBackgroundColor");
0570:
0571: if (callback != null) {
0572: String key = org.directwebremoting.extend.CallbackHelper
0573: .saveCallback(callback, String.class);
0574: script
0575: .appendCall("__System.activateCallback", key,
0576: "reply");
0577: }
0578:
0579: getScriptProxy().addScript(script);
0580: }
0581:
0582: /**
0583: * Returns the font color to use when this control is disabled.
0584: * @param callback valid CSS property value, (i.e., red, #ff0000)
0585: */
0586: @SuppressWarnings("unchecked")
0587: public void getDisabledColor(
0588: org.directwebremoting.proxy.Callback<String> callback) {
0589: ScriptBuffer script = new ScriptBuffer();
0590: String callbackPrefix = "";
0591:
0592: if (callback != null) {
0593: callbackPrefix = "var reply = ";
0594: }
0595:
0596: script.appendCall(callbackPrefix + getContextPath()
0597: + "getDisabledColor");
0598:
0599: if (callback != null) {
0600: String key = org.directwebremoting.extend.CallbackHelper
0601: .saveCallback(callback, String.class);
0602: script
0603: .appendCall("__System.activateCallback", key,
0604: "reply");
0605: }
0606:
0607: getScriptProxy().addScript(script);
0608: }
0609:
0610: /**
0611: * Returns the state for the form field control. If no enabled state is set, this method returns
0612: STATEENABLED.
0613: * @param callback <code>STATEDISABLED</code> or <code>STATEENABLED</code>.
0614: */
0615: @SuppressWarnings("unchecked")
0616: public void getEnabled(
0617: org.directwebremoting.proxy.Callback<Integer> callback) {
0618: ScriptBuffer script = new ScriptBuffer();
0619: String callbackPrefix = "";
0620:
0621: if (callback != null) {
0622: callbackPrefix = "var reply = ";
0623: }
0624:
0625: script.appendCall(callbackPrefix + getContextPath()
0626: + "getEnabled");
0627:
0628: if (callback != null) {
0629: String key = org.directwebremoting.extend.CallbackHelper
0630: .saveCallback(callback, Integer.class);
0631: script
0632: .appendCall("__System.activateCallback", key,
0633: "reply");
0634: }
0635:
0636: getScriptProxy().addScript(script);
0637: }
0638:
0639: /**
0640: * Returns the key binding that when keyed will fire the execute event for this control.
0641: * @param callback plus-delimited (e.g.,'+') key sequence such as ctrl+s or ctrl+shift+alt+h or shift+a, etc
0642: */
0643: @SuppressWarnings("unchecked")
0644: public void getKeyBinding(
0645: org.directwebremoting.proxy.Callback<String> callback) {
0646: ScriptBuffer script = new ScriptBuffer();
0647: String callbackPrefix = "";
0648:
0649: if (callback != null) {
0650: callbackPrefix = "var reply = ";
0651: }
0652:
0653: script.appendCall(callbackPrefix + getContextPath()
0654: + "getKeyBinding");
0655:
0656: if (callback != null) {
0657: String key = org.directwebremoting.extend.CallbackHelper
0658: .saveCallback(callback, String.class);
0659: script
0660: .appendCall("__System.activateCallback", key,
0661: "reply");
0662: }
0663:
0664: getScriptProxy().addScript(script);
0665: }
0666:
0667: /**
0668: * Returns whether or not this control is required. If the required property has never been set, this method returns
0669: OPTIONAL.
0670: * @param callback <code>REQUIRED</code> or <code>OPTIONAL</code>.
0671: */
0672: @SuppressWarnings("unchecked")
0673: public void getRequired(
0674: org.directwebremoting.proxy.Callback<Integer> callback) {
0675: ScriptBuffer script = new ScriptBuffer();
0676: String callbackPrefix = "";
0677:
0678: if (callback != null) {
0679: callbackPrefix = "var reply = ";
0680: }
0681:
0682: script.appendCall(callbackPrefix + getContextPath()
0683: + "getRequired");
0684:
0685: if (callback != null) {
0686: String key = org.directwebremoting.extend.CallbackHelper
0687: .saveCallback(callback, Integer.class);
0688: script
0689: .appendCall("__System.activateCallback", key,
0690: "reply");
0691: }
0692:
0693: getScriptProxy().addScript(script);
0694: }
0695:
0696: /**
0697: * Returns the validation state of this control. If the validationState property has never been set, this method returns
0698: STATEVALID.
0699: * @param callback <code>STATEINVALID</code> or <code>STATEVALID</code>.
0700: */
0701: @SuppressWarnings("unchecked")
0702: public void getValidationState(
0703: org.directwebremoting.proxy.Callback<Integer> callback) {
0704: ScriptBuffer script = new ScriptBuffer();
0705: String callbackPrefix = "";
0706:
0707: if (callback != null) {
0708: callbackPrefix = "var reply = ";
0709: }
0710:
0711: script.appendCall(callbackPrefix + getContextPath()
0712: + "getValidationState");
0713:
0714: if (callback != null) {
0715: String key = org.directwebremoting.extend.CallbackHelper
0716: .saveCallback(callback, Integer.class);
0717: script
0718: .appendCall("__System.activateCallback", key,
0719: "reply");
0720: }
0721:
0722: getScriptProxy().addScript(script);
0723: }
0724:
0725: /**
0726: * Returns the value of this control.
0727: */
0728: @SuppressWarnings("unchecked")
0729: public void getValue(
0730: org.directwebremoting.proxy.Callback<Integer> callback) {
0731: ScriptBuffer script = new ScriptBuffer();
0732: String callbackPrefix = "";
0733:
0734: if (callback != null) {
0735: callbackPrefix = "var reply = ";
0736: }
0737:
0738: script.appendCall(callbackPrefix + getContextPath()
0739: + "getValue");
0740:
0741: if (callback != null) {
0742: String key = org.directwebremoting.extend.CallbackHelper
0743: .saveCallback(callback, Integer.class);
0744: script
0745: .appendCall("__System.activateCallback", key,
0746: "reply");
0747: }
0748:
0749: getScriptProxy().addScript(script);
0750: }
0751:
0752: /**
0753: * Sets the background color of this form control when it is disabled.
0754: * @param strColor valid CSS property value, (i.e., red, #ff0000)
0755: * @return this object.
0756: */
0757: @SuppressWarnings("unchecked")
0758: public jsx3.gui.Form setDisabledBackgroundColor(String strColor) {
0759: String extension = "setDisabledBackgroundColor(\"" + strColor
0760: + "\").";
0761: try {
0762: java.lang.reflect.Constructor<jsx3.gui.Form> ctor = jsx3.gui.Form.class
0763: .getConstructor(Context.class, String.class,
0764: ScriptProxy.class);
0765: return ctor.newInstance(this , extension, getScriptProxy());
0766: } catch (Exception ex) {
0767: throw new IllegalArgumentException("Unsupported type: "
0768: + jsx3.gui.Form.class.getName());
0769: }
0770: }
0771:
0772: /**
0773: * Sets the background color of this form control when it is disabled.
0774: * @param strColor valid CSS property value, (i.e., red, #ff0000)
0775: * @param returnType The expected return type
0776: * @return this object.
0777: */
0778: @SuppressWarnings("unchecked")
0779: public <T> T setDisabledBackgroundColor(String strColor,
0780: Class<T> returnType) {
0781: String extension = "setDisabledBackgroundColor(\"" + strColor
0782: + "\").";
0783: try {
0784: java.lang.reflect.Constructor<T> ctor = returnType
0785: .getConstructor(Context.class, String.class,
0786: ScriptProxy.class);
0787: return ctor.newInstance(this , extension, getScriptProxy());
0788: } catch (Exception ex) {
0789: throw new IllegalArgumentException(
0790: "Unsupported return type: " + returnType.getName());
0791: }
0792: }
0793:
0794: /**
0795: * Sets the font color to use when this control is disabled.
0796: * @param strColor valid CSS property value, (i.e., red, #ff0000)
0797: * @return this object.
0798: */
0799: @SuppressWarnings("unchecked")
0800: public jsx3.gui.Form setDisabledColor(String strColor) {
0801: String extension = "setDisabledColor(\"" + strColor + "\").";
0802: try {
0803: java.lang.reflect.Constructor<jsx3.gui.Form> ctor = jsx3.gui.Form.class
0804: .getConstructor(Context.class, String.class,
0805: ScriptProxy.class);
0806: return ctor.newInstance(this , extension, getScriptProxy());
0807: } catch (Exception ex) {
0808: throw new IllegalArgumentException("Unsupported type: "
0809: + jsx3.gui.Form.class.getName());
0810: }
0811: }
0812:
0813: /**
0814: * Sets the font color to use when this control is disabled.
0815: * @param strColor valid CSS property value, (i.e., red, #ff0000)
0816: * @param returnType The expected return type
0817: * @return this object.
0818: */
0819: @SuppressWarnings("unchecked")
0820: public <T> T setDisabledColor(String strColor, Class<T> returnType) {
0821: String extension = "setDisabledColor(\"" + strColor + "\").";
0822: try {
0823: java.lang.reflect.Constructor<T> ctor = returnType
0824: .getConstructor(Context.class, String.class,
0825: ScriptProxy.class);
0826: return ctor.newInstance(this , extension, getScriptProxy());
0827: } catch (Exception ex) {
0828: throw new IllegalArgumentException(
0829: "Unsupported return type: " + returnType.getName());
0830: }
0831: }
0832:
0833: /**
0834: * Sets whether this control is enabled. Disabled controls do not respond to user interaction.
0835: * @param intEnabled <code>STATEDISABLED</code> or <code>STATEENABLED</code>. <code>null</code> is
0836: equivalent to <code>STATEENABLED</code>.
0837: * @param bRepaint if <code>true</code> this control is immediately repainted to reflect the new setting.
0838: */
0839: public void setEnabled(int intEnabled, boolean bRepaint) {
0840: ScriptBuffer script = new ScriptBuffer();
0841: script.appendCall(getContextPath() + "setEnabled", intEnabled,
0842: bRepaint);
0843: getScriptProxy().addScript(script);
0844: }
0845:
0846: /**
0847: * Sets the key binding that when keyed will fire the bound execute (jsx3.gui.Interactive.EXECUTE)
0848: event for this control.
0849: * @param strSequence plus-delimited (e.g.,'+') key sequence such as ctrl+s or ctrl+shift+alt+h or shift+a, etc
0850: * @return this object.
0851: */
0852: @SuppressWarnings("unchecked")
0853: public jsx3.gui.Form setKeyBinding(String strSequence) {
0854: String extension = "setKeyBinding(\"" + strSequence + "\").";
0855: try {
0856: java.lang.reflect.Constructor<jsx3.gui.Form> ctor = jsx3.gui.Form.class
0857: .getConstructor(Context.class, String.class,
0858: ScriptProxy.class);
0859: return ctor.newInstance(this , extension, getScriptProxy());
0860: } catch (Exception ex) {
0861: throw new IllegalArgumentException("Unsupported type: "
0862: + jsx3.gui.Form.class.getName());
0863: }
0864: }
0865:
0866: /**
0867: * Sets the key binding that when keyed will fire the bound execute (jsx3.gui.Interactive.EXECUTE)
0868: event for this control.
0869: * @param strSequence plus-delimited (e.g.,'+') key sequence such as ctrl+s or ctrl+shift+alt+h or shift+a, etc
0870: * @param returnType The expected return type
0871: * @return this object.
0872: */
0873: @SuppressWarnings("unchecked")
0874: public <T> T setKeyBinding(String strSequence, Class<T> returnType) {
0875: String extension = "setKeyBinding(\"" + strSequence + "\").";
0876: try {
0877: java.lang.reflect.Constructor<T> ctor = returnType
0878: .getConstructor(Context.class, String.class,
0879: ScriptProxy.class);
0880: return ctor.newInstance(this , extension, getScriptProxy());
0881: } catch (Exception ex) {
0882: throw new IllegalArgumentException(
0883: "Unsupported return type: " + returnType.getName());
0884: }
0885: }
0886:
0887: /**
0888: * Sets whether or not this control is required.
0889: * @param required {int} <code>REQUIRED</code> or <code>OPTIONAL</code>.
0890: * @return this object.
0891: */
0892: @SuppressWarnings("unchecked")
0893: public jsx3.gui.Form setRequired(int required) {
0894: String extension = "setRequired(\"" + required + "\").";
0895: try {
0896: java.lang.reflect.Constructor<jsx3.gui.Form> ctor = jsx3.gui.Form.class
0897: .getConstructor(Context.class, String.class,
0898: ScriptProxy.class);
0899: return ctor.newInstance(this , extension, getScriptProxy());
0900: } catch (Exception ex) {
0901: throw new IllegalArgumentException("Unsupported type: "
0902: + jsx3.gui.Form.class.getName());
0903: }
0904: }
0905:
0906: /**
0907: * Sets whether or not this control is required.
0908: * @param required {int} <code>REQUIRED</code> or <code>OPTIONAL</code>.
0909: * @param returnType The expected return type
0910: * @return this object.
0911: */
0912: @SuppressWarnings("unchecked")
0913: public <T> T setRequired(int required, Class<T> returnType) {
0914: String extension = "setRequired(\"" + required + "\").";
0915: try {
0916: java.lang.reflect.Constructor<T> ctor = returnType
0917: .getConstructor(Context.class, String.class,
0918: ScriptProxy.class);
0919: return ctor.newInstance(this , extension, getScriptProxy());
0920: } catch (Exception ex) {
0921: throw new IllegalArgumentException(
0922: "Unsupported return type: " + returnType.getName());
0923: }
0924: }
0925:
0926: /**
0927: * Sets the validation state of this control. The validation state of a control is not serialized.
0928: * @param intState <code>STATEINVALID</code> or <code>STATEVALID</code>.
0929: * @return this object.
0930: */
0931: @SuppressWarnings("unchecked")
0932: public jsx3.gui.Form setValidationState(int intState) {
0933: String extension = "setValidationState(\"" + intState + "\").";
0934: try {
0935: java.lang.reflect.Constructor<jsx3.gui.Form> ctor = jsx3.gui.Form.class
0936: .getConstructor(Context.class, String.class,
0937: ScriptProxy.class);
0938: return ctor.newInstance(this , extension, getScriptProxy());
0939: } catch (Exception ex) {
0940: throw new IllegalArgumentException("Unsupported type: "
0941: + jsx3.gui.Form.class.getName());
0942: }
0943: }
0944:
0945: /**
0946: * Sets the validation state of this control. The validation state of a control is not serialized.
0947: * @param intState <code>STATEINVALID</code> or <code>STATEVALID</code>.
0948: * @param returnType The expected return type
0949: * @return this object.
0950: */
0951: @SuppressWarnings("unchecked")
0952: public <T> T setValidationState(int intState, Class<T> returnType) {
0953: String extension = "setValidationState(\"" + intState + "\").";
0954: try {
0955: java.lang.reflect.Constructor<T> ctor = returnType
0956: .getConstructor(Context.class, String.class,
0957: ScriptProxy.class);
0958: return ctor.newInstance(this , extension, getScriptProxy());
0959: } catch (Exception ex) {
0960: throw new IllegalArgumentException(
0961: "Unsupported return type: " + returnType.getName());
0962: }
0963: }
0964:
0965: /**
0966: * Sets the value of this control.
0967: * @param vntValue string/int value for the component
0968: * @return this object.
0969: */
0970: @SuppressWarnings("unchecked")
0971: public jsx3.gui.Form setValue(String vntValue) {
0972: String extension = "setValue(\"" + vntValue + "\").";
0973: try {
0974: java.lang.reflect.Constructor<jsx3.gui.Form> ctor = jsx3.gui.Form.class
0975: .getConstructor(Context.class, String.class,
0976: ScriptProxy.class);
0977: return ctor.newInstance(this , extension, getScriptProxy());
0978: } catch (Exception ex) {
0979: throw new IllegalArgumentException("Unsupported type: "
0980: + jsx3.gui.Form.class.getName());
0981: }
0982: }
0983:
0984: /**
0985: * Sets the value of this control.
0986: * @param vntValue string/int value for the component
0987: * @param returnType The expected return type
0988: * @return this object.
0989: */
0990: @SuppressWarnings("unchecked")
0991: public <T> T setValue(String vntValue, Class<T> returnType) {
0992: String extension = "setValue(\"" + vntValue + "\").";
0993: try {
0994: java.lang.reflect.Constructor<T> ctor = returnType
0995: .getConstructor(Context.class, String.class,
0996: ScriptProxy.class);
0997: return ctor.newInstance(this , extension, getScriptProxy());
0998: } catch (Exception ex) {
0999: throw new IllegalArgumentException(
1000: "Unsupported return type: " + returnType.getName());
1001: }
1002: }
1003:
1004: /**
1005: * Sets the value of this control.
1006: * @param vntValue string/int value for the component
1007: * @return this object.
1008: */
1009: @SuppressWarnings("unchecked")
1010: public jsx3.gui.Form setValue(Integer vntValue) {
1011: String extension = "setValue(\"" + vntValue + "\").";
1012: try {
1013: java.lang.reflect.Constructor<jsx3.gui.Form> ctor = jsx3.gui.Form.class
1014: .getConstructor(Context.class, String.class,
1015: ScriptProxy.class);
1016: return ctor.newInstance(this , extension, getScriptProxy());
1017: } catch (Exception ex) {
1018: throw new IllegalArgumentException("Unsupported type: "
1019: + jsx3.gui.Form.class.getName());
1020: }
1021: }
1022:
1023: /**
1024: * Sets the value of this control.
1025: * @param vntValue string/int value for the component
1026: * @param returnType The expected return type
1027: * @return this object.
1028: */
1029: @SuppressWarnings("unchecked")
1030: public <T> T setValue(Integer vntValue, Class<T> returnType) {
1031: String extension = "setValue(\"" + vntValue + "\").";
1032: try {
1033: java.lang.reflect.Constructor<T> ctor = returnType
1034: .getConstructor(Context.class, String.class,
1035: ScriptProxy.class);
1036: return ctor.newInstance(this , extension, getScriptProxy());
1037: } catch (Exception ex) {
1038: throw new IllegalArgumentException(
1039: "Unsupported return type: " + returnType.getName());
1040: }
1041: }
1042:
1043: }
|