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: * The JSX version of a standard GUI select box. XML drives the contents of the select box.
0024:
0025: This class requires a CDF data source. The supported CDF attributes are:
0026:
0027: jsxid Ð the required unique record id.
0028: jsxtext Ð the text to display in the select box for the record.
0029: jsxtip Ð the tip to show when the mouse hovers over the record.
0030: jsxstyle Ð the CSS style to apply to the record.
0031: jsximg Ð a relative path to an image (16x16) to display to the left of @jsxtext.
0032: * @author Joe Walker [joe at getahead dot org]
0033: * @author DRAPGEN - Dwr Reverse Ajax Proxy GENerator
0034: */
0035: public class Select 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 Select(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 strSelectedValue this value should correspond to the XML value for the node whose text should be preloaded in the select box when it is painted
0054: */
0055: public Select(String strName, int vntLeft, int vntTop,
0056: int vntWidth, int vntHeight, String strSelectedValue) {
0057: super ((Context) null, (String) null, (ScriptProxy) null);
0058: ScriptBuffer script = new ScriptBuffer();
0059: script.appendCall("new Select", strName, vntLeft, vntTop,
0060: vntWidth, vntHeight, strSelectedValue);
0061: setInitScript(script);
0062: }
0063:
0064: /**
0065: * The instance initializer.
0066: * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application
0067: * @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
0068: * @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
0069: * @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
0070: * @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
0071: * @param strSelectedValue this value should correspond to the XML value for the node whose text should be preloaded in the select box when it is painted
0072: */
0073: public Select(String strName, int vntLeft, int vntTop,
0074: String vntWidth, int vntHeight, String strSelectedValue) {
0075: super ((Context) null, (String) null, (ScriptProxy) null);
0076: ScriptBuffer script = new ScriptBuffer();
0077: script.appendCall("new Select", strName, vntLeft, vntTop,
0078: vntWidth, vntHeight, strSelectedValue);
0079: setInitScript(script);
0080: }
0081:
0082: /**
0083: * The instance initializer.
0084: * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application
0085: * @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
0086: * @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
0087: * @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
0088: * @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
0089: * @param strSelectedValue this value should correspond to the XML value for the node whose text should be preloaded in the select box when it is painted
0090: */
0091: public Select(String strName, int vntLeft, String vntTop,
0092: String vntWidth, String vntHeight, String strSelectedValue) {
0093: super ((Context) null, (String) null, (ScriptProxy) null);
0094: ScriptBuffer script = new ScriptBuffer();
0095: script.appendCall("new Select", strName, vntLeft, vntTop,
0096: vntWidth, vntHeight, strSelectedValue);
0097: setInitScript(script);
0098: }
0099:
0100: /**
0101: * The instance initializer.
0102: * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application
0103: * @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
0104: * @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
0105: * @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
0106: * @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
0107: * @param strSelectedValue this value should correspond to the XML value for the node whose text should be preloaded in the select box when it is painted
0108: */
0109: public Select(String strName, String vntLeft, String vntTop,
0110: String vntWidth, String vntHeight, String strSelectedValue) {
0111: super ((Context) null, (String) null, (ScriptProxy) null);
0112: ScriptBuffer script = new ScriptBuffer();
0113: script.appendCall("new Select", strName, vntLeft, vntTop,
0114: vntWidth, vntHeight, strSelectedValue);
0115: setInitScript(script);
0116: }
0117:
0118: /**
0119: * The instance initializer.
0120: * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application
0121: * @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
0122: * @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
0123: * @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
0124: * @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
0125: * @param strSelectedValue this value should correspond to the XML value for the node whose text should be preloaded in the select box when it is painted
0126: */
0127: public Select(String strName, String vntLeft, int vntTop,
0128: String vntWidth, String vntHeight, String strSelectedValue) {
0129: super ((Context) null, (String) null, (ScriptProxy) null);
0130: ScriptBuffer script = new ScriptBuffer();
0131: script.appendCall("new Select", strName, vntLeft, vntTop,
0132: vntWidth, vntHeight, strSelectedValue);
0133: setInitScript(script);
0134: }
0135:
0136: /**
0137: * The instance initializer.
0138: * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application
0139: * @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
0140: * @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
0141: * @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
0142: * @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
0143: * @param strSelectedValue this value should correspond to the XML value for the node whose text should be preloaded in the select box when it is painted
0144: */
0145: public Select(String strName, String vntLeft, int vntTop,
0146: int vntWidth, String vntHeight, String strSelectedValue) {
0147: super ((Context) null, (String) null, (ScriptProxy) null);
0148: ScriptBuffer script = new ScriptBuffer();
0149: script.appendCall("new Select", strName, vntLeft, vntTop,
0150: vntWidth, vntHeight, strSelectedValue);
0151: setInitScript(script);
0152: }
0153:
0154: /**
0155: * The instance initializer.
0156: * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application
0157: * @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
0158: * @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
0159: * @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
0160: * @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
0161: * @param strSelectedValue this value should correspond to the XML value for the node whose text should be preloaded in the select box when it is painted
0162: */
0163: public Select(String strName, String vntLeft, String vntTop,
0164: int vntWidth, String vntHeight, String strSelectedValue) {
0165: super ((Context) null, (String) null, (ScriptProxy) null);
0166: ScriptBuffer script = new ScriptBuffer();
0167: script.appendCall("new Select", strName, vntLeft, vntTop,
0168: vntWidth, vntHeight, strSelectedValue);
0169: setInitScript(script);
0170: }
0171:
0172: /**
0173: * The 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 strSelectedValue this value should correspond to the XML value for the node whose text should be preloaded in the select box when it is painted
0180: */
0181: public Select(String strName, int vntLeft, String vntTop,
0182: String vntWidth, int vntHeight, String strSelectedValue) {
0183: super ((Context) null, (String) null, (ScriptProxy) null);
0184: ScriptBuffer script = new ScriptBuffer();
0185: script.appendCall("new Select", strName, vntLeft, vntTop,
0186: vntWidth, vntHeight, strSelectedValue);
0187: setInitScript(script);
0188: }
0189:
0190: /**
0191: * The instance initializer.
0192: * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application
0193: * @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
0194: * @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
0195: * @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
0196: * @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
0197: * @param strSelectedValue this value should correspond to the XML value for the node whose text should be preloaded in the select box when it is painted
0198: */
0199: public Select(String strName, int vntLeft, String vntTop,
0200: int vntWidth, String vntHeight, String strSelectedValue) {
0201: super ((Context) null, (String) null, (ScriptProxy) null);
0202: ScriptBuffer script = new ScriptBuffer();
0203: script.appendCall("new Select", strName, vntLeft, vntTop,
0204: vntWidth, vntHeight, strSelectedValue);
0205: setInitScript(script);
0206: }
0207:
0208: /**
0209: * The instance initializer.
0210: * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application
0211: * @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
0212: * @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
0213: * @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
0214: * @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
0215: * @param strSelectedValue this value should correspond to the XML value for the node whose text should be preloaded in the select box when it is painted
0216: */
0217: public Select(String strName, String vntLeft, int vntTop,
0218: String vntWidth, int vntHeight, String strSelectedValue) {
0219: super ((Context) null, (String) null, (ScriptProxy) null);
0220: ScriptBuffer script = new ScriptBuffer();
0221: script.appendCall("new Select", strName, vntLeft, vntTop,
0222: vntWidth, vntHeight, strSelectedValue);
0223: setInitScript(script);
0224: }
0225:
0226: /**
0227: * The instance initializer.
0228: * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application
0229: * @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
0230: * @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
0231: * @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
0232: * @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
0233: * @param strSelectedValue this value should correspond to the XML value for the node whose text should be preloaded in the select box when it is painted
0234: */
0235: public Select(String strName, int vntLeft, int vntTop,
0236: int vntWidth, String vntHeight, String strSelectedValue) {
0237: super ((Context) null, (String) null, (ScriptProxy) null);
0238: ScriptBuffer script = new ScriptBuffer();
0239: script.appendCall("new Select", strName, vntLeft, vntTop,
0240: vntWidth, vntHeight, strSelectedValue);
0241: setInitScript(script);
0242: }
0243:
0244: /**
0245: * The instance initializer.
0246: * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application
0247: * @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
0248: * @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
0249: * @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
0250: * @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
0251: * @param strSelectedValue this value should correspond to the XML value for the node whose text should be preloaded in the select box when it is painted
0252: */
0253: public Select(String strName, int vntLeft, int vntTop,
0254: String vntWidth, String vntHeight, String strSelectedValue) {
0255: super ((Context) null, (String) null, (ScriptProxy) null);
0256: ScriptBuffer script = new ScriptBuffer();
0257: script.appendCall("new Select", strName, vntLeft, vntTop,
0258: vntWidth, vntHeight, strSelectedValue);
0259: setInitScript(script);
0260: }
0261:
0262: /**
0263: * The instance initializer.
0264: * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application
0265: * @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
0266: * @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
0267: * @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
0268: * @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
0269: * @param strSelectedValue this value should correspond to the XML value for the node whose text should be preloaded in the select box when it is painted
0270: */
0271: public Select(String strName, int vntLeft, String vntTop,
0272: int vntWidth, int vntHeight, String strSelectedValue) {
0273: super ((Context) null, (String) null, (ScriptProxy) null);
0274: ScriptBuffer script = new ScriptBuffer();
0275: script.appendCall("new Select", strName, vntLeft, vntTop,
0276: vntWidth, vntHeight, strSelectedValue);
0277: setInitScript(script);
0278: }
0279:
0280: /**
0281: * The instance initializer.
0282: * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application
0283: * @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
0284: * @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
0285: * @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
0286: * @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
0287: * @param strSelectedValue this value should correspond to the XML value for the node whose text should be preloaded in the select box when it is painted
0288: */
0289: public Select(String strName, String vntLeft, String vntTop,
0290: String vntWidth, int vntHeight, String strSelectedValue) {
0291: super ((Context) null, (String) null, (ScriptProxy) null);
0292: ScriptBuffer script = new ScriptBuffer();
0293: script.appendCall("new Select", strName, vntLeft, vntTop,
0294: vntWidth, vntHeight, strSelectedValue);
0295: setInitScript(script);
0296: }
0297:
0298: /**
0299: * The instance initializer.
0300: * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application
0301: * @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
0302: * @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
0303: * @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
0304: * @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
0305: * @param strSelectedValue this value should correspond to the XML value for the node whose text should be preloaded in the select box when it is painted
0306: */
0307: public Select(String strName, String vntLeft, String vntTop,
0308: int vntWidth, int vntHeight, String strSelectedValue) {
0309: super ((Context) null, (String) null, (ScriptProxy) null);
0310: ScriptBuffer script = new ScriptBuffer();
0311: script.appendCall("new Select", strName, vntLeft, vntTop,
0312: vntWidth, vntHeight, strSelectedValue);
0313: setInitScript(script);
0314: }
0315:
0316: /**
0317: * The instance initializer.
0318: * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application
0319: * @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
0320: * @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
0321: * @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
0322: * @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
0323: * @param strSelectedValue this value should correspond to the XML value for the node whose text should be preloaded in the select box when it is painted
0324: */
0325: public Select(String strName, String vntLeft, int vntTop,
0326: int vntWidth, int vntHeight, String strSelectedValue) {
0327: super ((Context) null, (String) null, (ScriptProxy) null);
0328: ScriptBuffer script = new ScriptBuffer();
0329: script.appendCall("new Select", strName, vntLeft, vntTop,
0330: vntWidth, vntHeight, strSelectedValue);
0331: setInitScript(script);
0332: }
0333:
0334: /**
0335: * The URL of the default XSL template of a normal select box.
0336: */
0337: public static final String DEFAULTXSLURL = null;
0338:
0339: /**
0340: * The URL of the arrow image.
0341: */
0342: public static final String ARROWICON = null;
0343:
0344: /**
0345: * The URL of the mouse over background image.
0346: */
0347: public static final String OVERIMAGE = null;
0348:
0349: /**
0350: * The URL of the selected background image.
0351: */
0352: public static final String SELECTEDIMAGE = null;
0353:
0354: /**
0355: * Value of the type field indicating a normal select box.
0356: */
0357: public static final int TYPESELECT = 0;
0358:
0359: /**
0360: * Value of the type field indicating a combo select box.
0361: */
0362: public static final int TYPECOMBO = 1;
0363:
0364: /**
0365: * The number of milliseconds of delay for the combo typeahead function.
0366: */
0367: public static final int TYPEAHEADDELAY = 250;
0368:
0369: /**
0370: * jsx30select_select
0371: */
0372: public static final String DEFAULTCLASSNAME = "jsx30select_select";
0373:
0374: /**
0375: * Returns the XSL appropriate to the select type (either combo or select) if no custom XSLT is specified.
0376: * @return jsx3.xml.Document instance
0377: */
0378: @SuppressWarnings("unchecked")
0379: public jsx3.xml.CdfDocument getXSL() {
0380: String extension = "getXSL().";
0381: try {
0382: java.lang.reflect.Constructor<jsx3.xml.CdfDocument> ctor = jsx3.xml.CdfDocument.class
0383: .getConstructor(Context.class, String.class,
0384: ScriptProxy.class);
0385: return ctor.newInstance(this , extension, getScriptProxy());
0386: } catch (Exception ex) {
0387: throw new IllegalArgumentException("Unsupported type: "
0388: + jsx3.xml.CdfDocument.class.getName());
0389: }
0390: }
0391:
0392: /**
0393: * Returns the XSL appropriate to the select type (either combo or select) if no custom XSLT is specified.
0394: * @param returnType The expected return type
0395: * @return jsx3.xml.Document instance
0396: */
0397: @SuppressWarnings("unchecked")
0398: public <T> T getXSL(Class<T> returnType) {
0399: String extension = "getXSL().";
0400: try {
0401: java.lang.reflect.Constructor<T> ctor = returnType
0402: .getConstructor(Context.class, String.class,
0403: ScriptProxy.class);
0404: return ctor.newInstance(this , extension, getScriptProxy());
0405: } catch (Exception ex) {
0406: throw new IllegalArgumentException(
0407: "Unsupported return type: " + returnType.getName());
0408: }
0409: }
0410:
0411: /**
0412: * Returns STATEVALID if this select box is not required or if it is required and its value is not
0413: empty. If this select is of type combo then any value other than an empty string is valid, otherwise only values
0414: corresponding to an actual CDF record of this select are valid.
0415: * @param callback <code>jsx3.gui.Form.STATEVALID</code> or <code>jsx3.gui.Form.STATEINVALID</code>.
0416: */
0417: @SuppressWarnings("unchecked")
0418: public void doValidate(
0419: org.directwebremoting.proxy.Callback<Integer> callback) {
0420: ScriptBuffer script = new ScriptBuffer();
0421: String callbackPrefix = "";
0422:
0423: if (callback != null) {
0424: callbackPrefix = "var reply = ";
0425: }
0426:
0427: script.appendCall(callbackPrefix + getContextPath()
0428: + "doValidate");
0429:
0430: if (callback != null) {
0431: String key = org.directwebremoting.extend.CallbackHelper
0432: .saveCallback(callback, Integer.class);
0433: script
0434: .appendCall("__System.activateCallback", key,
0435: "reply");
0436: }
0437:
0438: getScriptProxy().addScript(script);
0439: }
0440:
0441: /**
0442: * Returns the type of this select box.
0443: * @param callback <code>TYPESELECT</code> or <code>TYPECOMBO</code>.
0444: */
0445: @SuppressWarnings("unchecked")
0446: public void getType(
0447: org.directwebremoting.proxy.Callback<Integer> callback) {
0448: ScriptBuffer script = new ScriptBuffer();
0449: String callbackPrefix = "";
0450:
0451: if (callback != null) {
0452: callbackPrefix = "var reply = ";
0453: }
0454:
0455: script
0456: .appendCall(callbackPrefix + getContextPath()
0457: + "getType");
0458:
0459: if (callback != null) {
0460: String key = org.directwebremoting.extend.CallbackHelper
0461: .saveCallback(callback, Integer.class);
0462: script
0463: .appendCall("__System.activateCallback", key,
0464: "reply");
0465: }
0466:
0467: getScriptProxy().addScript(script);
0468: }
0469:
0470: /**
0471: * Sets the type of this select box.
0472: * @param TYPE <code>TYPESELECT</code> or <code>TYPECOMBO</code>.
0473: * @return this object.
0474: */
0475: public jsx3.gui.Select setType(int TYPE) {
0476: ScriptBuffer script = new ScriptBuffer();
0477: script.appendCall(getContextPath() + "setType", TYPE);
0478: getScriptProxy().addScript(script);
0479: return this ;
0480: }
0481:
0482: /**
0483: * Returns the text to display in this select box if the value of this select box is null.
0484: If no value has been explicitly set with setDefaultText() a value appropriate to the server locale
0485: is returned.
0486: */
0487: @SuppressWarnings("unchecked")
0488: public void getDefaultText(
0489: org.directwebremoting.proxy.Callback<String> callback) {
0490: ScriptBuffer script = new ScriptBuffer();
0491: String callbackPrefix = "";
0492:
0493: if (callback != null) {
0494: callbackPrefix = "var reply = ";
0495: }
0496:
0497: script.appendCall(callbackPrefix + getContextPath()
0498: + "getDefaultText");
0499:
0500: if (callback != null) {
0501: String key = org.directwebremoting.extend.CallbackHelper
0502: .saveCallback(callback, String.class);
0503: script
0504: .appendCall("__System.activateCallback", key,
0505: "reply");
0506: }
0507:
0508: getScriptProxy().addScript(script);
0509: }
0510:
0511: /**
0512: * Sets the text to display in this select box if the value of this select box is null.
0513: * @param strDefaultText any valid string. HTML markup is allowed, but may cause unpredicatable effects.
0514: * @return this object.
0515: */
0516: public jsx3.gui.Select setDefaultText(String strDefaultText) {
0517: ScriptBuffer script = new ScriptBuffer();
0518: script.appendCall(getContextPath() + "setDefaultText",
0519: strDefaultText);
0520: getScriptProxy().addScript(script);
0521: return this ;
0522: }
0523:
0524: /**
0525: * Displays the list of options for this select box.
0526: */
0527: public void show() {
0528: ScriptBuffer script = new ScriptBuffer();
0529: script.appendCall(getContextPath() + "show");
0530: getScriptProxy().addScript(script);
0531: }
0532:
0533: /**
0534: * Hides the drop-down portion of this select control.
0535: * @param bFocus if <code>true</code>, the form control will be focused after hiding the drop-down.
0536: */
0537: public void hide(boolean bFocus) {
0538: ScriptBuffer script = new ScriptBuffer();
0539: script.appendCall(getContextPath() + "hide", bFocus);
0540: getScriptProxy().addScript(script);
0541: }
0542:
0543: /**
0544: * Sets the selected record of this select control. Fires the SELECT event only under the deprecated
0545: 3.0 model event protocol.
0546: * @param strRecordId id for the record that will be the selected item.
0547: * @return this object.
0548: */
0549: public jsx3.gui.Select setValue(String strRecordId) {
0550: ScriptBuffer script = new ScriptBuffer();
0551: script.appendCall(getContextPath() + "setValue", strRecordId);
0552: getScriptProxy().addScript(script);
0553: return this ;
0554: }
0555:
0556: /**
0557: * Returns the value of this select box. The value is the jsxid attribute of the selected CDF record.
0558: * @param callback the value or <code>null</code> if no record is selected.
0559: */
0560: @SuppressWarnings("unchecked")
0561: public void getValue(
0562: org.directwebremoting.proxy.Callback<String> callback) {
0563: ScriptBuffer script = new ScriptBuffer();
0564: String callbackPrefix = "";
0565:
0566: if (callback != null) {
0567: callbackPrefix = "var reply = ";
0568: }
0569:
0570: script.appendCall(callbackPrefix + getContextPath()
0571: + "getValue");
0572:
0573: if (callback != null) {
0574: String key = org.directwebremoting.extend.CallbackHelper
0575: .saveCallback(callback, String.class);
0576: script
0577: .appendCall("__System.activateCallback", key,
0578: "reply");
0579: }
0580:
0581: getScriptProxy().addScript(script);
0582: }
0583:
0584: /**
0585: * Redraws one record from the CDF data source of this select box. If strRecordId is equal to the
0586: selected record id, the text of this select box is set to the value of the record's jsxtext attribute.
0587: * @param strRecordId the id of the record that will be redrawn.
0588: * @param intAction <code>INSERT</code>, <code>UPDATE</code>, or <code>DELETE</code>.
0589: * @return this object.
0590: */
0591: @SuppressWarnings("unchecked")
0592: public jsx3.gui.Select redrawRecord(String strRecordId,
0593: int intAction) {
0594: String extension = "redrawRecord(\"" + strRecordId + "\", \""
0595: + intAction + "\").";
0596: try {
0597: java.lang.reflect.Constructor<jsx3.gui.Select> ctor = jsx3.gui.Select.class
0598: .getConstructor(Context.class, String.class,
0599: ScriptProxy.class);
0600: return ctor.newInstance(this , extension, getScriptProxy());
0601: } catch (Exception ex) {
0602: throw new IllegalArgumentException("Unsupported type: "
0603: + jsx3.gui.Select.class.getName());
0604: }
0605: }
0606:
0607: /**
0608: * Returns the maximum length allowed for the input field of this combo control. This setting only has meaning if
0609: this control is of type TYPECOMBO.
0610: */
0611: @SuppressWarnings("unchecked")
0612: public void getMaxLength(
0613: org.directwebremoting.proxy.Callback<Integer> callback) {
0614: ScriptBuffer script = new ScriptBuffer();
0615: String callbackPrefix = "";
0616:
0617: if (callback != null) {
0618: callbackPrefix = "var reply = ";
0619: }
0620:
0621: script.appendCall(callbackPrefix + getContextPath()
0622: + "getMaxLength");
0623:
0624: if (callback != null) {
0625: String key = org.directwebremoting.extend.CallbackHelper
0626: .saveCallback(callback, Integer.class);
0627: script
0628: .appendCall("__System.activateCallback", key,
0629: "reply");
0630: }
0631:
0632: getScriptProxy().addScript(script);
0633: }
0634:
0635: /**
0636: * Sets the maximum length allowed for the input field of this combo control.
0637: * @param intMaxLength
0638: * @return this object.
0639: */
0640: public jsx3.gui.Select setMaxLength(int intMaxLength) {
0641: ScriptBuffer script = new ScriptBuffer();
0642: script.appendCall(getContextPath() + "setMaxLength",
0643: intMaxLength);
0644: getScriptProxy().addScript(script);
0645: return this ;
0646: }
0647:
0648: /**
0649: * Binds the given key sequence to a callback function. Any object that has a key binding (specified with
0650: setKeyBinding()) will call this method when painted to register the key sequence with an appropriate
0651: ancestor of this form control. Any key down event that bubbles up to the ancestor without being intercepted
0652: and matches the given key sequence will invoke the given callback function.
0653:
0654: As of 3.2: The hot key will be registered with the first ancestor found that is either a
0655: jsx3.gui.Window, a jsx3.gui.Dialog, or the root block of a jsx3.app.Server.
0656: * @param fctCallback JavaScript function to execute when the given sequence is keyed by the user.
0657: * @param strKeys a plus-delimited ('+') key sequence such as <code>ctrl+s</code> or
0658: <code>ctrl+shift+alt+h</code> or <code>shift+a</code>, etc. Any combination of shift, ctrl, and alt are
0659: supported, including none. Also supported as the final token are <code>enter</code>, <code>esc</code>,
0660: <code>tab</code>, <code>del</code>, and <code>space</code>. To specify the final token as a key code, the
0661: last token can be the key code contained in brackets, <code>[13]</code>.
0662: * @return the registered hot key.
0663: */
0664: @SuppressWarnings("unchecked")
0665: public jsx3.gui.HotKey doKeyBinding(
0666: org.directwebremoting.proxy.CodeBlock fctCallback,
0667: String strKeys) {
0668: String extension = "doKeyBinding(\"" + fctCallback + "\", \""
0669: + strKeys + "\").";
0670: try {
0671: java.lang.reflect.Constructor<jsx3.gui.HotKey> ctor = jsx3.gui.HotKey.class
0672: .getConstructor(Context.class, String.class,
0673: ScriptProxy.class);
0674: return ctor.newInstance(this , extension, getScriptProxy());
0675: } catch (Exception ex) {
0676: throw new IllegalArgumentException("Unsupported type: "
0677: + jsx3.gui.HotKey.class.getName());
0678: }
0679: }
0680:
0681: /**
0682: * Resets the validation state of this control.
0683: * @return this object.
0684: */
0685: @SuppressWarnings("unchecked")
0686: public jsx3.gui.Form doReset() {
0687: String extension = "doReset().";
0688: try {
0689: java.lang.reflect.Constructor<jsx3.gui.Form> ctor = jsx3.gui.Form.class
0690: .getConstructor(Context.class, String.class,
0691: ScriptProxy.class);
0692: return ctor.newInstance(this , extension, getScriptProxy());
0693: } catch (Exception ex) {
0694: throw new IllegalArgumentException("Unsupported type: "
0695: + jsx3.gui.Form.class.getName());
0696: }
0697: }
0698:
0699: /**
0700: * Resets the validation state of this control.
0701: * @param returnType The expected return type
0702: * @return this object.
0703: */
0704: @SuppressWarnings("unchecked")
0705: public <T> T doReset(Class<T> returnType) {
0706: String extension = "doReset().";
0707: try {
0708: java.lang.reflect.Constructor<T> ctor = returnType
0709: .getConstructor(Context.class, String.class,
0710: ScriptProxy.class);
0711: return ctor.newInstance(this , extension, getScriptProxy());
0712: } catch (Exception ex) {
0713: throw new IllegalArgumentException(
0714: "Unsupported return type: " + returnType.getName());
0715: }
0716: }
0717:
0718: /**
0719: * Returns the background color of this control when it is disabled.
0720: * @param callback valid CSS property value, (i.e., red, #ff0000)
0721: */
0722: @SuppressWarnings("unchecked")
0723: public void getDisabledBackgroundColor(
0724: org.directwebremoting.proxy.Callback<String> callback) {
0725: ScriptBuffer script = new ScriptBuffer();
0726: String callbackPrefix = "";
0727:
0728: if (callback != null) {
0729: callbackPrefix = "var reply = ";
0730: }
0731:
0732: script.appendCall(callbackPrefix + getContextPath()
0733: + "getDisabledBackgroundColor");
0734:
0735: if (callback != null) {
0736: String key = org.directwebremoting.extend.CallbackHelper
0737: .saveCallback(callback, String.class);
0738: script
0739: .appendCall("__System.activateCallback", key,
0740: "reply");
0741: }
0742:
0743: getScriptProxy().addScript(script);
0744: }
0745:
0746: /**
0747: * Returns the font color to use when this control is disabled.
0748: * @param callback valid CSS property value, (i.e., red, #ff0000)
0749: */
0750: @SuppressWarnings("unchecked")
0751: public void getDisabledColor(
0752: org.directwebremoting.proxy.Callback<String> callback) {
0753: ScriptBuffer script = new ScriptBuffer();
0754: String callbackPrefix = "";
0755:
0756: if (callback != null) {
0757: callbackPrefix = "var reply = ";
0758: }
0759:
0760: script.appendCall(callbackPrefix + getContextPath()
0761: + "getDisabledColor");
0762:
0763: if (callback != null) {
0764: String key = org.directwebremoting.extend.CallbackHelper
0765: .saveCallback(callback, String.class);
0766: script
0767: .appendCall("__System.activateCallback", key,
0768: "reply");
0769: }
0770:
0771: getScriptProxy().addScript(script);
0772: }
0773:
0774: /**
0775: * Returns the state for the form field control. If no enabled state is set, this method returns
0776: STATEENABLED.
0777: * @param callback <code>STATEDISABLED</code> or <code>STATEENABLED</code>.
0778: */
0779: @SuppressWarnings("unchecked")
0780: public void getEnabled(
0781: org.directwebremoting.proxy.Callback<Integer> callback) {
0782: ScriptBuffer script = new ScriptBuffer();
0783: String callbackPrefix = "";
0784:
0785: if (callback != null) {
0786: callbackPrefix = "var reply = ";
0787: }
0788:
0789: script.appendCall(callbackPrefix + getContextPath()
0790: + "getEnabled");
0791:
0792: if (callback != null) {
0793: String key = org.directwebremoting.extend.CallbackHelper
0794: .saveCallback(callback, Integer.class);
0795: script
0796: .appendCall("__System.activateCallback", key,
0797: "reply");
0798: }
0799:
0800: getScriptProxy().addScript(script);
0801: }
0802:
0803: /**
0804: * Returns the key binding that when keyed will fire the execute event for this control.
0805: * @param callback plus-delimited (e.g.,'+') key sequence such as ctrl+s or ctrl+shift+alt+h or shift+a, etc
0806: */
0807: @SuppressWarnings("unchecked")
0808: public void getKeyBinding(
0809: org.directwebremoting.proxy.Callback<String> callback) {
0810: ScriptBuffer script = new ScriptBuffer();
0811: String callbackPrefix = "";
0812:
0813: if (callback != null) {
0814: callbackPrefix = "var reply = ";
0815: }
0816:
0817: script.appendCall(callbackPrefix + getContextPath()
0818: + "getKeyBinding");
0819:
0820: if (callback != null) {
0821: String key = org.directwebremoting.extend.CallbackHelper
0822: .saveCallback(callback, String.class);
0823: script
0824: .appendCall("__System.activateCallback", key,
0825: "reply");
0826: }
0827:
0828: getScriptProxy().addScript(script);
0829: }
0830:
0831: /**
0832: * Returns whether or not this control is required. If the required property has never been set, this method returns
0833: OPTIONAL.
0834: * @param callback <code>REQUIRED</code> or <code>OPTIONAL</code>.
0835: */
0836: @SuppressWarnings("unchecked")
0837: public void getRequired(
0838: org.directwebremoting.proxy.Callback<Integer> callback) {
0839: ScriptBuffer script = new ScriptBuffer();
0840: String callbackPrefix = "";
0841:
0842: if (callback != null) {
0843: callbackPrefix = "var reply = ";
0844: }
0845:
0846: script.appendCall(callbackPrefix + getContextPath()
0847: + "getRequired");
0848:
0849: if (callback != null) {
0850: String key = org.directwebremoting.extend.CallbackHelper
0851: .saveCallback(callback, Integer.class);
0852: script
0853: .appendCall("__System.activateCallback", key,
0854: "reply");
0855: }
0856:
0857: getScriptProxy().addScript(script);
0858: }
0859:
0860: /**
0861: * Returns the validation state of this control. If the validationState property has never been set, this method returns
0862: STATEVALID.
0863: * @param callback <code>STATEINVALID</code> or <code>STATEVALID</code>.
0864: */
0865: @SuppressWarnings("unchecked")
0866: public void getValidationState(
0867: org.directwebremoting.proxy.Callback<Integer> callback) {
0868: ScriptBuffer script = new ScriptBuffer();
0869: String callbackPrefix = "";
0870:
0871: if (callback != null) {
0872: callbackPrefix = "var reply = ";
0873: }
0874:
0875: script.appendCall(callbackPrefix + getContextPath()
0876: + "getValidationState");
0877:
0878: if (callback != null) {
0879: String key = org.directwebremoting.extend.CallbackHelper
0880: .saveCallback(callback, Integer.class);
0881: script
0882: .appendCall("__System.activateCallback", key,
0883: "reply");
0884: }
0885:
0886: getScriptProxy().addScript(script);
0887: }
0888:
0889: /**
0890: * Sets the background color of this form control when it is disabled.
0891: * @param strColor valid CSS property value, (i.e., red, #ff0000)
0892: * @return this object.
0893: */
0894: @SuppressWarnings("unchecked")
0895: public jsx3.gui.Form setDisabledBackgroundColor(String strColor) {
0896: String extension = "setDisabledBackgroundColor(\"" + strColor
0897: + "\").";
0898: try {
0899: java.lang.reflect.Constructor<jsx3.gui.Form> ctor = jsx3.gui.Form.class
0900: .getConstructor(Context.class, String.class,
0901: ScriptProxy.class);
0902: return ctor.newInstance(this , extension, getScriptProxy());
0903: } catch (Exception ex) {
0904: throw new IllegalArgumentException("Unsupported type: "
0905: + jsx3.gui.Form.class.getName());
0906: }
0907: }
0908:
0909: /**
0910: * Sets the background color of this form control when it is disabled.
0911: * @param strColor valid CSS property value, (i.e., red, #ff0000)
0912: * @param returnType The expected return type
0913: * @return this object.
0914: */
0915: @SuppressWarnings("unchecked")
0916: public <T> T setDisabledBackgroundColor(String strColor,
0917: Class<T> returnType) {
0918: String extension = "setDisabledBackgroundColor(\"" + strColor
0919: + "\").";
0920: try {
0921: java.lang.reflect.Constructor<T> ctor = returnType
0922: .getConstructor(Context.class, String.class,
0923: ScriptProxy.class);
0924: return ctor.newInstance(this , extension, getScriptProxy());
0925: } catch (Exception ex) {
0926: throw new IllegalArgumentException(
0927: "Unsupported return type: " + returnType.getName());
0928: }
0929: }
0930:
0931: /**
0932: * Sets the font color to use when this control is disabled.
0933: * @param strColor valid CSS property value, (i.e., red, #ff0000)
0934: * @return this object.
0935: */
0936: @SuppressWarnings("unchecked")
0937: public jsx3.gui.Form setDisabledColor(String strColor) {
0938: String extension = "setDisabledColor(\"" + strColor + "\").";
0939: try {
0940: java.lang.reflect.Constructor<jsx3.gui.Form> ctor = jsx3.gui.Form.class
0941: .getConstructor(Context.class, String.class,
0942: ScriptProxy.class);
0943: return ctor.newInstance(this , extension, getScriptProxy());
0944: } catch (Exception ex) {
0945: throw new IllegalArgumentException("Unsupported type: "
0946: + jsx3.gui.Form.class.getName());
0947: }
0948: }
0949:
0950: /**
0951: * Sets the font color to use when this control is disabled.
0952: * @param strColor valid CSS property value, (i.e., red, #ff0000)
0953: * @param returnType The expected return type
0954: * @return this object.
0955: */
0956: @SuppressWarnings("unchecked")
0957: public <T> T setDisabledColor(String strColor, Class<T> returnType) {
0958: String extension = "setDisabledColor(\"" + strColor + "\").";
0959: try {
0960: java.lang.reflect.Constructor<T> ctor = returnType
0961: .getConstructor(Context.class, String.class,
0962: ScriptProxy.class);
0963: return ctor.newInstance(this , extension, getScriptProxy());
0964: } catch (Exception ex) {
0965: throw new IllegalArgumentException(
0966: "Unsupported return type: " + returnType.getName());
0967: }
0968: }
0969:
0970: /**
0971: * Sets whether this control is enabled. Disabled controls do not respond to user interaction.
0972: * @param intEnabled <code>STATEDISABLED</code> or <code>STATEENABLED</code>. <code>null</code> is
0973: equivalent to <code>STATEENABLED</code>.
0974: * @param bRepaint if <code>true</code> this control is immediately repainted to reflect the new setting.
0975: */
0976: public void setEnabled(int intEnabled, boolean bRepaint) {
0977: ScriptBuffer script = new ScriptBuffer();
0978: script.appendCall(getContextPath() + "setEnabled", intEnabled,
0979: bRepaint);
0980: getScriptProxy().addScript(script);
0981: }
0982:
0983: /**
0984: * Sets the key binding that when keyed will fire the bound execute (jsx3.gui.Interactive.EXECUTE)
0985: event for this control.
0986: * @param strSequence plus-delimited (e.g.,'+') key sequence such as ctrl+s or ctrl+shift+alt+h or shift+a, etc
0987: * @return this object.
0988: */
0989: @SuppressWarnings("unchecked")
0990: public jsx3.gui.Form setKeyBinding(String strSequence) {
0991: String extension = "setKeyBinding(\"" + strSequence + "\").";
0992: try {
0993: java.lang.reflect.Constructor<jsx3.gui.Form> ctor = jsx3.gui.Form.class
0994: .getConstructor(Context.class, String.class,
0995: ScriptProxy.class);
0996: return ctor.newInstance(this , extension, getScriptProxy());
0997: } catch (Exception ex) {
0998: throw new IllegalArgumentException("Unsupported type: "
0999: + jsx3.gui.Form.class.getName());
1000: }
1001: }
1002:
1003: /**
1004: * Sets the key binding that when keyed will fire the bound execute (jsx3.gui.Interactive.EXECUTE)
1005: event for this control.
1006: * @param strSequence plus-delimited (e.g.,'+') key sequence such as ctrl+s or ctrl+shift+alt+h or shift+a, etc
1007: * @param returnType The expected return type
1008: * @return this object.
1009: */
1010: @SuppressWarnings("unchecked")
1011: public <T> T setKeyBinding(String strSequence, Class<T> returnType) {
1012: String extension = "setKeyBinding(\"" + strSequence + "\").";
1013: try {
1014: java.lang.reflect.Constructor<T> ctor = returnType
1015: .getConstructor(Context.class, String.class,
1016: ScriptProxy.class);
1017: return ctor.newInstance(this , extension, getScriptProxy());
1018: } catch (Exception ex) {
1019: throw new IllegalArgumentException(
1020: "Unsupported return type: " + returnType.getName());
1021: }
1022: }
1023:
1024: /**
1025: * Sets whether or not this control is required.
1026: * @param required {int} <code>REQUIRED</code> or <code>OPTIONAL</code>.
1027: * @return this object.
1028: */
1029: @SuppressWarnings("unchecked")
1030: public jsx3.gui.Form setRequired(int required) {
1031: String extension = "setRequired(\"" + required + "\").";
1032: try {
1033: java.lang.reflect.Constructor<jsx3.gui.Form> ctor = jsx3.gui.Form.class
1034: .getConstructor(Context.class, String.class,
1035: ScriptProxy.class);
1036: return ctor.newInstance(this , extension, getScriptProxy());
1037: } catch (Exception ex) {
1038: throw new IllegalArgumentException("Unsupported type: "
1039: + jsx3.gui.Form.class.getName());
1040: }
1041: }
1042:
1043: /**
1044: * Sets whether or not this control is required.
1045: * @param required {int} <code>REQUIRED</code> or <code>OPTIONAL</code>.
1046: * @param returnType The expected return type
1047: * @return this object.
1048: */
1049: @SuppressWarnings("unchecked")
1050: public <T> T setRequired(int required, Class<T> returnType) {
1051: String extension = "setRequired(\"" + required + "\").";
1052: try {
1053: java.lang.reflect.Constructor<T> ctor = returnType
1054: .getConstructor(Context.class, String.class,
1055: ScriptProxy.class);
1056: return ctor.newInstance(this , extension, getScriptProxy());
1057: } catch (Exception ex) {
1058: throw new IllegalArgumentException(
1059: "Unsupported return type: " + returnType.getName());
1060: }
1061: }
1062:
1063: /**
1064: * Sets the validation state of this control. The validation state of a control is not serialized.
1065: * @param intState <code>STATEINVALID</code> or <code>STATEVALID</code>.
1066: * @return this object.
1067: */
1068: @SuppressWarnings("unchecked")
1069: public jsx3.gui.Form setValidationState(int intState) {
1070: String extension = "setValidationState(\"" + intState + "\").";
1071: try {
1072: java.lang.reflect.Constructor<jsx3.gui.Form> ctor = jsx3.gui.Form.class
1073: .getConstructor(Context.class, String.class,
1074: ScriptProxy.class);
1075: return ctor.newInstance(this , extension, getScriptProxy());
1076: } catch (Exception ex) {
1077: throw new IllegalArgumentException("Unsupported type: "
1078: + jsx3.gui.Form.class.getName());
1079: }
1080: }
1081:
1082: /**
1083: * Sets the validation state of this control. The validation state of a control is not serialized.
1084: * @param intState <code>STATEINVALID</code> or <code>STATEVALID</code>.
1085: * @param returnType The expected return type
1086: * @return this object.
1087: */
1088: @SuppressWarnings("unchecked")
1089: public <T> T setValidationState(int intState, Class<T> returnType) {
1090: String extension = "setValidationState(\"" + intState + "\").";
1091: try {
1092: java.lang.reflect.Constructor<T> ctor = returnType
1093: .getConstructor(Context.class, String.class,
1094: ScriptProxy.class);
1095: return ctor.newInstance(this , extension, getScriptProxy());
1096: } catch (Exception ex) {
1097: throw new IllegalArgumentException(
1098: "Unsupported return type: " + returnType.getName());
1099: }
1100: }
1101:
1102: /**
1103: * Resets the XML source document stored in the server cache under the XML ID of this object to an empty CDF
1104: document.
1105: */
1106: public void clearXmlData() {
1107: ScriptBuffer script = new ScriptBuffer();
1108: script.appendCall(getContextPath() + "clearXmlData");
1109: getScriptProxy().addScript(script);
1110: }
1111:
1112: /**
1113: * Returns whether this object removes its XML and XSL source documents from the cache of its server when it
1114: is destroyed.
1115: * @param callback <code>CLEANUPRESOURCES</code> or <code>SHARERESOURCES</code>.
1116: */
1117: @SuppressWarnings("unchecked")
1118: public void getShareResources(
1119: org.directwebremoting.proxy.Callback<Integer> callback) {
1120: ScriptBuffer script = new ScriptBuffer();
1121: String callbackPrefix = "";
1122:
1123: if (callback != null) {
1124: callbackPrefix = "var reply = ";
1125: }
1126:
1127: script.appendCall(callbackPrefix + getContextPath()
1128: + "getShareResources");
1129:
1130: if (callback != null) {
1131: String key = org.directwebremoting.extend.CallbackHelper
1132: .saveCallback(callback, Integer.class);
1133: script
1134: .appendCall("__System.activateCallback", key,
1135: "reply");
1136: }
1137:
1138: getScriptProxy().addScript(script);
1139: }
1140:
1141: /**
1142: * Returns the XML source document of this object. The XML document is determined by the following steps:
1143:
1144: If an XML document exists in the server cache under an ID equal to the XML ID of this object, that
1145: document is returned.
1146: If the XML string of this object is not empty, a new document is created by parsing this string.
1147: If the XML URL of this object is not empty, a new document is created by parsing the file at the location
1148: specified by the URL resolved against the server owning this object.
1149: Otherwise, an empty CDF document is returned.
1150:
1151: If a new document is created for this object (any of the steps listed above except for the first one), the
1152: following actions are also taken:
1153:
1154: If creating the document resulted in an error (XML parsing error, file not found error, etc) the offending
1155: document is returned immediately.
1156: Otherwise, setSourceXML is called on this object, passing in the created document.
1157: */
1158: @SuppressWarnings("unchecked")
1159: public jsx3.xml.CdfDocument getXML() {
1160: String extension = "getXML().";
1161: try {
1162: java.lang.reflect.Constructor<jsx3.xml.CdfDocument> ctor = jsx3.xml.CdfDocument.class
1163: .getConstructor(Context.class, String.class,
1164: ScriptProxy.class);
1165: return ctor.newInstance(this , extension, getScriptProxy());
1166: } catch (Exception ex) {
1167: throw new IllegalArgumentException("Unsupported type: "
1168: + jsx3.xml.CdfDocument.class.getName());
1169: }
1170: }
1171:
1172: /**
1173: * Returns the XML source document of this object. The XML document is determined by the following steps:
1174:
1175: If an XML document exists in the server cache under an ID equal to the XML ID of this object, that
1176: document is returned.
1177: If the XML string of this object is not empty, a new document is created by parsing this string.
1178: If the XML URL of this object is not empty, a new document is created by parsing the file at the location
1179: specified by the URL resolved against the server owning this object.
1180: Otherwise, an empty CDF document is returned.
1181:
1182: If a new document is created for this object (any of the steps listed above except for the first one), the
1183: following actions are also taken:
1184:
1185: If creating the document resulted in an error (XML parsing error, file not found error, etc) the offending
1186: document is returned immediately.
1187: Otherwise, setSourceXML is called on this object, passing in the created document.
1188: * @param returnType The expected return type
1189: */
1190: @SuppressWarnings("unchecked")
1191: public <T> T getXML(Class<T> returnType) {
1192: String extension = "getXML().";
1193: try {
1194: java.lang.reflect.Constructor<T> ctor = returnType
1195: .getConstructor(Context.class, String.class,
1196: ScriptProxy.class);
1197: return ctor.newInstance(this , extension, getScriptProxy());
1198: } catch (Exception ex) {
1199: throw new IllegalArgumentException(
1200: "Unsupported return type: " + returnType.getName());
1201: }
1202: }
1203:
1204: /**
1205: * Returns the XML ID of this object.
1206: * @param callback the XML ID.
1207: */
1208: @SuppressWarnings("unchecked")
1209: public void getXMLId(
1210: org.directwebremoting.proxy.Callback<String> callback) {
1211: ScriptBuffer script = new ScriptBuffer();
1212: String callbackPrefix = "";
1213:
1214: if (callback != null) {
1215: callbackPrefix = "var reply = ";
1216: }
1217:
1218: script.appendCall(callbackPrefix + getContextPath()
1219: + "getXMLId");
1220:
1221: if (callback != null) {
1222: String key = org.directwebremoting.extend.CallbackHelper
1223: .saveCallback(callback, String.class);
1224: script
1225: .appendCall("__System.activateCallback", key,
1226: "reply");
1227: }
1228:
1229: getScriptProxy().addScript(script);
1230: }
1231:
1232: /**
1233: * Returns the XML string of this object.
1234: */
1235: @SuppressWarnings("unchecked")
1236: public void getXMLString(
1237: org.directwebremoting.proxy.Callback<String> callback) {
1238: ScriptBuffer script = new ScriptBuffer();
1239: String callbackPrefix = "";
1240:
1241: if (callback != null) {
1242: callbackPrefix = "var reply = ";
1243: }
1244:
1245: script.appendCall(callbackPrefix + getContextPath()
1246: + "getXMLString");
1247:
1248: if (callback != null) {
1249: String key = org.directwebremoting.extend.CallbackHelper
1250: .saveCallback(callback, String.class);
1251: script
1252: .appendCall("__System.activateCallback", key,
1253: "reply");
1254: }
1255:
1256: getScriptProxy().addScript(script);
1257: }
1258:
1259: /**
1260: * Returns the list of XML transformers of this object.
1261: */
1262: @SuppressWarnings("unchecked")
1263: public void getXMLTransformers(
1264: org.directwebremoting.proxy.Callback<Object[]> callback) {
1265: ScriptBuffer script = new ScriptBuffer();
1266: String callbackPrefix = "";
1267:
1268: if (callback != null) {
1269: callbackPrefix = "var reply = ";
1270: }
1271:
1272: script.appendCall(callbackPrefix + getContextPath()
1273: + "getXMLTransformers");
1274:
1275: if (callback != null) {
1276: String key = org.directwebremoting.extend.CallbackHelper
1277: .saveCallback(callback, Object[].class);
1278: script
1279: .appendCall("__System.activateCallback", key,
1280: "reply");
1281: }
1282:
1283: getScriptProxy().addScript(script);
1284: }
1285:
1286: /**
1287: * Returns the XML URL of this object.
1288: */
1289: @SuppressWarnings("unchecked")
1290: public void getXMLURL(
1291: org.directwebremoting.proxy.Callback<String> callback) {
1292: ScriptBuffer script = new ScriptBuffer();
1293: String callbackPrefix = "";
1294:
1295: if (callback != null) {
1296: callbackPrefix = "var reply = ";
1297: }
1298:
1299: script.appendCall(callbackPrefix + getContextPath()
1300: + "getXMLURL");
1301:
1302: if (callback != null) {
1303: String key = org.directwebremoting.extend.CallbackHelper
1304: .saveCallback(callback, String.class);
1305: script
1306: .appendCall("__System.activateCallback", key,
1307: "reply");
1308: }
1309:
1310: getScriptProxy().addScript(script);
1311: }
1312:
1313: /**
1314: * Returns the XSL ID of this object.
1315: */
1316: @SuppressWarnings("unchecked")
1317: public void getXSLId(
1318: org.directwebremoting.proxy.Callback<String> callback) {
1319: ScriptBuffer script = new ScriptBuffer();
1320: String callbackPrefix = "";
1321:
1322: if (callback != null) {
1323: callbackPrefix = "var reply = ";
1324: }
1325:
1326: script.appendCall(callbackPrefix + getContextPath()
1327: + "getXSLId");
1328:
1329: if (callback != null) {
1330: String key = org.directwebremoting.extend.CallbackHelper
1331: .saveCallback(callback, String.class);
1332: script
1333: .appendCall("__System.activateCallback", key,
1334: "reply");
1335: }
1336:
1337: getScriptProxy().addScript(script);
1338: }
1339:
1340: /**
1341: * Returns a map containing all the parameters to pass to the XSL stylesheet during transformation.
1342: */
1343: @SuppressWarnings("unchecked")
1344: public jsx3.lang.Object getXSLParams() {
1345: String extension = "getXSLParams().";
1346: try {
1347: java.lang.reflect.Constructor<jsx3.lang.Object> ctor = jsx3.lang.Object.class
1348: .getConstructor(Context.class, String.class,
1349: ScriptProxy.class);
1350: return ctor.newInstance(this , extension, getScriptProxy());
1351: } catch (Exception ex) {
1352: throw new IllegalArgumentException("Unsupported type: "
1353: + jsx3.lang.Object.class.getName());
1354: }
1355: }
1356:
1357: /**
1358: * Returns a map containing all the parameters to pass to the XSL stylesheet during transformation.
1359: * @param returnType The expected return type
1360: */
1361: @SuppressWarnings("unchecked")
1362: public <T> T getXSLParams(Class<T> returnType) {
1363: String extension = "getXSLParams().";
1364: try {
1365: java.lang.reflect.Constructor<T> ctor = returnType
1366: .getConstructor(Context.class, String.class,
1367: ScriptProxy.class);
1368: return ctor.newInstance(this , extension, getScriptProxy());
1369: } catch (Exception ex) {
1370: throw new IllegalArgumentException(
1371: "Unsupported return type: " + returnType.getName());
1372: }
1373: }
1374:
1375: /**
1376: * Returns whether the XML data source of this object is loaded asynchronously.
1377: * @param callback <code>0</code> or <code>1</code>.
1378: */
1379: @SuppressWarnings("unchecked")
1380: public void getXmlAsync(
1381: org.directwebremoting.proxy.Callback<Integer> callback) {
1382: ScriptBuffer script = new ScriptBuffer();
1383: String callbackPrefix = "";
1384:
1385: if (callback != null) {
1386: callbackPrefix = "var reply = ";
1387: }
1388:
1389: script.appendCall(callbackPrefix + getContextPath()
1390: + "getXmlAsync");
1391:
1392: if (callback != null) {
1393: String key = org.directwebremoting.extend.CallbackHelper
1394: .saveCallback(callback, Integer.class);
1395: script
1396: .appendCall("__System.activateCallback", key,
1397: "reply");
1398: }
1399:
1400: getScriptProxy().addScript(script);
1401: }
1402:
1403: /**
1404: * Returns whether this object is bound to the XML document stored in the data cache.
1405: * @param callback <code>0</code> or <code>1</code>.
1406: */
1407: @SuppressWarnings("unchecked")
1408: public void getXmlBind(
1409: org.directwebremoting.proxy.Callback<Integer> callback) {
1410: ScriptBuffer script = new ScriptBuffer();
1411: String callbackPrefix = "";
1412:
1413: if (callback != null) {
1414: callbackPrefix = "var reply = ";
1415: }
1416:
1417: script.appendCall(callbackPrefix + getContextPath()
1418: + "getXmlBind");
1419:
1420: if (callback != null) {
1421: String key = org.directwebremoting.extend.CallbackHelper
1422: .saveCallback(callback, Integer.class);
1423: script
1424: .appendCall("__System.activateCallback", key,
1425: "reply");
1426: }
1427:
1428: getScriptProxy().addScript(script);
1429: }
1430:
1431: /**
1432: * This method is called in two situations:
1433:
1434: When the datasource of this object finishes loading (success, error, or timeout), if the
1435: xmlAsync property of this object is true, its datasource is specified as an
1436: XML URL, and the first time doTransform() was called the datasource was still loading.
1437: Any time the value stored in the server XML cache under the key equal to the XML Id of this object
1438: changes, if the xmlBind property of this object is true.
1439:
1440: Any methods overriding this method should begin with a call to jsxsupermix().
1441: * @param objEvent the event published by the cache.
1442: */
1443: public void onXmlBinding(jsx3.lang.Object objEvent) {
1444: ScriptBuffer script = new ScriptBuffer();
1445: script.appendCall(getContextPath() + "onXmlBinding", objEvent);
1446: getScriptProxy().addScript(script);
1447: }
1448:
1449: /**
1450: * Removes a parameter from the list of parameters to pass to the XSL stylesheet during transformation.
1451: * @param strName the name of the XSL parameter to remove.
1452: * @return this object.
1453: */
1454: @SuppressWarnings("unchecked")
1455: public jsx3.xml.Cacheable removeXSLParam(String strName) {
1456: String extension = "removeXSLParam(\"" + strName + "\").";
1457: try {
1458: java.lang.reflect.Constructor<jsx3.xml.Cacheable> ctor = jsx3.xml.Cacheable.class
1459: .getConstructor(Context.class, String.class,
1460: ScriptProxy.class);
1461: return ctor.newInstance(this , extension, getScriptProxy());
1462: } catch (Exception ex) {
1463: throw new IllegalArgumentException("Unsupported type: "
1464: + jsx3.xml.Cacheable.class.getName());
1465: }
1466: }
1467:
1468: /**
1469: * Removes a parameter from the list of parameters to pass to the XSL stylesheet during transformation.
1470: * @param strName the name of the XSL parameter to remove.
1471: * @param returnType The expected return type
1472: * @return this object.
1473: */
1474: @SuppressWarnings("unchecked")
1475: public <T> T removeXSLParam(String strName, Class<T> returnType) {
1476: String extension = "removeXSLParam(\"" + strName + "\").";
1477: try {
1478: java.lang.reflect.Constructor<T> ctor = returnType
1479: .getConstructor(Context.class, String.class,
1480: ScriptProxy.class);
1481: return ctor.newInstance(this , extension, getScriptProxy());
1482: } catch (Exception ex) {
1483: throw new IllegalArgumentException(
1484: "Unsupported return type: " + returnType.getName());
1485: }
1486: }
1487:
1488: /**
1489: * Removes all parameters from the list of parameters to pass to the XSL stylesheet during transformation.
1490: * @return this object.
1491: */
1492: @SuppressWarnings("unchecked")
1493: public jsx3.xml.Cacheable removeXSLParams() {
1494: String extension = "removeXSLParams().";
1495: try {
1496: java.lang.reflect.Constructor<jsx3.xml.Cacheable> ctor = jsx3.xml.Cacheable.class
1497: .getConstructor(Context.class, String.class,
1498: ScriptProxy.class);
1499: return ctor.newInstance(this , extension, getScriptProxy());
1500: } catch (Exception ex) {
1501: throw new IllegalArgumentException("Unsupported type: "
1502: + jsx3.xml.Cacheable.class.getName());
1503: }
1504: }
1505:
1506: /**
1507: * Removes all parameters from the list of parameters to pass to the XSL stylesheet during transformation.
1508: * @param returnType The expected return type
1509: * @return this object.
1510: */
1511: @SuppressWarnings("unchecked")
1512: public <T> T removeXSLParams(Class<T> returnType) {
1513: String extension = "removeXSLParams().";
1514: try {
1515: java.lang.reflect.Constructor<T> ctor = returnType
1516: .getConstructor(Context.class, String.class,
1517: ScriptProxy.class);
1518: return ctor.newInstance(this , extension, getScriptProxy());
1519: } catch (Exception ex) {
1520: throw new IllegalArgumentException(
1521: "Unsupported return type: " + returnType.getName());
1522: }
1523: }
1524:
1525: /**
1526: * Removes the XML and XSL source documents from the server cache.
1527: * @param objServer the server owning the cache to modify. This is a required argument only if
1528: <code>this.getServer()</code> does not returns a server instance.
1529: */
1530: public void resetCacheData(jsx3.app.Server objServer) {
1531: ScriptBuffer script = new ScriptBuffer();
1532: script.appendCall(getContextPath() + "resetCacheData",
1533: objServer);
1534: getScriptProxy().addScript(script);
1535: }
1536:
1537: /**
1538: * Removes the XML source document stored under the XML ID of this object from the server cache.
1539: * @param objServer the server owning the cache to modify. This is a required argument only if
1540: <code>this.getServer()</code> does not returns a server instance.
1541: */
1542: public void resetXmlCacheData(jsx3.app.Server objServer) {
1543: ScriptBuffer script = new ScriptBuffer();
1544: script.appendCall(getContextPath() + "resetXmlCacheData",
1545: objServer);
1546: getScriptProxy().addScript(script);
1547: }
1548:
1549: /**
1550: * Sets whether this object removes its XML and XSL source documents from the cache of its server when it
1551: is destroyed.
1552: * @param intShare <code>CLEANUPRESOURCES</code> or <code>SHARERESOURCES</code>. <code>CLEANUPRESOURCES</code>
1553: is the default value if the property is <code>null</code>.
1554: * @return this object.
1555: */
1556: @SuppressWarnings("unchecked")
1557: public jsx3.xml.Cacheable setShareResources(int intShare) {
1558: String extension = "setShareResources(\"" + intShare + "\").";
1559: try {
1560: java.lang.reflect.Constructor<jsx3.xml.Cacheable> ctor = jsx3.xml.Cacheable.class
1561: .getConstructor(Context.class, String.class,
1562: ScriptProxy.class);
1563: return ctor.newInstance(this , extension, getScriptProxy());
1564: } catch (Exception ex) {
1565: throw new IllegalArgumentException("Unsupported type: "
1566: + jsx3.xml.Cacheable.class.getName());
1567: }
1568: }
1569:
1570: /**
1571: * Sets whether this object removes its XML and XSL source documents from the cache of its server when it
1572: is destroyed.
1573: * @param intShare <code>CLEANUPRESOURCES</code> or <code>SHARERESOURCES</code>. <code>CLEANUPRESOURCES</code>
1574: is the default value if the property is <code>null</code>.
1575: * @param returnType The expected return type
1576: * @return this object.
1577: */
1578: @SuppressWarnings("unchecked")
1579: public <T> T setShareResources(int intShare, Class<T> returnType) {
1580: String extension = "setShareResources(\"" + intShare + "\").";
1581: try {
1582: java.lang.reflect.Constructor<T> ctor = returnType
1583: .getConstructor(Context.class, String.class,
1584: ScriptProxy.class);
1585: return ctor.newInstance(this , extension, getScriptProxy());
1586: } catch (Exception ex) {
1587: throw new IllegalArgumentException(
1588: "Unsupported return type: " + returnType.getName());
1589: }
1590: }
1591:
1592: /**
1593: * Sets the source document of this object as though objDoc were retrieved from the XML URL or XML
1594: string of this object. This method executes the following steps:
1595:
1596: The document is transformed serially by each XML transformers of this object.
1597: The XML document is saved in the server cache under the XML ID of this object.
1598: If this object is an instance of jsx3.xml.CDF and the root node is a <data> element
1599: and its jsxassignids attribute is equal to 1, all <record> elements without a
1600: jsxid attribute are assigned a unique jsxid.
1601: If this object is an instance of jsx3.xml.CDF, convertProperties() is called
1602: on this object.
1603: * @param objDoc
1604: * @param objCache
1605: * @return the document stored in the server cache as the data source of this object. If
1606: transformers were run, this value will not be equal to the <code>objDoc</code> parameter.
1607: */
1608: @SuppressWarnings("unchecked")
1609: public jsx3.xml.CdfDocument setSourceXML(
1610: jsx3.xml.CdfDocument objDoc, jsx3.app.Cache objCache) {
1611: String extension = "setSourceXML(\"" + objDoc + "\", \""
1612: + objCache + "\").";
1613: try {
1614: java.lang.reflect.Constructor<jsx3.xml.CdfDocument> ctor = jsx3.xml.CdfDocument.class
1615: .getConstructor(Context.class, String.class,
1616: ScriptProxy.class);
1617: return ctor.newInstance(this , extension, getScriptProxy());
1618: } catch (Exception ex) {
1619: throw new IllegalArgumentException("Unsupported type: "
1620: + jsx3.xml.CdfDocument.class.getName());
1621: }
1622: }
1623:
1624: /**
1625: * Sets the source document of this object as though objDoc were retrieved from the XML URL or XML
1626: string of this object. This method executes the following steps:
1627:
1628: The document is transformed serially by each XML transformers of this object.
1629: The XML document is saved in the server cache under the XML ID of this object.
1630: If this object is an instance of jsx3.xml.CDF and the root node is a <data> element
1631: and its jsxassignids attribute is equal to 1, all <record> elements without a
1632: jsxid attribute are assigned a unique jsxid.
1633: If this object is an instance of jsx3.xml.CDF, convertProperties() is called
1634: on this object.
1635: * @param objDoc
1636: * @param objCache
1637: * @param returnType The expected return type
1638: * @return the document stored in the server cache as the data source of this object. If
1639: transformers were run, this value will not be equal to the <code>objDoc</code> parameter.
1640: */
1641: @SuppressWarnings("unchecked")
1642: public <T> T setSourceXML(jsx3.xml.CdfDocument objDoc,
1643: jsx3.app.Cache objCache, Class<T> returnType) {
1644: String extension = "setSourceXML(\"" + objDoc + "\", \""
1645: + objCache + "\").";
1646: try {
1647: java.lang.reflect.Constructor<T> ctor = returnType
1648: .getConstructor(Context.class, String.class,
1649: ScriptProxy.class);
1650: return ctor.newInstance(this , extension, getScriptProxy());
1651: } catch (Exception ex) {
1652: throw new IllegalArgumentException(
1653: "Unsupported return type: " + returnType.getName());
1654: }
1655: }
1656:
1657: /**
1658: * Sets the XML ID of this object. This value is the key under which the XML source document of this object is
1659: saved in the cache of the server owning this object. The developer may specify either a unique or shared value.
1660: If no value is specified, a unique id is generated.
1661: * @param strXMLId
1662: * @return this object.
1663: */
1664: @SuppressWarnings("unchecked")
1665: public jsx3.xml.Cacheable setXMLId(String strXMLId) {
1666: String extension = "setXMLId(\"" + strXMLId + "\").";
1667: try {
1668: java.lang.reflect.Constructor<jsx3.xml.Cacheable> ctor = jsx3.xml.Cacheable.class
1669: .getConstructor(Context.class, String.class,
1670: ScriptProxy.class);
1671: return ctor.newInstance(this , extension, getScriptProxy());
1672: } catch (Exception ex) {
1673: throw new IllegalArgumentException("Unsupported type: "
1674: + jsx3.xml.Cacheable.class.getName());
1675: }
1676: }
1677:
1678: /**
1679: * Sets the XML ID of this object. This value is the key under which the XML source document of this object is
1680: saved in the cache of the server owning this object. The developer may specify either a unique or shared value.
1681: If no value is specified, a unique id is generated.
1682: * @param strXMLId
1683: * @param returnType The expected return type
1684: * @return this object.
1685: */
1686: @SuppressWarnings("unchecked")
1687: public <T> T setXMLId(String strXMLId, Class<T> returnType) {
1688: String extension = "setXMLId(\"" + strXMLId + "\").";
1689: try {
1690: java.lang.reflect.Constructor<T> ctor = returnType
1691: .getConstructor(Context.class, String.class,
1692: ScriptProxy.class);
1693: return ctor.newInstance(this , extension, getScriptProxy());
1694: } catch (Exception ex) {
1695: throw new IllegalArgumentException(
1696: "Unsupported return type: " + returnType.getName());
1697: }
1698: }
1699:
1700: /**
1701: * Sets the XML string of this object. Setting this value to the string serialization of an XML document is one
1702: way of specifying the source XML document of this object.
1703: * @param strXML <code>null</code> or a well-formed serialized XML element.
1704: * @return this object.
1705: */
1706: @SuppressWarnings("unchecked")
1707: public jsx3.xml.Cacheable setXMLString(String strXML) {
1708: String extension = "setXMLString(\"" + strXML + "\").";
1709: try {
1710: java.lang.reflect.Constructor<jsx3.xml.Cacheable> ctor = jsx3.xml.Cacheable.class
1711: .getConstructor(Context.class, String.class,
1712: ScriptProxy.class);
1713: return ctor.newInstance(this , extension, getScriptProxy());
1714: } catch (Exception ex) {
1715: throw new IllegalArgumentException("Unsupported type: "
1716: + jsx3.xml.Cacheable.class.getName());
1717: }
1718: }
1719:
1720: /**
1721: * Sets the XML string of this object. Setting this value to the string serialization of an XML document is one
1722: way of specifying the source XML document of this object.
1723: * @param strXML <code>null</code> or a well-formed serialized XML element.
1724: * @param returnType The expected return type
1725: * @return this object.
1726: */
1727: @SuppressWarnings("unchecked")
1728: public <T> T setXMLString(String strXML, Class<T> returnType) {
1729: String extension = "setXMLString(\"" + strXML + "\").";
1730: try {
1731: java.lang.reflect.Constructor<T> ctor = returnType
1732: .getConstructor(Context.class, String.class,
1733: ScriptProxy.class);
1734: return ctor.newInstance(this , extension, getScriptProxy());
1735: } catch (Exception ex) {
1736: throw new IllegalArgumentException(
1737: "Unsupported return type: " + returnType.getName());
1738: }
1739: }
1740:
1741: /**
1742: * Sets the list of XML transformers of this object. The XML source document of this object is transformed
1743: serially by each of these transformers before it is placed in the XML cache.
1744:
1745: Each transformer is either the URI of an XSLT document (which will be resolved against the
1746: the server of this object) or the cache id of a XSLT document in the XML cache of the server
1747: of this object. When any transformer is loaded from a URI it is placed in the server cache under the id
1748: equal to its resolved URI. Any transformer that does not correspond to a valid XSLT document will be skipped
1749: without throwing an error.
1750: * @param arrTrans
1751: */
1752: public void setXMLTransformers(Object[] arrTrans) {
1753: ScriptBuffer script = new ScriptBuffer();
1754: script.appendCall(getContextPath() + "setXMLTransformers",
1755: arrTrans);
1756: getScriptProxy().addScript(script);
1757: }
1758:
1759: /**
1760: * Sets the XML URL of this object. Settings this value to the URI of an XML document is one way of specifying the
1761: source XML document of this object.
1762: * @param strXMLURL <code>null</code> or a URI that when resolved against the server owning this object
1763: specifies a valid XML document.
1764: * @return this object.
1765: */
1766: @SuppressWarnings("unchecked")
1767: public jsx3.xml.Cacheable setXMLURL(String strXMLURL) {
1768: String extension = "setXMLURL(\"" + strXMLURL + "\").";
1769: try {
1770: java.lang.reflect.Constructor<jsx3.xml.Cacheable> ctor = jsx3.xml.Cacheable.class
1771: .getConstructor(Context.class, String.class,
1772: ScriptProxy.class);
1773: return ctor.newInstance(this , extension, getScriptProxy());
1774: } catch (Exception ex) {
1775: throw new IllegalArgumentException("Unsupported type: "
1776: + jsx3.xml.Cacheable.class.getName());
1777: }
1778: }
1779:
1780: /**
1781: * Sets the XML URL of this object. Settings this value to the URI of an XML document is one way of specifying the
1782: source XML document of this object.
1783: * @param strXMLURL <code>null</code> or a URI that when resolved against the server owning this object
1784: specifies a valid XML document.
1785: * @param returnType The expected return type
1786: * @return this object.
1787: */
1788: @SuppressWarnings("unchecked")
1789: public <T> T setXMLURL(String strXMLURL, Class<T> returnType) {
1790: String extension = "setXMLURL(\"" + strXMLURL + "\").";
1791: try {
1792: java.lang.reflect.Constructor<T> ctor = returnType
1793: .getConstructor(Context.class, String.class,
1794: ScriptProxy.class);
1795: return ctor.newInstance(this , extension, getScriptProxy());
1796: } catch (Exception ex) {
1797: throw new IllegalArgumentException(
1798: "Unsupported return type: " + returnType.getName());
1799: }
1800: }
1801:
1802: /**
1803: * Adds a name/value pair to the list of parameters to pass to the XSL stylesheet during transformation. If
1804: strValue is null the parameter is removed.
1805: * @param strName the name of the XSL parameter to add.
1806: * @param strValue the value of the XSL parameter to add.
1807: * @return this object.
1808: */
1809: @SuppressWarnings("unchecked")
1810: public jsx3.xml.Cacheable setXSLParam(String strName,
1811: String strValue) {
1812: String extension = "setXSLParam(\"" + strName + "\", \""
1813: + strValue + "\").";
1814: try {
1815: java.lang.reflect.Constructor<jsx3.xml.Cacheable> ctor = jsx3.xml.Cacheable.class
1816: .getConstructor(Context.class, String.class,
1817: ScriptProxy.class);
1818: return ctor.newInstance(this , extension, getScriptProxy());
1819: } catch (Exception ex) {
1820: throw new IllegalArgumentException("Unsupported type: "
1821: + jsx3.xml.Cacheable.class.getName());
1822: }
1823: }
1824:
1825: /**
1826: * Adds a name/value pair to the list of parameters to pass to the XSL stylesheet during transformation. If
1827: strValue is null the parameter is removed.
1828: * @param strName the name of the XSL parameter to add.
1829: * @param strValue the value of the XSL parameter to add.
1830: * @param returnType The expected return type
1831: * @return this object.
1832: */
1833: @SuppressWarnings("unchecked")
1834: public <T> T setXSLParam(String strName, String strValue,
1835: Class<T> returnType) {
1836: String extension = "setXSLParam(\"" + strName + "\", \""
1837: + strValue + "\").";
1838: try {
1839: java.lang.reflect.Constructor<T> ctor = returnType
1840: .getConstructor(Context.class, String.class,
1841: ScriptProxy.class);
1842: return ctor.newInstance(this , extension, getScriptProxy());
1843: } catch (Exception ex) {
1844: throw new IllegalArgumentException(
1845: "Unsupported return type: " + returnType.getName());
1846: }
1847: }
1848:
1849: /**
1850: * Sets whether the XML data source of this object is loaded asynchronously. This setting only applies to
1851: data sources loaded from an XML URL.
1852: * @param bAsync
1853: * @return this object.
1854: */
1855: @SuppressWarnings("unchecked")
1856: public jsx3.xml.Cacheable setXmlAsync(boolean bAsync) {
1857: String extension = "setXmlAsync(\"" + bAsync + "\").";
1858: try {
1859: java.lang.reflect.Constructor<jsx3.xml.Cacheable> ctor = jsx3.xml.Cacheable.class
1860: .getConstructor(Context.class, String.class,
1861: ScriptProxy.class);
1862: return ctor.newInstance(this , extension, getScriptProxy());
1863: } catch (Exception ex) {
1864: throw new IllegalArgumentException("Unsupported type: "
1865: + jsx3.xml.Cacheable.class.getName());
1866: }
1867: }
1868:
1869: /**
1870: * Sets whether the XML data source of this object is loaded asynchronously. This setting only applies to
1871: data sources loaded from an XML URL.
1872: * @param bAsync
1873: * @param returnType The expected return type
1874: * @return this object.
1875: */
1876: @SuppressWarnings("unchecked")
1877: public <T> T setXmlAsync(boolean bAsync, Class<T> returnType) {
1878: String extension = "setXmlAsync(\"" + bAsync + "\").";
1879: try {
1880: java.lang.reflect.Constructor<T> ctor = returnType
1881: .getConstructor(Context.class, String.class,
1882: ScriptProxy.class);
1883: return ctor.newInstance(this , extension, getScriptProxy());
1884: } catch (Exception ex) {
1885: throw new IllegalArgumentException(
1886: "Unsupported return type: " + returnType.getName());
1887: }
1888: }
1889:
1890: /**
1891: * Sets whether this object is bound to the XML document stored in the data cache. If this object is bound to the
1892: cache, then the onXmlBinding() method of this object is called any time the document stored in
1893: the cache under the XML Id of this object changes.
1894: * @param bBind
1895: * @param callback <code>0</code> or <code>1</code>.
1896: */
1897: @SuppressWarnings("unchecked")
1898: public void setXmlBind(boolean bBind,
1899: org.directwebremoting.proxy.Callback<Integer> callback) {
1900: ScriptBuffer script = new ScriptBuffer();
1901: String callbackPrefix = "";
1902:
1903: if (callback != null) {
1904: callbackPrefix = "var reply = ";
1905: }
1906:
1907: script.appendCall(callbackPrefix + getContextPath()
1908: + "setXmlBind", bBind);
1909:
1910: if (callback != null) {
1911: String key = org.directwebremoting.extend.CallbackHelper
1912: .saveCallback(callback, Integer.class);
1913: script
1914: .appendCall("__System.activateCallback", key,
1915: "reply");
1916: }
1917:
1918: getScriptProxy().addScript(script);
1919: }
1920:
1921: /**
1922: * Transfers a CDF record from another object to this object. If no XML data source exists
1923: yet for this object, an empty one is created before adding the new record. This method always updates the
1924: on-screen view of both the source and destination objects.
1925:
1926: This method fails quietly if any of the following conditions apply:
1927:
1928: there is no object with id equal to strSourceId
1929:
1930: there is no record in the source object with jsxid equal to strRecordId
1931:
1932:
1933: strParentRecordId is specified and there is no record in this object with
1934: jsxid equal to strParentRecordId
1935:
1936: the this object already has a record with jsxid equal to the record to adopt
1937: * @param strSourceId <span style="text-decoration: line-through;">either the id of the source object or the</span> source object itself.
1938: * @param strRecordId the <code>jsxid</code> attribute of the data record in the source object to transfer.
1939: * @param strParentRecordId the unique <code>jsxid</code> of an existing record. If this optional parameter
1940: is provided, the adopted record will be added as a child of this record. Otherwise, the adopted record will
1941: be added to the root <code>data</code> element.
1942: * @param bRedraw forces suppression of the insert event
1943: * @return the adopted record.
1944: */
1945: @SuppressWarnings("unchecked")
1946: public jsx3.xml.Node adoptRecord(jsx3.xml.CdfDocument strSourceId,
1947: String strRecordId, String strParentRecordId,
1948: boolean bRedraw) {
1949: String extension = "adoptRecord(\"" + strSourceId + "\", \""
1950: + strRecordId + "\", \"" + strParentRecordId + "\", \""
1951: + bRedraw + "\").";
1952: try {
1953: java.lang.reflect.Constructor<jsx3.xml.Node> ctor = jsx3.xml.Node.class
1954: .getConstructor(Context.class, String.class,
1955: ScriptProxy.class);
1956: return ctor.newInstance(this , extension, getScriptProxy());
1957: } catch (Exception ex) {
1958: throw new IllegalArgumentException("Unsupported type: "
1959: + jsx3.xml.Node.class.getName());
1960: }
1961: }
1962:
1963: /**
1964: * Transfers a CDF record from another object to this object. If no XML data source exists
1965: yet for this object, an empty one is created before adding the new record. This method always updates the
1966: on-screen view of both the source and destination objects.
1967:
1968: This method fails quietly if any of the following conditions apply:
1969:
1970: there is no object with id equal to strSourceId
1971:
1972: there is no record in the source object with jsxid equal to strRecordId
1973:
1974:
1975: strParentRecordId is specified and there is no record in this object with
1976: jsxid equal to strParentRecordId
1977:
1978: the this object already has a record with jsxid equal to the record to adopt
1979: * @param strSourceId <span style="text-decoration: line-through;">either the id of the source object or the</span> source object itself.
1980: * @param strRecordId the <code>jsxid</code> attribute of the data record in the source object to transfer.
1981: * @param strParentRecordId the unique <code>jsxid</code> of an existing record. If this optional parameter
1982: is provided, the adopted record will be added as a child of this record. Otherwise, the adopted record will
1983: be added to the root <code>data</code> element.
1984: * @param bRedraw forces suppression of the insert event
1985: * @return the adopted record.
1986: */
1987: @SuppressWarnings("unchecked")
1988: public jsx3.xml.Node adoptRecord(String strSourceId,
1989: String strRecordId, String strParentRecordId,
1990: boolean bRedraw) {
1991: String extension = "adoptRecord(\"" + strSourceId + "\", \""
1992: + strRecordId + "\", \"" + strParentRecordId + "\", \""
1993: + bRedraw + "\").";
1994: try {
1995: java.lang.reflect.Constructor<jsx3.xml.Node> ctor = jsx3.xml.Node.class
1996: .getConstructor(Context.class, String.class,
1997: ScriptProxy.class);
1998: return ctor.newInstance(this , extension, getScriptProxy());
1999: } catch (Exception ex) {
2000: throw new IllegalArgumentException("Unsupported type: "
2001: + jsx3.xml.Node.class.getName());
2002: }
2003: }
2004:
2005: /**
2006: * Equivalent to adoptRecord, except that the to-be relationship is as a previousSibling to the CDF record identified by the parameter, strSiblingRecordId
2007:
2008: This method fails quietly if any of the following conditions apply:
2009:
2010: there is no record with a jsxid equal to strSourceId
2011:
2012: there is no record in the source object with a jsxid equal to strRecordId
2013:
2014:
2015: strSiblingRecordId is specified and there is no record in this object with a
2016: jsxid equal to strParentRecordId
2017:
2018: this object already has a record with jsxid equal to the record to adopt
2019: * @param strSourceId <span style="text-decoration: line-through;">either the id of the source object or the</span> source object itself.
2020: * @param strRecordId the <code>jsxid</code> attribute of the data record in the source object to transfer.
2021: * @param strSiblingRecordId the unique <code>jsxid</code> of an existing record in front of
2022: which the record identified by strSourceId will be placed
2023: * @param bRedraw if <code>true</code> or <code>null</code>, the on-screen view of this object is
2024: immediately updated to reflect the deleted record.
2025: * @return the adopted record.
2026: */
2027: @SuppressWarnings("unchecked")
2028: public jsx3.xml.Node adoptRecordBefore(
2029: jsx3.xml.CdfDocument strSourceId, String strRecordId,
2030: String strSiblingRecordId, boolean bRedraw) {
2031: String extension = "adoptRecordBefore(\"" + strSourceId
2032: + "\", \"" + strRecordId + "\", \""
2033: + strSiblingRecordId + "\", \"" + bRedraw + "\").";
2034: try {
2035: java.lang.reflect.Constructor<jsx3.xml.Node> ctor = jsx3.xml.Node.class
2036: .getConstructor(Context.class, String.class,
2037: ScriptProxy.class);
2038: return ctor.newInstance(this , extension, getScriptProxy());
2039: } catch (Exception ex) {
2040: throw new IllegalArgumentException("Unsupported type: "
2041: + jsx3.xml.Node.class.getName());
2042: }
2043: }
2044:
2045: /**
2046: * Equivalent to adoptRecord, except that the to-be relationship is as a previousSibling to the CDF record identified by the parameter, strSiblingRecordId
2047:
2048: This method fails quietly if any of the following conditions apply:
2049:
2050: there is no record with a jsxid equal to strSourceId
2051:
2052: there is no record in the source object with a jsxid equal to strRecordId
2053:
2054:
2055: strSiblingRecordId is specified and there is no record in this object with a
2056: jsxid equal to strParentRecordId
2057:
2058: this object already has a record with jsxid equal to the record to adopt
2059: * @param strSourceId <span style="text-decoration: line-through;">either the id of the source object or the</span> source object itself.
2060: * @param strRecordId the <code>jsxid</code> attribute of the data record in the source object to transfer.
2061: * @param strSiblingRecordId the unique <code>jsxid</code> of an existing record in front of
2062: which the record identified by strSourceId will be placed
2063: * @param bRedraw if <code>true</code> or <code>null</code>, the on-screen view of this object is
2064: immediately updated to reflect the deleted record.
2065: * @return the adopted record.
2066: */
2067: @SuppressWarnings("unchecked")
2068: public jsx3.xml.Node adoptRecordBefore(String strSourceId,
2069: String strRecordId, String strSiblingRecordId,
2070: boolean bRedraw) {
2071: String extension = "adoptRecordBefore(\"" + strSourceId
2072: + "\", \"" + strRecordId + "\", \""
2073: + strSiblingRecordId + "\", \"" + bRedraw + "\").";
2074: try {
2075: java.lang.reflect.Constructor<jsx3.xml.Node> ctor = jsx3.xml.Node.class
2076: .getConstructor(Context.class, String.class,
2077: ScriptProxy.class);
2078: return ctor.newInstance(this , extension, getScriptProxy());
2079: } catch (Exception ex) {
2080: throw new IllegalArgumentException("Unsupported type: "
2081: + jsx3.xml.Node.class.getName());
2082: }
2083: }
2084:
2085: /**
2086: * Converts all attributes in this CDF document that are property keys of the form {key} to
2087: the value of the property.
2088: * @param objProps the properties repository to query.
2089: * @param arrProps if provided, these attributes are converted rather than the default set of
2090: attributes.
2091: * @param bUnion if <code>true</code>, <code>arrProps</code> is combined with the default set of
2092: attributes and those attributes are converted.
2093: */
2094: public void convertProperties(java.util.Properties objProps,
2095: Object[] arrProps, boolean bUnion) {
2096: ScriptBuffer script = new ScriptBuffer();
2097: script.appendCall(getContextPath() + "convertProperties",
2098: objProps, arrProps, bUnion);
2099: getScriptProxy().addScript(script);
2100: }
2101:
2102: /**
2103: * Removes a record from the XML data source of this object.
2104: * @param strRecordId the <code>jsxid</code> attribute of the data record to remove.
2105: * @param bRedraw if <code>true</code> or <code>null</code>, the on-screen view of this object is
2106: immediately updated to reflect the deleted record.
2107: * @return the record removed from the data source or <code>null</code> if no such record found.
2108: */
2109: @SuppressWarnings("unchecked")
2110: public jsx3.xml.Node deleteRecord(String strRecordId,
2111: boolean bRedraw) {
2112: String extension = "deleteRecord(\"" + strRecordId + "\", \""
2113: + bRedraw + "\").";
2114: try {
2115: java.lang.reflect.Constructor<jsx3.xml.Node> ctor = jsx3.xml.Node.class
2116: .getConstructor(Context.class, String.class,
2117: ScriptProxy.class);
2118: return ctor.newInstance(this , extension, getScriptProxy());
2119: } catch (Exception ex) {
2120: throw new IllegalArgumentException("Unsupported type: "
2121: + jsx3.xml.Node.class.getName());
2122: }
2123: }
2124:
2125: /**
2126: * Removes a specific property from a record. If no such record exists in the XML document, this method fails quietly.
2127: * @param strRecordId the <code>jsxid</code> attribute of the data record to modify.
2128: * @param strPropName the name of the property to remove from the record.
2129: * @param bRedraw if <code>true</code> or <code>null</code>, the on-screen view of this object is
2130: immediately updated to reflect the deleted property.
2131: */
2132: public void deleteRecordProperty(String strRecordId,
2133: String strPropName, boolean bRedraw) {
2134: ScriptBuffer script = new ScriptBuffer();
2135: script.appendCall(getContextPath() + "deleteRecordProperty",
2136: strRecordId, strPropName, bRedraw);
2137: getScriptProxy().addScript(script);
2138: }
2139:
2140: /**
2141: * Returns an object containing the attributes of a particular CDF record as property/value pairs. The object returned by this
2142: method is a copy of the underlying data. Therefore, updates to this object will not affect the underlying data.
2143:
2144: The following two lines of code evaluate to the same value:
2145:
2146: objCDF.getRecord(strId).propName;
2147: objCDF.getRecordNode(strId).getAttribute("propName");
2148: * @param strRecordId the <code>jsxid</code> attribute of the data record to return.
2149: * @return the object representation of a CDF node or <code>null</code> if no such record found.
2150: */
2151: @SuppressWarnings("unchecked")
2152: public jsx3.lang.Object getRecord(String strRecordId) {
2153: String extension = "getRecord(\"" + strRecordId + "\").";
2154: try {
2155: java.lang.reflect.Constructor<jsx3.lang.Object> ctor = jsx3.lang.Object.class
2156: .getConstructor(Context.class, String.class,
2157: ScriptProxy.class);
2158: return ctor.newInstance(this , extension, getScriptProxy());
2159: } catch (Exception ex) {
2160: throw new IllegalArgumentException("Unsupported type: "
2161: + jsx3.lang.Object.class.getName());
2162: }
2163: }
2164:
2165: /**
2166: * Returns an object containing the attributes of a particular CDF record as property/value pairs. The object returned by this
2167: method is a copy of the underlying data. Therefore, updates to this object will not affect the underlying data.
2168:
2169: The following two lines of code evaluate to the same value:
2170:
2171: objCDF.getRecord(strId).propName;
2172: objCDF.getRecordNode(strId).getAttribute("propName");
2173: * @param strRecordId the <code>jsxid</code> attribute of the data record to return.
2174: * @param returnType The expected return type
2175: * @return the object representation of a CDF node or <code>null</code> if no such record found.
2176: */
2177: @SuppressWarnings("unchecked")
2178: public <T> T getRecord(String strRecordId, Class<T> returnType) {
2179: String extension = "getRecord(\"" + strRecordId + "\").";
2180: try {
2181: java.lang.reflect.Constructor<T> ctor = returnType
2182: .getConstructor(Context.class, String.class,
2183: ScriptProxy.class);
2184: return ctor.newInstance(this , extension, getScriptProxy());
2185: } catch (Exception ex) {
2186: throw new IllegalArgumentException(
2187: "Unsupported return type: " + returnType.getName());
2188: }
2189: }
2190:
2191: /**
2192: * Returns a record from the XML data source of this object. This returned value is a handle to the record and
2193: not a clone. Therefore, any updates made to the returned value with update the XML document of this object.
2194: To reflect such changes in the on-screen view of this object, call
2195: redrawRecord(strRecordId, jsx3.xml.CDF.UPDATE); on this object.
2196: * @param strRecordId the <code>jsxid</code> attribute of the data record to return.
2197: * @return the record node or <code>null</code> if none exists with a <code>jsxid</code>
2198: attribute equal to <code>strRecordId</code>.
2199: */
2200: @SuppressWarnings("unchecked")
2201: public jsx3.xml.Node getRecordNode(String strRecordId) {
2202: String extension = "getRecordNode(\"" + strRecordId + "\").";
2203: try {
2204: java.lang.reflect.Constructor<jsx3.xml.Node> ctor = jsx3.xml.Node.class
2205: .getConstructor(Context.class, String.class,
2206: ScriptProxy.class);
2207: return ctor.newInstance(this , extension, getScriptProxy());
2208: } catch (Exception ex) {
2209: throw new IllegalArgumentException("Unsupported type: "
2210: + jsx3.xml.Node.class.getName());
2211: }
2212: }
2213:
2214: /**
2215: * Inserts a new record into the XML data source of this object. If no XML data source exists
2216: yet for this object, an empty one is created before adding the new record.
2217: If a record already exists with an id equal to the jsxid property of objRecord,
2218: the operation is treated as an update, meaning the existing record is completely removed and a new record with
2219: the given jsxid is inserted.
2220: * @param objRecord a JavaScript object containing property/value pairs that define the
2221: attributes of the XML entity to create. Note that most classes that implement this interface require that all
2222: records have an attribute named <code>jsxid</code> that is unique across all records in the XML document.
2223: All property values will be treated as strings. Additionally, the following 3 characters are escaped:
2224: <code>" > <</code>.
2225: * @param strParentRecordId the unique <code>jsxid</code> of an existing record. If this optional parameter
2226: is provided and a record exists with a matching <code>jsxid</code> attribute, the new record will be added as a child of
2227: this record. Otherwise, the new record will be added to the root <code>data</code> element. However, if a
2228: record already exists with a <code>jsxid</code> attribute equal to the <code>jsxid</code> property of
2229: <code>objRecord</code>, this parameter will be ignored. In this case <code>adoptRecord()</code> must be called
2230: to change the parent of the record.
2231: * @param bRedraw if <code>true</code> or <code>null</code>, the on-screen view of this object is
2232: immediately updated to reflect the additional record.
2233: * @return the newly created or updated entity.
2234: */
2235: @SuppressWarnings("unchecked")
2236: public jsx3.xml.Node insertRecord(jsx3.lang.Object objRecord,
2237: String strParentRecordId, boolean bRedraw) {
2238: String extension = "insertRecord(\"" + objRecord + "\", \""
2239: + strParentRecordId + "\", \"" + bRedraw + "\").";
2240: try {
2241: java.lang.reflect.Constructor<jsx3.xml.Node> ctor = jsx3.xml.Node.class
2242: .getConstructor(Context.class, String.class,
2243: ScriptProxy.class);
2244: return ctor.newInstance(this , extension, getScriptProxy());
2245: } catch (Exception ex) {
2246: throw new IllegalArgumentException("Unsupported type: "
2247: + jsx3.xml.Node.class.getName());
2248: }
2249: }
2250:
2251: /**
2252: * Creates a new CDF record and inserts it into the CDF data source of this object, before the record identified by strSiblingRecordId.
2253:
2254: This method fails quietly if any of the following conditions apply:
2255:
2256: there is no existing record with a jsxid equal to strSiblingRecordId
2257:
2258: there is an existing record with jsxid equal to objRecord.jsxid
2259: * @param objRecord a JavaScript object containing property/value pairs that define the
2260: attributes of the XML entity to create. Note that most classes that implement this interface require that all
2261: records have an attribute named <code>jsxid</code> that is unique across all records in the XML document.
2262: All property values will be treated as strings. Additionally, the following 3 characters are escaped:
2263: <code>" > <</code>.
2264: * @param strSiblingRecordId the unique <code>jsxid</code> of an existing record before which the new record will be inserted.
2265: * @param bRedraw if <code>true</code> or <code>null</code>, the on-screen view of this object is
2266: immediately updated to reflect the additional record.
2267: * @return the newly created entity.
2268: */
2269: @SuppressWarnings("unchecked")
2270: public jsx3.xml.Node insertRecordBefore(jsx3.lang.Object objRecord,
2271: String strSiblingRecordId, boolean bRedraw) {
2272: String extension = "insertRecordBefore(\"" + objRecord
2273: + "\", \"" + strSiblingRecordId + "\", \"" + bRedraw
2274: + "\").";
2275: try {
2276: java.lang.reflect.Constructor<jsx3.xml.Node> ctor = jsx3.xml.Node.class
2277: .getConstructor(Context.class, String.class,
2278: ScriptProxy.class);
2279: return ctor.newInstance(this , extension, getScriptProxy());
2280: } catch (Exception ex) {
2281: throw new IllegalArgumentException("Unsupported type: "
2282: + jsx3.xml.Node.class.getName());
2283: }
2284: }
2285:
2286: /**
2287: * Inserts a new record into the XML data source of this object. This method is the same as
2288: insertRecord() except that its first parameter is of type jsx3.xml.Entity rather than
2289: Object.
2290: * @param objRecordNode an XML element of name <code>record</code>. Note that most classes that
2291: implement this interface require that all records have an attribute named <code>jsxid</code> that is unique
2292: across all records in the XML document.
2293: * @param strParentRecordId the unique <code>jsxid</code> of an existing record. If this optional parameter
2294: is provided and a record exists with a matching <code>jsxid</code> attribute, the new record will be added as a child of
2295: this record. Otherwise, the new record will be added to the root <code>data</code> element.
2296: * @param bRedraw if <code>true</code> or <code>null</code>, the on-screen view of this object is
2297: immediately updated to reflect the additional record.
2298: */
2299: public void insertRecordNode(jsx3.xml.Node objRecordNode,
2300: String strParentRecordId, boolean bRedraw) {
2301: ScriptBuffer script = new ScriptBuffer();
2302: script.appendCall(getContextPath() + "insertRecordNode",
2303: objRecordNode, strParentRecordId, bRedraw);
2304: getScriptProxy().addScript(script);
2305: }
2306:
2307: /**
2308: * Inserts a new property into an existing record with jsxid equal to strRecordId.
2309: If the property already exists, the existing property value will be updated. If no such record exists
2310: in the XML document, this method fails quietly.
2311: * @param strRecordId the <code>jsxid</code> attribute of the data record to modify.
2312: * @param strPropName the name of the property to insert into the record.
2313: * @param strPropValue the value of the property to insert.
2314: * @param bRedraw if <code>true</code> or <code>null</code>, the on-screen view of this object is
2315: immediately updated to reflect the inserted property.
2316: * @return this object.
2317: */
2318: @SuppressWarnings("unchecked")
2319: public jsx3.xml.CdfDocument insertRecordProperty(
2320: String strRecordId, String strPropName,
2321: String strPropValue, boolean bRedraw) {
2322: String extension = "insertRecordProperty(\"" + strRecordId
2323: + "\", \"" + strPropName + "\", \"" + strPropValue
2324: + "\", \"" + bRedraw + "\").";
2325: try {
2326: java.lang.reflect.Constructor<jsx3.xml.CdfDocument> ctor = jsx3.xml.CdfDocument.class
2327: .getConstructor(Context.class, String.class,
2328: ScriptProxy.class);
2329: return ctor.newInstance(this , extension, getScriptProxy());
2330: } catch (Exception ex) {
2331: throw new IllegalArgumentException("Unsupported type: "
2332: + jsx3.xml.CdfDocument.class.getName());
2333: }
2334: }
2335:
2336: /**
2337: * Inserts a new property into an existing record with jsxid equal to strRecordId.
2338: If the property already exists, the existing property value will be updated. If no such record exists
2339: in the XML document, this method fails quietly.
2340: * @param strRecordId the <code>jsxid</code> attribute of the data record to modify.
2341: * @param strPropName the name of the property to insert into the record.
2342: * @param strPropValue the value of the property to insert.
2343: * @param bRedraw if <code>true</code> or <code>null</code>, the on-screen view of this object is
2344: immediately updated to reflect the inserted property.
2345: * @param returnType The expected return type
2346: * @return this object.
2347: */
2348: @SuppressWarnings("unchecked")
2349: public <T> T insertRecordProperty(String strRecordId,
2350: String strPropName, String strPropValue, boolean bRedraw,
2351: Class<T> returnType) {
2352: String extension = "insertRecordProperty(\"" + strRecordId
2353: + "\", \"" + strPropName + "\", \"" + strPropValue
2354: + "\", \"" + bRedraw + "\").";
2355: try {
2356: java.lang.reflect.Constructor<T> ctor = returnType
2357: .getConstructor(Context.class, String.class,
2358: ScriptProxy.class);
2359: return ctor.newInstance(this , extension, getScriptProxy());
2360: } catch (Exception ex) {
2361: throw new IllegalArgumentException(
2362: "Unsupported return type: " + returnType.getName());
2363: }
2364: }
2365:
2366: }
|