0001: /*
0002: * Copyright 2005 Joe Walker
0003: *
0004: * Licensed under the Apache License, Version 2.0 (the "License");
0005: * you may not use this file except in compliance with the License.
0006: * You may obtain a copy of the License at
0007: *
0008: * http://www.apache.org/licenses/LICENSE-2.0
0009: *
0010: * Unless required by applicable law or agreed to in writing, software
0011: * distributed under the License is distributed on an "AS IS" BASIS,
0012: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0013: * See the License for the specific language governing permissions and
0014: * limitations under the License.
0015: */
0016: package jsx3.gui;
0017:
0018: import org.directwebremoting.ScriptBuffer;
0019: import org.directwebremoting.proxy.ScriptProxy;
0020: import org.directwebremoting.proxy.io.Context;
0021:
0022: /**
0023: * This class provides a container-based, object-oriented approach to creating static html objects (basically this class creates "DIV" objects). This class is useful for creating objects as simple as 'labels' that can be placed anywhere on the screen. The advantage to using this class instead of trying to insert static html in the html window is that it allows the given HTML string to be managed by the 'container-management' strategy employed by the JSX Architecture
0024: * @author Joe Walker [joe at getahead dot org]
0025: * @author DRAPGEN - Dwr Reverse Ajax Proxy GENerator
0026: */
0027: public class Block extends jsx3.gui.Painted {
0028: /**
0029: * All reverse ajax proxies need context to work from
0030: * @param scriptProxy The place we are writing scripts to
0031: * @param context The script that got us to where we are now
0032: */
0033: public Block(Context context, String extension,
0034: ScriptProxy scriptProxy) {
0035: super (context, extension, scriptProxy);
0036: }
0037:
0038: /**
0039: * instance initializer
0040: * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application
0041: * @param vntLeft either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0042: * @param vntTop either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0043: * @param vntWidth either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0044: * @param vntHeight either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0045: * @param strHTML Text/HTML markup to place in the jsx3.gui.Block instance
0046: */
0047: public Block(String strName, int vntLeft, int vntTop,
0048: String vntWidth, int vntHeight, String strHTML) {
0049: super ((Context) null, (String) null, (ScriptProxy) null);
0050: ScriptBuffer script = new ScriptBuffer();
0051: script.appendCall("new Block", strName, vntLeft, vntTop,
0052: vntWidth, vntHeight, strHTML);
0053: setInitScript(script);
0054: }
0055:
0056: /**
0057: * instance initializer
0058: * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application
0059: * @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
0060: * @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
0061: * @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
0062: * @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
0063: * @param strHTML Text/HTML markup to place in the jsx3.gui.Block instance
0064: */
0065: public Block(String strName, String vntLeft, String vntTop,
0066: int vntWidth, String vntHeight, String strHTML) {
0067: super ((Context) null, (String) null, (ScriptProxy) null);
0068: ScriptBuffer script = new ScriptBuffer();
0069: script.appendCall("new Block", strName, vntLeft, vntTop,
0070: vntWidth, vntHeight, strHTML);
0071: setInitScript(script);
0072: }
0073:
0074: /**
0075: * instance initializer
0076: * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application
0077: * @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
0078: * @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
0079: * @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
0080: * @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
0081: * @param strHTML Text/HTML markup to place in the jsx3.gui.Block instance
0082: */
0083: public Block(String strName, int vntLeft, String vntTop,
0084: int vntWidth, String vntHeight, String strHTML) {
0085: super ((Context) null, (String) null, (ScriptProxy) null);
0086: ScriptBuffer script = new ScriptBuffer();
0087: script.appendCall("new Block", strName, vntLeft, vntTop,
0088: vntWidth, vntHeight, strHTML);
0089: setInitScript(script);
0090: }
0091:
0092: /**
0093: * instance initializer
0094: * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application
0095: * @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
0096: * @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
0097: * @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
0098: * @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
0099: * @param strHTML Text/HTML markup to place in the jsx3.gui.Block instance
0100: */
0101: public Block(String strName, int vntLeft, String vntTop,
0102: int vntWidth, int vntHeight, String strHTML) {
0103: super ((Context) null, (String) null, (ScriptProxy) null);
0104: ScriptBuffer script = new ScriptBuffer();
0105: script.appendCall("new Block", strName, vntLeft, vntTop,
0106: vntWidth, vntHeight, strHTML);
0107: setInitScript(script);
0108: }
0109:
0110: /**
0111: * instance initializer
0112: * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application
0113: * @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
0114: * @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
0115: * @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
0116: * @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
0117: * @param strHTML Text/HTML markup to place in the jsx3.gui.Block instance
0118: */
0119: public Block(String strName, String vntLeft, int vntTop,
0120: String vntWidth, int vntHeight, String strHTML) {
0121: super ((Context) null, (String) null, (ScriptProxy) null);
0122: ScriptBuffer script = new ScriptBuffer();
0123: script.appendCall("new Block", strName, vntLeft, vntTop,
0124: vntWidth, vntHeight, strHTML);
0125: setInitScript(script);
0126: }
0127:
0128: /**
0129: * instance initializer
0130: * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application
0131: * @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
0132: * @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
0133: * @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
0134: * @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
0135: * @param strHTML Text/HTML markup to place in the jsx3.gui.Block instance
0136: */
0137: public Block(String strName, String vntLeft, int vntTop,
0138: String vntWidth, String vntHeight, String strHTML) {
0139: super ((Context) null, (String) null, (ScriptProxy) null);
0140: ScriptBuffer script = new ScriptBuffer();
0141: script.appendCall("new Block", strName, vntLeft, vntTop,
0142: vntWidth, vntHeight, strHTML);
0143: setInitScript(script);
0144: }
0145:
0146: /**
0147: * instance initializer
0148: * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application
0149: * @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
0150: * @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
0151: * @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
0152: * @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
0153: * @param strHTML Text/HTML markup to place in the jsx3.gui.Block instance
0154: */
0155: public Block(String strName, String vntLeft, int vntTop,
0156: int vntWidth, int vntHeight, String strHTML) {
0157: super ((Context) null, (String) null, (ScriptProxy) null);
0158: ScriptBuffer script = new ScriptBuffer();
0159: script.appendCall("new Block", strName, vntLeft, vntTop,
0160: vntWidth, vntHeight, strHTML);
0161: setInitScript(script);
0162: }
0163:
0164: /**
0165: * instance initializer
0166: * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application
0167: * @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
0168: * @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
0169: * @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
0170: * @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
0171: * @param strHTML Text/HTML markup to place in the jsx3.gui.Block instance
0172: */
0173: public Block(String strName, int vntLeft, String vntTop,
0174: String vntWidth, int vntHeight, String strHTML) {
0175: super ((Context) null, (String) null, (ScriptProxy) null);
0176: ScriptBuffer script = new ScriptBuffer();
0177: script.appendCall("new Block", strName, vntLeft, vntTop,
0178: vntWidth, vntHeight, strHTML);
0179: setInitScript(script);
0180: }
0181:
0182: /**
0183: * instance initializer
0184: * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application
0185: * @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
0186: * @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
0187: * @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
0188: * @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
0189: * @param strHTML Text/HTML markup to place in the jsx3.gui.Block instance
0190: */
0191: public Block(String strName, int vntLeft, String vntTop,
0192: String vntWidth, String vntHeight, String strHTML) {
0193: super ((Context) null, (String) null, (ScriptProxy) null);
0194: ScriptBuffer script = new ScriptBuffer();
0195: script.appendCall("new Block", strName, vntLeft, vntTop,
0196: vntWidth, vntHeight, strHTML);
0197: setInitScript(script);
0198: }
0199:
0200: /**
0201: * instance initializer
0202: * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application
0203: * @param vntLeft either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0204: * @param vntTop either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0205: * @param vntWidth either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0206: * @param vntHeight either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0207: * @param strHTML Text/HTML markup to place in the jsx3.gui.Block instance
0208: */
0209: public Block(String strName, int vntLeft, int vntTop, int vntWidth,
0210: int vntHeight, String strHTML) {
0211: super ((Context) null, (String) null, (ScriptProxy) null);
0212: ScriptBuffer script = new ScriptBuffer();
0213: script.appendCall("new Block", strName, vntLeft, vntTop,
0214: vntWidth, vntHeight, strHTML);
0215: setInitScript(script);
0216: }
0217:
0218: /**
0219: * instance initializer
0220: * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application
0221: * @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
0222: * @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
0223: * @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
0224: * @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
0225: * @param strHTML Text/HTML markup to place in the jsx3.gui.Block instance
0226: */
0227: public Block(String strName, String vntLeft, String vntTop,
0228: int vntWidth, int vntHeight, String strHTML) {
0229: super ((Context) null, (String) null, (ScriptProxy) null);
0230: ScriptBuffer script = new ScriptBuffer();
0231: script.appendCall("new Block", strName, vntLeft, vntTop,
0232: vntWidth, vntHeight, strHTML);
0233: setInitScript(script);
0234: }
0235:
0236: /**
0237: * instance initializer
0238: * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application
0239: * @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
0240: * @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
0241: * @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
0242: * @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
0243: * @param strHTML Text/HTML markup to place in the jsx3.gui.Block instance
0244: */
0245: public Block(String strName, int vntLeft, int vntTop, int vntWidth,
0246: String vntHeight, String strHTML) {
0247: super ((Context) null, (String) null, (ScriptProxy) null);
0248: ScriptBuffer script = new ScriptBuffer();
0249: script.appendCall("new Block", strName, vntLeft, vntTop,
0250: vntWidth, vntHeight, strHTML);
0251: setInitScript(script);
0252: }
0253:
0254: /**
0255: * instance initializer
0256: * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application
0257: * @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
0258: * @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
0259: * @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
0260: * @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
0261: * @param strHTML Text/HTML markup to place in the jsx3.gui.Block instance
0262: */
0263: public Block(String strName, String vntLeft, String vntTop,
0264: String vntWidth, int vntHeight, String strHTML) {
0265: super ((Context) null, (String) null, (ScriptProxy) null);
0266: ScriptBuffer script = new ScriptBuffer();
0267: script.appendCall("new Block", strName, vntLeft, vntTop,
0268: vntWidth, vntHeight, strHTML);
0269: setInitScript(script);
0270: }
0271:
0272: /**
0273: * instance initializer
0274: * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application
0275: * @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
0276: * @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
0277: * @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
0278: * @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
0279: * @param strHTML Text/HTML markup to place in the jsx3.gui.Block instance
0280: */
0281: public Block(String strName, String vntLeft, int vntTop,
0282: int vntWidth, String vntHeight, String strHTML) {
0283: super ((Context) null, (String) null, (ScriptProxy) null);
0284: ScriptBuffer script = new ScriptBuffer();
0285: script.appendCall("new Block", strName, vntLeft, vntTop,
0286: vntWidth, vntHeight, strHTML);
0287: setInitScript(script);
0288: }
0289:
0290: /**
0291: * instance initializer
0292: * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application
0293: * @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
0294: * @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
0295: * @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
0296: * @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
0297: * @param strHTML Text/HTML markup to place in the jsx3.gui.Block instance
0298: */
0299: public Block(String strName, String vntLeft, String vntTop,
0300: String vntWidth, String vntHeight, String strHTML) {
0301: super ((Context) null, (String) null, (ScriptProxy) null);
0302: ScriptBuffer script = new ScriptBuffer();
0303: script.appendCall("new Block", strName, vntLeft, vntTop,
0304: vntWidth, vntHeight, strHTML);
0305: setInitScript(script);
0306: }
0307:
0308: /**
0309: * instance initializer
0310: * @param strName unique name distinguishing this object from all other JSX GUI objects in the JSX application
0311: * @param vntLeft either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0312: * @param vntTop either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0313: * @param vntWidth either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0314: * @param vntHeight either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
0315: * @param strHTML Text/HTML markup to place in the jsx3.gui.Block instance
0316: */
0317: public Block(String strName, int vntLeft, int vntTop,
0318: String vntWidth, String vntHeight, String strHTML) {
0319: super ((Context) null, (String) null, (ScriptProxy) null);
0320: ScriptBuffer script = new ScriptBuffer();
0321: script.appendCall("new Block", strName, vntLeft, vntTop,
0322: vntWidth, vntHeight, strHTML);
0323: setInitScript(script);
0324: }
0325:
0326: /**
0327: * 2
0328: */
0329: public static final int OVERFLOWHIDDEN = 2;
0330:
0331: /**
0332: * 3 (default)
0333: */
0334: public static final int OVERFLOWEXPAND = 3;
0335:
0336: /**
0337: * Verdana
0338: */
0339: public static final String DEFAULTFONTNAME = "Verdana";
0340:
0341: /**
0342: * #000000
0343: */
0344: public static final String DEFAULTCOLOR = "#000000";
0345:
0346: /**
0347: *  
0348: */
0349: public static final String DEFAULTTEXT = " ";
0350:
0351: /**
0352: * span
0353: */
0354: public static final String DEFAULTTAGNAME = "span";
0355:
0356: /**
0357: * bold
0358: */
0359: public static final String FONTBOLD = "bold";
0360:
0361: /**
0362: * normal (default)
0363: */
0364: public static final String FONTNORMAL = "normal";
0365:
0366: /**
0367: * [empty string] (default)
0368: */
0369: public static final String DISPLAYBLOCK = "";
0370:
0371: /**
0372: * none
0373: */
0374: public static final String DISPLAYNONE = "none";
0375:
0376: /**
0377: * [empty string] (default)
0378: */
0379: public static final String VISIBILITYVISIBLE = "";
0380:
0381: /**
0382: * hidden
0383: */
0384: public static final String VISIBILITYHIDDEN = "hidden";
0385:
0386: /**
0387: * left (default)
0388: */
0389: public static final String ALIGNLEFT = "left";
0390:
0391: /**
0392: * center
0393: */
0394: public static final String ALIGNCENTER = "center";
0395:
0396: /**
0397: * right
0398: */
0399: public static final String ALIGNRIGHT = "right";
0400:
0401: /**
0402: * 0
0403: */
0404: public static final int ABSOLUTE = 0;
0405:
0406: /**
0407: * 1 (default)
0408: */
0409: public static final int RELATIVE = 1;
0410:
0411: /**
0412: * JSX/images/spc.gif
0413: */
0414: public static final String SPACE = null;
0415:
0416: /**
0417: * Returns valid CSS property value, (e.g., red, #ffffff, rgb(255,0,0))
0418: * @param callback valid CSS property value, (e.g., red, #ffffff, rgb(255,0,0))
0419: */
0420: @SuppressWarnings("unchecked")
0421: public void getBackgroundColor(
0422: org.directwebremoting.proxy.Callback<String> callback) {
0423: ScriptBuffer script = new ScriptBuffer();
0424: String callbackPrefix = "";
0425:
0426: if (callback != null) {
0427: callbackPrefix = "var reply = ";
0428: }
0429:
0430: script.appendCall(callbackPrefix + getContextPath()
0431: + "getBackgroundColor");
0432:
0433: if (callback != null) {
0434: String key = org.directwebremoting.extend.CallbackHelper
0435: .saveCallback(callback, String.class);
0436: script
0437: .appendCall("__System.activateCallback", key,
0438: "reply");
0439: }
0440:
0441: getScriptProxy().addScript(script);
0442: }
0443:
0444: /**
0445: * Sets valid CSS property value, (e.g., red, #ffffff, rgb(255,0,0));
0446: returns reference to self to facilitate method chaining;
0447: * @param strColor valid CSS property value, (e.g., red, #ffffff, rgb(255,0,0))
0448: * @param bRepaint if <code>true</code>, the view of this object is immediately updated, obviating the need to call <code>repaint()</code>.
0449: * @return this object
0450: */
0451: public jsx3.gui.Block setBackgroundColor(String strColor,
0452: boolean bRepaint) {
0453: ScriptBuffer script = new ScriptBuffer();
0454: script.appendCall(getContextPath() + "setBackgroundColor",
0455: strColor, bRepaint);
0456: getScriptProxy().addScript(script);
0457: return this ;
0458: }
0459:
0460: /**
0461: * Returns valid CSS property value for the background such as: background-image:url(x.gif); or background-image:url(x.gif);background-repeat:no-repeat;
0462: * @param callback valid CSS property for the background such as: background-image:url(x.gif); or background-image:url(x.gif);background-repeat:no-repeat;
0463: */
0464: @SuppressWarnings("unchecked")
0465: public void getBackground(
0466: org.directwebremoting.proxy.Callback<String> callback) {
0467: ScriptBuffer script = new ScriptBuffer();
0468: String callbackPrefix = "";
0469:
0470: if (callback != null) {
0471: callbackPrefix = "var reply = ";
0472: }
0473:
0474: script.appendCall(callbackPrefix + getContextPath()
0475: + "getBackground");
0476:
0477: if (callback != null) {
0478: String key = org.directwebremoting.extend.CallbackHelper
0479: .saveCallback(callback, String.class);
0480: script
0481: .appendCall("__System.activateCallback", key,
0482: "reply");
0483: }
0484:
0485: getScriptProxy().addScript(script);
0486: }
0487:
0488: /**
0489: * Sets valid CSS property value for the background such as: background-image:url(x.gif); or background-image:url(x.gif);background-repeat:no-repeat;
0490: returns reference to self to facilitate method chaining;
0491: * @param strBG valid CSS property value for the background such as: background-image:url(x.gif); or background-image:url(x.gif);background-repeat:no-repeat;
0492: * @return this object
0493: */
0494: public jsx3.gui.Block setBackground(String strBG) {
0495: ScriptBuffer script = new ScriptBuffer();
0496: script.appendCall(getContextPath() + "setBackground", strBG);
0497: getScriptProxy().addScript(script);
0498: return this ;
0499: }
0500:
0501: /**
0502: * Returns CSS property value(s) for a border (border: solid 1px #000000)
0503: */
0504: @SuppressWarnings("unchecked")
0505: public void getBorder(
0506: org.directwebremoting.proxy.Callback<String> callback) {
0507: ScriptBuffer script = new ScriptBuffer();
0508: String callbackPrefix = "";
0509:
0510: if (callback != null) {
0511: callbackPrefix = "var reply = ";
0512: }
0513:
0514: script.appendCall(callbackPrefix + getContextPath()
0515: + "getBorder");
0516:
0517: if (callback != null) {
0518: String key = org.directwebremoting.extend.CallbackHelper
0519: .saveCallback(callback, String.class);
0520: script
0521: .appendCall("__System.activateCallback", key,
0522: "reply");
0523: }
0524:
0525: getScriptProxy().addScript(script);
0526: }
0527:
0528: /**
0529: * Sets CSS property value(s) for a border (border: solid 1px #000000). Properties can be strung
0530: together as in: border:solid 1px #989885;border-left-width:0px;
0531: * @param strCSS valid CSS property value for a border (border: solid 1px #000000)
0532: * @param bRecalc if true, the VIEW will be updated with requiring a repaint
0533: * @return this object
0534: */
0535: public jsx3.gui.Block setBorder(String strCSS, boolean bRecalc) {
0536: ScriptBuffer script = new ScriptBuffer();
0537: script.appendCall(getContextPath() + "setBorder", strCSS,
0538: bRecalc);
0539: getScriptProxy().addScript(script);
0540: return this ;
0541: }
0542:
0543: /**
0544: * Returns valid CSS property value, (e.g., red, #ffffff, rgb(255,0,0))
0545: * @param callback valid CSS property value, (e.g., red, #ffffff, rgb(255,0,0))
0546: */
0547: @SuppressWarnings("unchecked")
0548: public void getColor(
0549: org.directwebremoting.proxy.Callback<String> callback) {
0550: ScriptBuffer script = new ScriptBuffer();
0551: String callbackPrefix = "";
0552:
0553: if (callback != null) {
0554: callbackPrefix = "var reply = ";
0555: }
0556:
0557: script.appendCall(callbackPrefix + getContextPath()
0558: + "getColor");
0559:
0560: if (callback != null) {
0561: String key = org.directwebremoting.extend.CallbackHelper
0562: .saveCallback(callback, String.class);
0563: script
0564: .appendCall("__System.activateCallback", key,
0565: "reply");
0566: }
0567:
0568: getScriptProxy().addScript(script);
0569: }
0570:
0571: /**
0572: * Sets valid CSS property value, (e.g., red, #ffffff, rgb(255,0,0));
0573: returns reference to self to facilitate method chaining;
0574: * @param strColor valid CSS property value, (e.g., red, #ffffff, rgb(255,0,0))
0575: * @param bRepaint if <code>true</code>, the view of this object is immediately updated, obviating the need to call <code>repaint()</code>.
0576: * @return this object
0577: */
0578: public jsx3.gui.Block setColor(String strColor, boolean bRepaint) {
0579: ScriptBuffer script = new ScriptBuffer();
0580: script.appendCall(getContextPath() + "setColor", strColor,
0581: bRepaint);
0582: getScriptProxy().addScript(script);
0583: return this ;
0584: }
0585:
0586: /**
0587: * Returns valid CSS property value, (e.g., default,wait,col-resize); if no value or an empty string, null is returned
0588: * @param callback valid CSS property value, (e.g., default,wait,col-resize)
0589: */
0590: @SuppressWarnings("unchecked")
0591: public void getCursor(
0592: org.directwebremoting.proxy.Callback<String> callback) {
0593: ScriptBuffer script = new ScriptBuffer();
0594: String callbackPrefix = "";
0595:
0596: if (callback != null) {
0597: callbackPrefix = "var reply = ";
0598: }
0599:
0600: script.appendCall(callbackPrefix + getContextPath()
0601: + "getCursor");
0602:
0603: if (callback != null) {
0604: String key = org.directwebremoting.extend.CallbackHelper
0605: .saveCallback(callback, String.class);
0606: script
0607: .appendCall("__System.activateCallback", key,
0608: "reply");
0609: }
0610:
0611: getScriptProxy().addScript(script);
0612: }
0613:
0614: /**
0615: * Sets valid CSS property value, (e.g., default,wait,col-resize)
0616: * @param strCursor valid CSS property value, (e.g., default,wait,col-resize)
0617: * @param bRepaint if <code>true</code>, the view of this object is immediately updated, obviating the need to call <code>repaint()</code>.
0618: */
0619: public void setCursor(String strCursor, boolean bRepaint) {
0620: ScriptBuffer script = new ScriptBuffer();
0621: script.appendCall(getContextPath() + "setCursor", strCursor,
0622: bRepaint);
0623: getScriptProxy().addScript(script);
0624: }
0625:
0626: /**
0627: * Returns CSS text to override the standard instance properties on the painted object.
0628: * @param callback CSS text
0629: */
0630: @SuppressWarnings("unchecked")
0631: public void getCSSOverride(
0632: org.directwebremoting.proxy.Callback<String> callback) {
0633: ScriptBuffer script = new ScriptBuffer();
0634: String callbackPrefix = "";
0635:
0636: if (callback != null) {
0637: callbackPrefix = "var reply = ";
0638: }
0639:
0640: script.appendCall(callbackPrefix + getContextPath()
0641: + "getCSSOverride");
0642:
0643: if (callback != null) {
0644: String key = org.directwebremoting.extend.CallbackHelper
0645: .saveCallback(callback, String.class);
0646: script
0647: .appendCall("__System.activateCallback", key,
0648: "reply");
0649: }
0650:
0651: getScriptProxy().addScript(script);
0652: }
0653:
0654: /**
0655: * Sets CSS text to override the standard instance properties on the painted object. Convenience method for extending this object. CSS properties affecting layout, including border-width, padding, margin, width, and height
0656: are strongly discouraged, as they may interfere with the framework's internal box models.
0657: Since some controls are composited from multiple HTML elements, some styles may not cascade to nested elements.
0658: Instance Properties are the preferred method for applying styles.
0659: * @param strCSS CSS text. Fore example, <code>color:red;background-color:orange;</code>
0660: * @return this object
0661: */
0662: public jsx3.gui.Block setCSSOverride(String strCSS) {
0663: ScriptBuffer script = new ScriptBuffer();
0664: script.appendCall(getContextPath() + "setCSSOverride", strCSS);
0665: getScriptProxy().addScript(script);
0666: return this ;
0667: }
0668:
0669: /**
0670: * Returns the named CSS rule(s) to apply to the painted object.
0671: */
0672: @SuppressWarnings("unchecked")
0673: public void getClassName(
0674: org.directwebremoting.proxy.Callback<String> callback) {
0675: ScriptBuffer script = new ScriptBuffer();
0676: String callbackPrefix = "";
0677:
0678: if (callback != null) {
0679: callbackPrefix = "var reply = ";
0680: }
0681:
0682: script.appendCall(callbackPrefix + getContextPath()
0683: + "getClassName");
0684:
0685: if (callback != null) {
0686: String key = org.directwebremoting.extend.CallbackHelper
0687: .saveCallback(callback, String.class);
0688: script
0689: .appendCall("__System.activateCallback", key,
0690: "reply");
0691: }
0692:
0693: getScriptProxy().addScript(script);
0694: }
0695:
0696: /**
0697: * Sets the named CSS rule(s) to apply to the painted object. Rules that specify border-width, padding, margin, width, and height are strongly discouraged.
0698: Multiple rules may be specified, delimited with a space. For example, label emphasis.
0699: Since some controls are composited from multiple HTML elements, some rule styles may not cascade to nested elements.
0700: Dynamic Properties are the preferred method for applying global styles.
0701: * @param strClassName CSS property name without the leading "."
0702: * @return this object
0703: */
0704: public jsx3.gui.Block setClassName(String strClassName) {
0705: ScriptBuffer script = new ScriptBuffer();
0706: script.appendCall(getContextPath() + "setClassName",
0707: strClassName);
0708: getScriptProxy().addScript(script);
0709: return this ;
0710: }
0711:
0712: /**
0713: * Returns the CSS display for the object; one of jsx3.gui.Block.DISPLAYNONE (display:none;) and jsx3.gui.Block.DISPLAYBLOCK (display:;)
0714: */
0715: @SuppressWarnings("unchecked")
0716: public void getDisplay(
0717: org.directwebremoting.proxy.Callback<String> callback) {
0718: ScriptBuffer script = new ScriptBuffer();
0719: String callbackPrefix = "";
0720:
0721: if (callback != null) {
0722: callbackPrefix = "var reply = ";
0723: }
0724:
0725: script.appendCall(callbackPrefix + getContextPath()
0726: + "getDisplay");
0727:
0728: if (callback != null) {
0729: String key = org.directwebremoting.extend.CallbackHelper
0730: .saveCallback(callback, String.class);
0731: script
0732: .appendCall("__System.activateCallback", key,
0733: "reply");
0734: }
0735:
0736: getScriptProxy().addScript(script);
0737: }
0738:
0739: /**
0740: * Sets the display for the object. Note that although the framework uses CSS to apply this setting, the actual values that get set are determined by the system.
0741: Only those parameters listed for @DISPLAY are supported as inputs to this function.
0742: * @param intDisplay one of jsx3.gui.Block.DISPLAYNONE (display:none;) and jsx3.gui.Block.DISPLAYBLOCK (display:;)
0743: * @param bRepaint if <code>true</code>, the view of this object is immediately updated, obviating the need to call <code>repaint()</code>.
0744: * @return this object
0745: */
0746: public jsx3.gui.Block setDisplay(String intDisplay, boolean bRepaint) {
0747: ScriptBuffer script = new ScriptBuffer();
0748: script.appendCall(getContextPath() + "setDisplay", intDisplay,
0749: bRepaint);
0750: getScriptProxy().addScript(script);
0751: return this ;
0752: }
0753:
0754: /**
0755: * Returns the CSS font-family for the object
0756: * @param callback valid CSS font-family property value
0757: */
0758: @SuppressWarnings("unchecked")
0759: public void getFontName(
0760: org.directwebremoting.proxy.Callback<String> callback) {
0761: ScriptBuffer script = new ScriptBuffer();
0762: String callbackPrefix = "";
0763:
0764: if (callback != null) {
0765: callbackPrefix = "var reply = ";
0766: }
0767:
0768: script.appendCall(callbackPrefix + getContextPath()
0769: + "getFontName");
0770:
0771: if (callback != null) {
0772: String key = org.directwebremoting.extend.CallbackHelper
0773: .saveCallback(callback, String.class);
0774: script
0775: .appendCall("__System.activateCallback", key,
0776: "reply");
0777: }
0778:
0779: getScriptProxy().addScript(script);
0780: }
0781:
0782: /**
0783: * Sets the CSS font-family for the object;
0784: returns reference to self to facilitate method chaining;
0785: * @param strFontName valid CSS font-family property value
0786: * @return this object
0787: */
0788: public jsx3.gui.Block setFontName(String strFontName) {
0789: ScriptBuffer script = new ScriptBuffer();
0790: script
0791: .appendCall(getContextPath() + "setFontName",
0792: strFontName);
0793: getScriptProxy().addScript(script);
0794: return this ;
0795: }
0796:
0797: /**
0798: * Returns the CSS font-size for the object
0799: * @param callback font-size (in pixels)
0800: */
0801: @SuppressWarnings("unchecked")
0802: public void getFontSize(
0803: org.directwebremoting.proxy.Callback<Integer> callback) {
0804: ScriptBuffer script = new ScriptBuffer();
0805: String callbackPrefix = "";
0806:
0807: if (callback != null) {
0808: callbackPrefix = "var reply = ";
0809: }
0810:
0811: script.appendCall(callbackPrefix + getContextPath()
0812: + "getFontSize");
0813:
0814: if (callback != null) {
0815: String key = org.directwebremoting.extend.CallbackHelper
0816: .saveCallback(callback, Integer.class);
0817: script
0818: .appendCall("__System.activateCallback", key,
0819: "reply");
0820: }
0821:
0822: getScriptProxy().addScript(script);
0823: }
0824:
0825: /**
0826: * Sets the CSS font-size for the object;
0827: returns reference to self to facilitate method chaining;
0828: * @param intPixelSize font-size (in pixels)
0829: * @return this object
0830: */
0831: public jsx3.gui.Block setFontSize(int intPixelSize) {
0832: ScriptBuffer script = new ScriptBuffer();
0833: script.appendCall(getContextPath() + "setFontSize",
0834: intPixelSize);
0835: getScriptProxy().addScript(script);
0836: return this ;
0837: }
0838:
0839: /**
0840: * Returns the CSS font-weight for the object ("bold" or "normal")
0841: * @param callback [jsx3.gui.Block.FONTBOLD. jsx3.gui.Block.FONTNORMAL]
0842: */
0843: @SuppressWarnings("unchecked")
0844: public void getFontWeight(
0845: org.directwebremoting.proxy.Callback<String> callback) {
0846: ScriptBuffer script = new ScriptBuffer();
0847: String callbackPrefix = "";
0848:
0849: if (callback != null) {
0850: callbackPrefix = "var reply = ";
0851: }
0852:
0853: script.appendCall(callbackPrefix + getContextPath()
0854: + "getFontWeight");
0855:
0856: if (callback != null) {
0857: String key = org.directwebremoting.extend.CallbackHelper
0858: .saveCallback(callback, String.class);
0859: script
0860: .appendCall("__System.activateCallback", key,
0861: "reply");
0862: }
0863:
0864: getScriptProxy().addScript(script);
0865: }
0866:
0867: /**
0868: * Sets the CSS font-weight for the object ("bold" or "normal");
0869: returns reference to self to facilitate method chaining;
0870: * @param FONTWEIGHT [jsx3.gui.Block.FONTBOLD. jsx3.gui.Block.FONTNORMAL]
0871: * @return this object
0872: */
0873: public jsx3.gui.Block setFontWeight(String FONTWEIGHT) {
0874: ScriptBuffer script = new ScriptBuffer();
0875: script.appendCall(getContextPath() + "setFontWeight",
0876: FONTWEIGHT);
0877: getScriptProxy().addScript(script);
0878: return this ;
0879: }
0880:
0881: /**
0882: * Returns the height property of this object.
0883: * @param callback height.
0884: */
0885: @SuppressWarnings("unchecked")
0886: public void getHeight(
0887: org.directwebremoting.proxy.Callback<Integer> callback) {
0888: ScriptBuffer script = new ScriptBuffer();
0889: String callbackPrefix = "";
0890:
0891: if (callback != null) {
0892: callbackPrefix = "var reply = ";
0893: }
0894:
0895: script.appendCall(callbackPrefix + getContextPath()
0896: + "getHeight");
0897:
0898: if (callback != null) {
0899: String key = org.directwebremoting.extend.CallbackHelper
0900: .saveCallback(callback, Integer.class);
0901: script
0902: .appendCall("__System.activateCallback", key,
0903: "reply");
0904: }
0905:
0906: getScriptProxy().addScript(script);
0907: }
0908:
0909: /**
0910: * Sets the height property of this object.
0911: * @param vntHeight the height as a non-negative integer or non-negative percentage. For example: 45%, 12.
0912: * @param bRepaint if <code>true</code>, the view of this object is immediately updated, obviating the need to call <code>repaint()</code>.
0913: * @return this object.
0914: */
0915: public jsx3.gui.Block setHeight(String vntHeight, boolean bRepaint) {
0916: ScriptBuffer script = new ScriptBuffer();
0917: script.appendCall(getContextPath() + "setHeight", vntHeight,
0918: bRepaint);
0919: getScriptProxy().addScript(script);
0920: return this ;
0921: }
0922:
0923: /**
0924: * Sets the height property of this object.
0925: * @param vntHeight the height as a non-negative integer or non-negative percentage. For example: 45%, 12.
0926: * @param bRepaint if <code>true</code>, the view of this object is immediately updated, obviating the need to call <code>repaint()</code>.
0927: * @return this object.
0928: */
0929: public jsx3.gui.Block setHeight(int vntHeight, boolean bRepaint) {
0930: ScriptBuffer script = new ScriptBuffer();
0931: script.appendCall(getContextPath() + "setHeight", vntHeight,
0932: bRepaint);
0933: getScriptProxy().addScript(script);
0934: return this ;
0935: }
0936:
0937: /**
0938: * Returns IE tab index for setting the tabIndex property for the on-screen DHTML for the object
0939: */
0940: @SuppressWarnings("unchecked")
0941: public void getIndex(
0942: org.directwebremoting.proxy.Callback<Integer> callback) {
0943: ScriptBuffer script = new ScriptBuffer();
0944: String callbackPrefix = "";
0945:
0946: if (callback != null) {
0947: callbackPrefix = "var reply = ";
0948: }
0949:
0950: script.appendCall(callbackPrefix + getContextPath()
0951: + "getIndex");
0952:
0953: if (callback != null) {
0954: String key = org.directwebremoting.extend.CallbackHelper
0955: .saveCallback(callback, Integer.class);
0956: script
0957: .appendCall("__System.activateCallback", key,
0958: "reply");
0959: }
0960:
0961: getScriptProxy().addScript(script);
0962: }
0963:
0964: /**
0965: * Sets IE tab index for setting the tabIndex property for the on-screen DHTML for the object;
0966: returns reference to self to facilitate method chaining;
0967: * @param intIndex any value in the valid range of -32767 to 32767
0968: * @param bRepaint if <code>true</code>, the view of this object is immediately updated, obviating the need to call <code>repaint()</code>.
0969: * @return this object
0970: */
0971: public jsx3.gui.Block setIndex(int intIndex, boolean bRepaint) {
0972: ScriptBuffer script = new ScriptBuffer();
0973: script.appendCall(getContextPath() + "setIndex", intIndex,
0974: bRepaint);
0975: getScriptProxy().addScript(script);
0976: return this ;
0977: }
0978:
0979: /**
0980: * Returns the left property of this object.
0981: * @param callback left.
0982: */
0983: @SuppressWarnings("unchecked")
0984: public void getLeft(
0985: org.directwebremoting.proxy.Callback<Integer> callback) {
0986: ScriptBuffer script = new ScriptBuffer();
0987: String callbackPrefix = "";
0988:
0989: if (callback != null) {
0990: callbackPrefix = "var reply = ";
0991: }
0992:
0993: script
0994: .appendCall(callbackPrefix + getContextPath()
0995: + "getLeft");
0996:
0997: if (callback != null) {
0998: String key = org.directwebremoting.extend.CallbackHelper
0999: .saveCallback(callback, Integer.class);
1000: script
1001: .appendCall("__System.activateCallback", key,
1002: "reply");
1003: }
1004:
1005: getScriptProxy().addScript(script);
1006: }
1007:
1008: /**
1009: * Sets the left property of this object. The left property specifies the horizontal offset of this object
1010: from its parent and only applies if this object is absolutely positioned.
1011: * @param vntLeft the left value. Only numeric values and percentages are supported. For example: 25, -10, 20%.
1012: * @param bRepaint if @vntLeft is in integer (a number with no modifier) and @bRepaint is true, the object's on-screen VIEW is immediately updated to match its MODEL, obviating the need to call '[object].repaint()'
1013: * @return this object.
1014: */
1015: public jsx3.gui.Block setLeft(int vntLeft, boolean bRepaint) {
1016: ScriptBuffer script = new ScriptBuffer();
1017: script.appendCall(getContextPath() + "setLeft", vntLeft,
1018: bRepaint);
1019: getScriptProxy().addScript(script);
1020: return this ;
1021: }
1022:
1023: /**
1024: * Sets the left property of this object. The left property specifies the horizontal offset of this object
1025: from its parent and only applies if this object is absolutely positioned.
1026: * @param vntLeft the left value. Only numeric values and percentages are supported. For example: 25, -10, 20%.
1027: * @param bRepaint if @vntLeft is in integer (a number with no modifier) and @bRepaint is true, the object's on-screen VIEW is immediately updated to match its MODEL, obviating the need to call '[object].repaint()'
1028: * @return this object.
1029: */
1030: public jsx3.gui.Block setLeft(String vntLeft, boolean bRepaint) {
1031: ScriptBuffer script = new ScriptBuffer();
1032: script.appendCall(getContextPath() + "setLeft", vntLeft,
1033: bRepaint);
1034: getScriptProxy().addScript(script);
1035: return this ;
1036: }
1037:
1038: /**
1039: * Set one to four dimensions at once. This operation is more efficient than calling more than one of
1040: setLeft, setTop, etc. Any argument can be null to indicate not to update it.
1041: * @param left the new left value or an array containing all four new values
1042: * @param top the new top value
1043: * @param width the new width value
1044: * @param height the new height value
1045: * @param bRepaint whether to update the display of this object immediately. If <code>left</code> is
1046: an <code>Array</code> then this parameter is the second parameter passed to this method.
1047: */
1048: public void setDimensions(String left, int top, int width,
1049: int height, boolean bRepaint) {
1050: ScriptBuffer script = new ScriptBuffer();
1051: script.appendCall(getContextPath() + "setDimensions", left,
1052: top, width, height, bRepaint);
1053: getScriptProxy().addScript(script);
1054: }
1055:
1056: /**
1057: * Set one to four dimensions at once. This operation is more efficient than calling more than one of
1058: setLeft, setTop, etc. Any argument can be null to indicate not to update it.
1059: * @param left the new left value or an array containing all four new values
1060: * @param top the new top value
1061: * @param width the new width value
1062: * @param height the new height value
1063: * @param bRepaint whether to update the display of this object immediately. If <code>left</code> is
1064: an <code>Array</code> then this parameter is the second parameter passed to this method.
1065: */
1066: public void setDimensions(Object[] left, int top, int width,
1067: int height, boolean bRepaint) {
1068: ScriptBuffer script = new ScriptBuffer();
1069: script.appendCall(getContextPath() + "setDimensions", left,
1070: top, width, height, bRepaint);
1071: getScriptProxy().addScript(script);
1072: }
1073:
1074: /**
1075: * Set one to four dimensions at once. This operation is more efficient than calling more than one of
1076: setLeft, setTop, etc. Any argument can be null to indicate not to update it.
1077: * @param left the new left value or an array containing all four new values
1078: * @param top the new top value
1079: * @param width the new width value
1080: * @param height the new height value
1081: * @param bRepaint whether to update the display of this object immediately. If <code>left</code> is
1082: an <code>Array</code> then this parameter is the second parameter passed to this method.
1083: */
1084: public void setDimensions(Object[] left, int top, String width,
1085: int height, boolean bRepaint) {
1086: ScriptBuffer script = new ScriptBuffer();
1087: script.appendCall(getContextPath() + "setDimensions", left,
1088: top, width, height, bRepaint);
1089: getScriptProxy().addScript(script);
1090: }
1091:
1092: /**
1093: * Set one to four dimensions at once. This operation is more efficient than calling more than one of
1094: setLeft, setTop, etc. Any argument can be null to indicate not to update it.
1095: * @param left the new left value or an array containing all four new values
1096: * @param top the new top value
1097: * @param width the new width value
1098: * @param height the new height value
1099: * @param bRepaint whether to update the display of this object immediately. If <code>left</code> is
1100: an <code>Array</code> then this parameter is the second parameter passed to this method.
1101: */
1102: public void setDimensions(String left, int top, String width,
1103: int height, boolean bRepaint) {
1104: ScriptBuffer script = new ScriptBuffer();
1105: script.appendCall(getContextPath() + "setDimensions", left,
1106: top, width, height, bRepaint);
1107: getScriptProxy().addScript(script);
1108: }
1109:
1110: /**
1111: * Set one to four dimensions at once. This operation is more efficient than calling more than one of
1112: setLeft, setTop, etc. Any argument can be null to indicate not to update it.
1113: * @param left the new left value or an array containing all four new values
1114: * @param top the new top value
1115: * @param width the new width value
1116: * @param height the new height value
1117: * @param bRepaint whether to update the display of this object immediately. If <code>left</code> is
1118: an <code>Array</code> then this parameter is the second parameter passed to this method.
1119: */
1120: public void setDimensions(Object[] left, int top, String width,
1121: String height, boolean bRepaint) {
1122: ScriptBuffer script = new ScriptBuffer();
1123: script.appendCall(getContextPath() + "setDimensions", left,
1124: top, width, height, bRepaint);
1125: getScriptProxy().addScript(script);
1126: }
1127:
1128: /**
1129: * Set one to four dimensions at once. This operation is more efficient than calling more than one of
1130: setLeft, setTop, etc. Any argument can be null to indicate not to update it.
1131: * @param left the new left value or an array containing all four new values
1132: * @param top the new top value
1133: * @param width the new width value
1134: * @param height the new height value
1135: * @param bRepaint whether to update the display of this object immediately. If <code>left</code> is
1136: an <code>Array</code> then this parameter is the second parameter passed to this method.
1137: */
1138: public void setDimensions(String left, String top, int width,
1139: int height, boolean bRepaint) {
1140: ScriptBuffer script = new ScriptBuffer();
1141: script.appendCall(getContextPath() + "setDimensions", left,
1142: top, width, height, bRepaint);
1143: getScriptProxy().addScript(script);
1144: }
1145:
1146: /**
1147: * Set one to four dimensions at once. This operation is more efficient than calling more than one of
1148: setLeft, setTop, etc. Any argument can be null to indicate not to update it.
1149: * @param left the new left value or an array containing all four new values
1150: * @param top the new top value
1151: * @param width the new width value
1152: * @param height the new height value
1153: * @param bRepaint whether to update the display of this object immediately. If <code>left</code> is
1154: an <code>Array</code> then this parameter is the second parameter passed to this method.
1155: */
1156: public void setDimensions(Object[] left, String top, String width,
1157: String height, boolean bRepaint) {
1158: ScriptBuffer script = new ScriptBuffer();
1159: script.appendCall(getContextPath() + "setDimensions", left,
1160: top, width, height, bRepaint);
1161: getScriptProxy().addScript(script);
1162: }
1163:
1164: /**
1165: * Set one to four dimensions at once. This operation is more efficient than calling more than one of
1166: setLeft, setTop, etc. Any argument can be null to indicate not to update it.
1167: * @param left the new left value or an array containing all four new values
1168: * @param top the new top value
1169: * @param width the new width value
1170: * @param height the new height value
1171: * @param bRepaint whether to update the display of this object immediately. If <code>left</code> is
1172: an <code>Array</code> then this parameter is the second parameter passed to this method.
1173: */
1174: public void setDimensions(Object[] left, String top, int width,
1175: int height, boolean bRepaint) {
1176: ScriptBuffer script = new ScriptBuffer();
1177: script.appendCall(getContextPath() + "setDimensions", left,
1178: top, width, height, bRepaint);
1179: getScriptProxy().addScript(script);
1180: }
1181:
1182: /**
1183: * Set one to four dimensions at once. This operation is more efficient than calling more than one of
1184: setLeft, setTop, etc. Any argument can be null to indicate not to update it.
1185: * @param left the new left value or an array containing all four new values
1186: * @param top the new top value
1187: * @param width the new width value
1188: * @param height the new height value
1189: * @param bRepaint whether to update the display of this object immediately. If <code>left</code> is
1190: an <code>Array</code> then this parameter is the second parameter passed to this method.
1191: */
1192: public void setDimensions(int left, int top, String width,
1193: int height, boolean bRepaint) {
1194: ScriptBuffer script = new ScriptBuffer();
1195: script.appendCall(getContextPath() + "setDimensions", left,
1196: top, width, height, bRepaint);
1197: getScriptProxy().addScript(script);
1198: }
1199:
1200: /**
1201: * Set one to four dimensions at once. This operation is more efficient than calling more than one of
1202: setLeft, setTop, etc. Any argument can be null to indicate not to update it.
1203: * @param left the new left value or an array containing all four new values
1204: * @param top the new top value
1205: * @param width the new width value
1206: * @param height the new height value
1207: * @param bRepaint whether to update the display of this object immediately. If <code>left</code> is
1208: an <code>Array</code> then this parameter is the second parameter passed to this method.
1209: */
1210: public void setDimensions(String left, int top, int width,
1211: String height, boolean bRepaint) {
1212: ScriptBuffer script = new ScriptBuffer();
1213: script.appendCall(getContextPath() + "setDimensions", left,
1214: top, width, height, bRepaint);
1215: getScriptProxy().addScript(script);
1216: }
1217:
1218: /**
1219: * Set one to four dimensions at once. This operation is more efficient than calling more than one of
1220: setLeft, setTop, etc. Any argument can be null to indicate not to update it.
1221: * @param left the new left value or an array containing all four new values
1222: * @param top the new top value
1223: * @param width the new width value
1224: * @param height the new height value
1225: * @param bRepaint whether to update the display of this object immediately. If <code>left</code> is
1226: an <code>Array</code> then this parameter is the second parameter passed to this method.
1227: */
1228: public void setDimensions(int left, String top, String width,
1229: int height, boolean bRepaint) {
1230: ScriptBuffer script = new ScriptBuffer();
1231: script.appendCall(getContextPath() + "setDimensions", left,
1232: top, width, height, bRepaint);
1233: getScriptProxy().addScript(script);
1234: }
1235:
1236: /**
1237: * Set one to four dimensions at once. This operation is more efficient than calling more than one of
1238: setLeft, setTop, etc. Any argument can be null to indicate not to update it.
1239: * @param left the new left value or an array containing all four new values
1240: * @param top the new top value
1241: * @param width the new width value
1242: * @param height the new height value
1243: * @param bRepaint whether to update the display of this object immediately. If <code>left</code> is
1244: an <code>Array</code> then this parameter is the second parameter passed to this method.
1245: */
1246: public void setDimensions(String left, String top, String width,
1247: String height, boolean bRepaint) {
1248: ScriptBuffer script = new ScriptBuffer();
1249: script.appendCall(getContextPath() + "setDimensions", left,
1250: top, width, height, bRepaint);
1251: getScriptProxy().addScript(script);
1252: }
1253:
1254: /**
1255: * Set one to four dimensions at once. This operation is more efficient than calling more than one of
1256: setLeft, setTop, etc. Any argument can be null to indicate not to update it.
1257: * @param left the new left value or an array containing all four new values
1258: * @param top the new top value
1259: * @param width the new width value
1260: * @param height the new height value
1261: * @param bRepaint whether to update the display of this object immediately. If <code>left</code> is
1262: an <code>Array</code> then this parameter is the second parameter passed to this method.
1263: */
1264: public void setDimensions(int left, int top, String width,
1265: String height, boolean bRepaint) {
1266: ScriptBuffer script = new ScriptBuffer();
1267: script.appendCall(getContextPath() + "setDimensions", left,
1268: top, width, height, bRepaint);
1269: getScriptProxy().addScript(script);
1270: }
1271:
1272: /**
1273: * Set one to four dimensions at once. This operation is more efficient than calling more than one of
1274: setLeft, setTop, etc. Any argument can be null to indicate not to update it.
1275: * @param left the new left value or an array containing all four new values
1276: * @param top the new top value
1277: * @param width the new width value
1278: * @param height the new height value
1279: * @param bRepaint whether to update the display of this object immediately. If <code>left</code> is
1280: an <code>Array</code> then this parameter is the second parameter passed to this method.
1281: */
1282: public void setDimensions(int left, int top, int width, int height,
1283: boolean bRepaint) {
1284: ScriptBuffer script = new ScriptBuffer();
1285: script.appendCall(getContextPath() + "setDimensions", left,
1286: top, width, height, bRepaint);
1287: getScriptProxy().addScript(script);
1288: }
1289:
1290: /**
1291: * Set one to four dimensions at once. This operation is more efficient than calling more than one of
1292: setLeft, setTop, etc. Any argument can be null to indicate not to update it.
1293: * @param left the new left value or an array containing all four new values
1294: * @param top the new top value
1295: * @param width the new width value
1296: * @param height the new height value
1297: * @param bRepaint whether to update the display of this object immediately. If <code>left</code> is
1298: an <code>Array</code> then this parameter is the second parameter passed to this method.
1299: */
1300: public void setDimensions(String left, String top, int width,
1301: String height, boolean bRepaint) {
1302: ScriptBuffer script = new ScriptBuffer();
1303: script.appendCall(getContextPath() + "setDimensions", left,
1304: top, width, height, bRepaint);
1305: getScriptProxy().addScript(script);
1306: }
1307:
1308: /**
1309: * Set one to four dimensions at once. This operation is more efficient than calling more than one of
1310: setLeft, setTop, etc. Any argument can be null to indicate not to update it.
1311: * @param left the new left value or an array containing all four new values
1312: * @param top the new top value
1313: * @param width the new width value
1314: * @param height the new height value
1315: * @param bRepaint whether to update the display of this object immediately. If <code>left</code> is
1316: an <code>Array</code> then this parameter is the second parameter passed to this method.
1317: */
1318: public void setDimensions(Object[] left, String top, String width,
1319: int height, boolean bRepaint) {
1320: ScriptBuffer script = new ScriptBuffer();
1321: script.appendCall(getContextPath() + "setDimensions", left,
1322: top, width, height, bRepaint);
1323: getScriptProxy().addScript(script);
1324: }
1325:
1326: /**
1327: * Set one to four dimensions at once. This operation is more efficient than calling more than one of
1328: setLeft, setTop, etc. Any argument can be null to indicate not to update it.
1329: * @param left the new left value or an array containing all four new values
1330: * @param top the new top value
1331: * @param width the new width value
1332: * @param height the new height value
1333: * @param bRepaint whether to update the display of this object immediately. If <code>left</code> is
1334: an <code>Array</code> then this parameter is the second parameter passed to this method.
1335: */
1336: public void setDimensions(Object[] left, String top, int width,
1337: String height, boolean bRepaint) {
1338: ScriptBuffer script = new ScriptBuffer();
1339: script.appendCall(getContextPath() + "setDimensions", left,
1340: top, width, height, bRepaint);
1341: getScriptProxy().addScript(script);
1342: }
1343:
1344: /**
1345: * Set one to four dimensions at once. This operation is more efficient than calling more than one of
1346: setLeft, setTop, etc. Any argument can be null to indicate not to update it.
1347: * @param left the new left value or an array containing all four new values
1348: * @param top the new top value
1349: * @param width the new width value
1350: * @param height the new height value
1351: * @param bRepaint whether to update the display of this object immediately. If <code>left</code> is
1352: an <code>Array</code> then this parameter is the second parameter passed to this method.
1353: */
1354: public void setDimensions(Object[] left, int top, int width,
1355: String height, boolean bRepaint) {
1356: ScriptBuffer script = new ScriptBuffer();
1357: script.appendCall(getContextPath() + "setDimensions", left,
1358: top, width, height, bRepaint);
1359: getScriptProxy().addScript(script);
1360: }
1361:
1362: /**
1363: * Set one to four dimensions at once. This operation is more efficient than calling more than one of
1364: setLeft, setTop, etc. Any argument can be null to indicate not to update it.
1365: * @param left the new left value or an array containing all four new values
1366: * @param top the new top value
1367: * @param width the new width value
1368: * @param height the new height value
1369: * @param bRepaint whether to update the display of this object immediately. If <code>left</code> is
1370: an <code>Array</code> then this parameter is the second parameter passed to this method.
1371: */
1372: public void setDimensions(int left, String top, int width,
1373: String height, boolean bRepaint) {
1374: ScriptBuffer script = new ScriptBuffer();
1375: script.appendCall(getContextPath() + "setDimensions", left,
1376: top, width, height, bRepaint);
1377: getScriptProxy().addScript(script);
1378: }
1379:
1380: /**
1381: * Set one to four dimensions at once. This operation is more efficient than calling more than one of
1382: setLeft, setTop, etc. Any argument can be null to indicate not to update it.
1383: * @param left the new left value or an array containing all four new values
1384: * @param top the new top value
1385: * @param width the new width value
1386: * @param height the new height value
1387: * @param bRepaint whether to update the display of this object immediately. If <code>left</code> is
1388: an <code>Array</code> then this parameter is the second parameter passed to this method.
1389: */
1390: public void setDimensions(int left, String top, int width,
1391: int height, boolean bRepaint) {
1392: ScriptBuffer script = new ScriptBuffer();
1393: script.appendCall(getContextPath() + "setDimensions", left,
1394: top, width, height, bRepaint);
1395: getScriptProxy().addScript(script);
1396: }
1397:
1398: /**
1399: * Set one to four dimensions at once. This operation is more efficient than calling more than one of
1400: setLeft, setTop, etc. Any argument can be null to indicate not to update it.
1401: * @param left the new left value or an array containing all four new values
1402: * @param top the new top value
1403: * @param width the new width value
1404: * @param height the new height value
1405: * @param bRepaint whether to update the display of this object immediately. If <code>left</code> is
1406: an <code>Array</code> then this parameter is the second parameter passed to this method.
1407: */
1408: public void setDimensions(String left, String top, String width,
1409: int height, boolean bRepaint) {
1410: ScriptBuffer script = new ScriptBuffer();
1411: script.appendCall(getContextPath() + "setDimensions", left,
1412: top, width, height, bRepaint);
1413: getScriptProxy().addScript(script);
1414: }
1415:
1416: /**
1417: * Set one to four dimensions at once. This operation is more efficient than calling more than one of
1418: setLeft, setTop, etc. Any argument can be null to indicate not to update it.
1419: * @param left the new left value or an array containing all four new values
1420: * @param top the new top value
1421: * @param width the new width value
1422: * @param height the new height value
1423: * @param bRepaint whether to update the display of this object immediately. If <code>left</code> is
1424: an <code>Array</code> then this parameter is the second parameter passed to this method.
1425: */
1426: public void setDimensions(int left, int top, int width,
1427: String height, boolean bRepaint) {
1428: ScriptBuffer script = new ScriptBuffer();
1429: script.appendCall(getContextPath() + "setDimensions", left,
1430: top, width, height, bRepaint);
1431: getScriptProxy().addScript(script);
1432: }
1433:
1434: /**
1435: * Set one to four dimensions at once. This operation is more efficient than calling more than one of
1436: setLeft, setTop, etc. Any argument can be null to indicate not to update it.
1437: * @param left the new left value or an array containing all four new values
1438: * @param top the new top value
1439: * @param width the new width value
1440: * @param height the new height value
1441: * @param bRepaint whether to update the display of this object immediately. If <code>left</code> is
1442: an <code>Array</code> then this parameter is the second parameter passed to this method.
1443: */
1444: public void setDimensions(String left, int top, String width,
1445: String height, boolean bRepaint) {
1446: ScriptBuffer script = new ScriptBuffer();
1447: script.appendCall(getContextPath() + "setDimensions", left,
1448: top, width, height, bRepaint);
1449: getScriptProxy().addScript(script);
1450: }
1451:
1452: /**
1453: * Set one to four dimensions at once. This operation is more efficient than calling more than one of
1454: setLeft, setTop, etc. Any argument can be null to indicate not to update it.
1455: * @param left the new left value or an array containing all four new values
1456: * @param top the new top value
1457: * @param width the new width value
1458: * @param height the new height value
1459: * @param bRepaint whether to update the display of this object immediately. If <code>left</code> is
1460: an <code>Array</code> then this parameter is the second parameter passed to this method.
1461: */
1462: public void setDimensions(int left, String top, String width,
1463: String height, boolean bRepaint) {
1464: ScriptBuffer script = new ScriptBuffer();
1465: script.appendCall(getContextPath() + "setDimensions", left,
1466: top, width, height, bRepaint);
1467: getScriptProxy().addScript(script);
1468: }
1469:
1470: /**
1471: * Returns the dimensions in an array of four int values
1472: * @param callback [left,top,width,height]
1473: */
1474: @SuppressWarnings("unchecked")
1475: public void getDimensions(
1476: org.directwebremoting.proxy.Callback<Object[]> callback) {
1477: ScriptBuffer script = new ScriptBuffer();
1478: String callbackPrefix = "";
1479:
1480: if (callback != null) {
1481: callbackPrefix = "var reply = ";
1482: }
1483:
1484: script.appendCall(callbackPrefix + getContextPath()
1485: + "getDimensions");
1486:
1487: if (callback != null) {
1488: String key = org.directwebremoting.extend.CallbackHelper
1489: .saveCallback(callback, Object[].class);
1490: script
1491: .appendCall("__System.activateCallback", key,
1492: "reply");
1493: }
1494:
1495: getScriptProxy().addScript(script);
1496: }
1497:
1498: /**
1499: * Returns CSS property value(s) for a margin (margin:4px;)
1500: */
1501: @SuppressWarnings("unchecked")
1502: public void getMargin(
1503: org.directwebremoting.proxy.Callback<String> callback) {
1504: ScriptBuffer script = new ScriptBuffer();
1505: String callbackPrefix = "";
1506:
1507: if (callback != null) {
1508: callbackPrefix = "var reply = ";
1509: }
1510:
1511: script.appendCall(callbackPrefix + getContextPath()
1512: + "getMargin");
1513:
1514: if (callback != null) {
1515: String key = org.directwebremoting.extend.CallbackHelper
1516: .saveCallback(callback, String.class);
1517: script
1518: .appendCall("__System.activateCallback", key,
1519: "reply");
1520: }
1521:
1522: getScriptProxy().addScript(script);
1523: }
1524:
1525: /**
1526: * Sets CSS property value for margin.
1527: * @param strCSS The preferred method to set margin is by moving clockwise, beginning with the <b>north</b>
1528: compass position, <b>without</b> the pixel designation. For example, to specify a top margin of 8 pixels, use <code>8 0 0 0</code>. CSS syntax is
1529: supported, but requires that pixels be designated. For example, using <code>margin:5px;margin-left:10px;</code>, is equivalent to
1530: <code>5 5 5 10</code>.
1531: * @param bRecalc if true, the VIEW will be updated with requiring a repaint
1532: * @return this object
1533: */
1534: public jsx3.gui.Block setMargin(String strCSS, boolean bRecalc) {
1535: ScriptBuffer script = new ScriptBuffer();
1536: script.appendCall(getContextPath() + "setMargin", strCSS,
1537: bRecalc);
1538: getScriptProxy().addScript(script);
1539: return this ;
1540: }
1541:
1542: /**
1543: * Returns the overflow property for the object, that defines how its on-screen view will behave when its contents are larger than its specified width and/or height
1544: * @param callback [jsx3.gui.Block.OVERFLOWSCROLL, jsx3.gui.Block.OVERFLOWHIDDEN, jsx3.gui.Block.OVERFLOWEXPAND]
1545: */
1546: @SuppressWarnings("unchecked")
1547: public void getOverflow(
1548: org.directwebremoting.proxy.Callback<Integer> callback) {
1549: ScriptBuffer script = new ScriptBuffer();
1550: String callbackPrefix = "";
1551:
1552: if (callback != null) {
1553: callbackPrefix = "var reply = ";
1554: }
1555:
1556: script.appendCall(callbackPrefix + getContextPath()
1557: + "getOverflow");
1558:
1559: if (callback != null) {
1560: String key = org.directwebremoting.extend.CallbackHelper
1561: .saveCallback(callback, Integer.class);
1562: script
1563: .appendCall("__System.activateCallback", key,
1564: "reply");
1565: }
1566:
1567: getScriptProxy().addScript(script);
1568: }
1569:
1570: /**
1571: * Sets the overflow property for the object, that defines how its on-screen view will behave when its contents are larger than its specified width and/or height;
1572: returns reference to self to facilitate method chaining;
1573: * @param OVERFLOW [jsx3.gui.Block.OVERFLOWSCROLL, jsx3.gui.Block.OVERFLOWHIDDEN, jsx3.gui.Block.OVERFLOWEXPAND]
1574: * @return this object
1575: */
1576: public jsx3.gui.Block setOverflow(int OVERFLOW) {
1577: ScriptBuffer script = new ScriptBuffer();
1578: script.appendCall(getContextPath() + "setOverflow", OVERFLOW);
1579: getScriptProxy().addScript(script);
1580: return this ;
1581: }
1582:
1583: /**
1584: * Returns CSS property value(s) for a padding (padding:4px;)
1585: */
1586: @SuppressWarnings("unchecked")
1587: public void getPadding(
1588: org.directwebremoting.proxy.Callback<String> callback) {
1589: ScriptBuffer script = new ScriptBuffer();
1590: String callbackPrefix = "";
1591:
1592: if (callback != null) {
1593: callbackPrefix = "var reply = ";
1594: }
1595:
1596: script.appendCall(callbackPrefix + getContextPath()
1597: + "getPadding");
1598:
1599: if (callback != null) {
1600: String key = org.directwebremoting.extend.CallbackHelper
1601: .saveCallback(callback, String.class);
1602: script
1603: .appendCall("__System.activateCallback", key,
1604: "reply");
1605: }
1606:
1607: getScriptProxy().addScript(script);
1608: }
1609:
1610: /**
1611: * Sets the CSS property value for padding an object.
1612: * @param strCSS The preferred method to set padding is by moving clockwise, beginning with the <b>north</b>
1613: compass position, <b>without</b> the pixel designation. For example, to specify a top padding of 8 pixels, use <code>8 0 0 0</code>. CSS syntax is
1614: supported, but requires that pixels be designated. For example, using <code>padding:5px;padding-left:10px;</code>, is equivalent to
1615: <code>5 5 5 10</code>.
1616: * @param bRecalc if true, the VIEW will be updated with requiring a repaint
1617: * @return this object
1618: */
1619: public jsx3.gui.Block setPadding(String strCSS, boolean bRecalc) {
1620: ScriptBuffer script = new ScriptBuffer();
1621: script.appendCall(getContextPath() + "setPadding", strCSS,
1622: bRecalc);
1623: getScriptProxy().addScript(script);
1624: return this ;
1625: }
1626:
1627: /**
1628: * Returns if the instance is relatively positioned on-screen; returns one of: jsx3.gui.Block.ABSOLUTE jsx3.gui.Block.RELATIVE
1629: */
1630: @SuppressWarnings("unchecked")
1631: public void getRelativePosition(
1632: org.directwebremoting.proxy.Callback<Integer> callback) {
1633: ScriptBuffer script = new ScriptBuffer();
1634: String callbackPrefix = "";
1635:
1636: if (callback != null) {
1637: callbackPrefix = "var reply = ";
1638: }
1639:
1640: script.appendCall(callbackPrefix + getContextPath()
1641: + "getRelativePosition");
1642:
1643: if (callback != null) {
1644: String key = org.directwebremoting.extend.CallbackHelper
1645: .saveCallback(callback, Integer.class);
1646: script
1647: .appendCall("__System.activateCallback", key,
1648: "reply");
1649: }
1650:
1651: getScriptProxy().addScript(script);
1652: }
1653:
1654: /**
1655: * Sets if the jsx3.gui.Block instance is relatively positioned on-screen;
1656: returns reference to self to facilitate method chaining;
1657: * @param intRelative jsx3.gui.Block.RELATIVE will be applied to the view if null. One of: jsx3.gui.Block.RELATIVE jsx3.gui.Block.ABSOLUTE
1658: * @param bRepaint if <code>true</code>, the view of this object is immediately updated, obviating the need to call <code>repaint()</code>.
1659: * @return this object
1660: */
1661: public jsx3.gui.Block setRelativePosition(int intRelative,
1662: boolean bRepaint) {
1663: ScriptBuffer script = new ScriptBuffer();
1664: script.appendCall(getContextPath() + "setRelativePosition",
1665: intRelative, bRepaint);
1666: getScriptProxy().addScript(script);
1667: return this ;
1668: }
1669:
1670: /**
1671: * Returns HTML tag name to use when rendering the object on-screen (span is the default); if the property is null,
1672: jsx3.gui.Block.DEFAULTTAGNAME is used;
1673: * @param callback valid HTML tag name
1674: */
1675: @SuppressWarnings("unchecked")
1676: public void getTagName(
1677: org.directwebremoting.proxy.Callback<String> callback) {
1678: ScriptBuffer script = new ScriptBuffer();
1679: String callbackPrefix = "";
1680:
1681: if (callback != null) {
1682: callbackPrefix = "var reply = ";
1683: }
1684:
1685: script.appendCall(callbackPrefix + getContextPath()
1686: + "getTagName");
1687:
1688: if (callback != null) {
1689: String key = org.directwebremoting.extend.CallbackHelper
1690: .saveCallback(callback, String.class);
1691: script
1692: .appendCall("__System.activateCallback", key,
1693: "reply");
1694: }
1695:
1696: getScriptProxy().addScript(script);
1697: }
1698:
1699: /**
1700: * Sets HTML tag name to use when rendering the object on-screen (jsx3.gui.Block.DEFAULTTAGNAME is the default);
1701: returns reference to self to facilitate method chaining;
1702: * @param strTagName valid HTML tag name (span, div, form, ol, ul, li, etc); if null is passed, the getter will use jsx3.gui.Block.DEFAULTTAGNAME
1703: * @return this object
1704: */
1705: public jsx3.gui.Block setTagName(String strTagName) {
1706: ScriptBuffer script = new ScriptBuffer();
1707: script.appendCall(getContextPath() + "setTagName", strTagName);
1708: getScriptProxy().addScript(script);
1709: return this ;
1710: }
1711:
1712: /**
1713: * Returns the text/HTML for the control to be displayed on-screen; returns an empty string if null; since the text
1714: is rendered on-screen as browser-native HTML, the equivalent of an empty tag (e.g., <span\>) would be an
1715: enclosing tag with an empty string (no content): <span></span>. To return null would be equivalent to
1716: <span>null</span>, which is not the same as <span/>
1717: */
1718: @SuppressWarnings("unchecked")
1719: public void getText(
1720: org.directwebremoting.proxy.Callback<String> callback) {
1721: ScriptBuffer script = new ScriptBuffer();
1722: String callbackPrefix = "";
1723:
1724: if (callback != null) {
1725: callbackPrefix = "var reply = ";
1726: }
1727:
1728: script
1729: .appendCall(callbackPrefix + getContextPath()
1730: + "getText");
1731:
1732: if (callback != null) {
1733: String key = org.directwebremoting.extend.CallbackHelper
1734: .saveCallback(callback, String.class);
1735: script
1736: .appendCall("__System.activateCallback", key,
1737: "reply");
1738: }
1739:
1740: getScriptProxy().addScript(script);
1741: }
1742:
1743: /**
1744: * Sets the text/HTML for the control to be displayed on-screen;
1745: returns reference to self to facilitate method chaining;
1746: * @param strText text/HTML
1747: * @param bRepaint if <code>true</code>, the view of this object is immediately updated, obviating the need to call <code>repaint()</code>.
1748: */
1749: public jsx3.gui.Block setText(String strText, boolean bRepaint) {
1750: ScriptBuffer script = new ScriptBuffer();
1751: script.appendCall(getContextPath() + "setText", strText,
1752: bRepaint);
1753: getScriptProxy().addScript(script);
1754: return this ;
1755: }
1756:
1757: /**
1758: * Returns the CSS text-align property for the object; if no property value exists, jsx3.gui.Block.ALIGNLEFT is returned by default
1759: * @param callback one of: jsx3.gui.Block.ALIGNLEFT, jsx3.gui.Block.ALIGNRIGHT, jsx3.gui.Block.ALIGNCENTER
1760: */
1761: @SuppressWarnings("unchecked")
1762: public void getTextAlign(
1763: org.directwebremoting.proxy.Callback<String> callback) {
1764: ScriptBuffer script = new ScriptBuffer();
1765: String callbackPrefix = "";
1766:
1767: if (callback != null) {
1768: callbackPrefix = "var reply = ";
1769: }
1770:
1771: script.appendCall(callbackPrefix + getContextPath()
1772: + "getTextAlign");
1773:
1774: if (callback != null) {
1775: String key = org.directwebremoting.extend.CallbackHelper
1776: .saveCallback(callback, String.class);
1777: script
1778: .appendCall("__System.activateCallback", key,
1779: "reply");
1780: }
1781:
1782: getScriptProxy().addScript(script);
1783: }
1784:
1785: /**
1786: * Sets the CSS text-align property for the object;
1787: returns reference to self to facilitate method chaining;
1788: * @param ALIGN one of: jsx3.gui.Block.ALIGNLEFT, jsx3.gui.Block.ALIGNRIGHT, jsx3.gui.Block.ALIGNCENTER
1789: */
1790: public jsx3.gui.Block setTextAlign(String ALIGN) {
1791: ScriptBuffer script = new ScriptBuffer();
1792: script.appendCall(getContextPath() + "setTextAlign", ALIGN);
1793: getScriptProxy().addScript(script);
1794: return this ;
1795: }
1796:
1797: /**
1798: * Returns the tooltip text to display when the object is hovered over. Returns an empty string if null.
1799: */
1800: @SuppressWarnings("unchecked")
1801: public void getTip(
1802: org.directwebremoting.proxy.Callback<String> callback) {
1803: ScriptBuffer script = new ScriptBuffer();
1804: String callbackPrefix = "";
1805:
1806: if (callback != null) {
1807: callbackPrefix = "var reply = ";
1808: }
1809:
1810: script.appendCall(callbackPrefix + getContextPath() + "getTip");
1811:
1812: if (callback != null) {
1813: String key = org.directwebremoting.extend.CallbackHelper
1814: .saveCallback(callback, String.class);
1815: script
1816: .appendCall("__System.activateCallback", key,
1817: "reply");
1818: }
1819:
1820: getScriptProxy().addScript(script);
1821: }
1822:
1823: /**
1824: * Sets the tooltip text to display when the object is hovered over. Updates Model and View.
1825: Returns reference to self to facilitate method chaining;
1826: * @param strTip text/HTML
1827: * @return this object
1828: */
1829: public jsx3.gui.Block setTip(String strTip) {
1830: ScriptBuffer script = new ScriptBuffer();
1831: script.appendCall(getContextPath() + "setTip", strTip);
1832: getScriptProxy().addScript(script);
1833: return this ;
1834: }
1835:
1836: /**
1837: * Returns the top property of this object.
1838: * @param callback top.
1839: */
1840: @SuppressWarnings("unchecked")
1841: public void getTop(
1842: org.directwebremoting.proxy.Callback<Integer> callback) {
1843: ScriptBuffer script = new ScriptBuffer();
1844: String callbackPrefix = "";
1845:
1846: if (callback != null) {
1847: callbackPrefix = "var reply = ";
1848: }
1849:
1850: script.appendCall(callbackPrefix + getContextPath() + "getTop");
1851:
1852: if (callback != null) {
1853: String key = org.directwebremoting.extend.CallbackHelper
1854: .saveCallback(callback, Integer.class);
1855: script
1856: .appendCall("__System.activateCallback", key,
1857: "reply");
1858: }
1859:
1860: getScriptProxy().addScript(script);
1861: }
1862:
1863: /**
1864: * Sets the top property of this object. The top property specifies the vertical offset of this object
1865: from its parent and only applies if this object is absolutely positioned.
1866: * @param vntTop the top value. Only numeric values and percentages are supported. For example: 25, -10, 20%.
1867: * @param bRepaint if <code>true</code>, the view of this object is immediately updated, obviating the need to call <code>repaint()</code>.
1868: * @return this object.
1869: */
1870: public jsx3.gui.Block setTop(String vntTop, boolean bRepaint) {
1871: ScriptBuffer script = new ScriptBuffer();
1872: script
1873: .appendCall(getContextPath() + "setTop", vntTop,
1874: bRepaint);
1875: getScriptProxy().addScript(script);
1876: return this ;
1877: }
1878:
1879: /**
1880: * Sets the top property of this object. The top property specifies the vertical offset of this object
1881: from its parent and only applies if this object is absolutely positioned.
1882: * @param vntTop the top value. Only numeric values and percentages are supported. For example: 25, -10, 20%.
1883: * @param bRepaint if <code>true</code>, the view of this object is immediately updated, obviating the need to call <code>repaint()</code>.
1884: * @return this object.
1885: */
1886: public jsx3.gui.Block setTop(int vntTop, boolean bRepaint) {
1887: ScriptBuffer script = new ScriptBuffer();
1888: script
1889: .appendCall(getContextPath() + "setTop", vntTop,
1890: bRepaint);
1891: getScriptProxy().addScript(script);
1892: return this ;
1893: }
1894:
1895: /**
1896: * Returns the visibility property for the object
1897: * @param callback [jsx3.gui.Block.VISIBILITYVISIBLE, jsx3.gui.Block.VISIBILITYHIDDEN]
1898: */
1899: @SuppressWarnings("unchecked")
1900: public void getVisibility(
1901: org.directwebremoting.proxy.Callback<String> callback) {
1902: ScriptBuffer script = new ScriptBuffer();
1903: String callbackPrefix = "";
1904:
1905: if (callback != null) {
1906: callbackPrefix = "var reply = ";
1907: }
1908:
1909: script.appendCall(callbackPrefix + getContextPath()
1910: + "getVisibility");
1911:
1912: if (callback != null) {
1913: String key = org.directwebremoting.extend.CallbackHelper
1914: .saveCallback(callback, String.class);
1915: script
1916: .appendCall("__System.activateCallback", key,
1917: "reply");
1918: }
1919:
1920: getScriptProxy().addScript(script);
1921: }
1922:
1923: /**
1924: * Sets the CSS visibility property the object
1925: * @param VISIBILITY [jsx3.gui.Block.VISIBILITYVISIBLE, jsx3.gui.Block.VISIBILITYHIDDEN]
1926: * @param bRepaint if <code>true</code>, the view of this object is immediately updated, obviating the need to call <code>repaint()</code>.
1927: */
1928: public void setVisibility(String VISIBILITY, boolean bRepaint) {
1929: ScriptBuffer script = new ScriptBuffer();
1930: script.appendCall(getContextPath() + "setVisibility",
1931: VISIBILITY, bRepaint);
1932: getScriptProxy().addScript(script);
1933: }
1934:
1935: /**
1936: * Returns the width property of this object.
1937: * @param callback width.
1938: */
1939: @SuppressWarnings("unchecked")
1940: public void getWidth(
1941: org.directwebremoting.proxy.Callback<Integer> callback) {
1942: ScriptBuffer script = new ScriptBuffer();
1943: String callbackPrefix = "";
1944:
1945: if (callback != null) {
1946: callbackPrefix = "var reply = ";
1947: }
1948:
1949: script.appendCall(callbackPrefix + getContextPath()
1950: + "getWidth");
1951:
1952: if (callback != null) {
1953: String key = org.directwebremoting.extend.CallbackHelper
1954: .saveCallback(callback, Integer.class);
1955: script
1956: .appendCall("__System.activateCallback", key,
1957: "reply");
1958: }
1959:
1960: getScriptProxy().addScript(script);
1961: }
1962:
1963: /**
1964: * Sets the width property of this object.
1965: * @param vntWidth the width as non-negative integer or non-negative percentage. For example: 45%, 12.
1966: * @param bRepaint if <code>true</code>, the view of this object is immediately updated, obviating the need to call <code>repaint()</code>.
1967: * @return this object.
1968: */
1969: public jsx3.gui.Block setWidth(String vntWidth, boolean bRepaint) {
1970: ScriptBuffer script = new ScriptBuffer();
1971: script.appendCall(getContextPath() + "setWidth", vntWidth,
1972: bRepaint);
1973: getScriptProxy().addScript(script);
1974: return this ;
1975: }
1976:
1977: /**
1978: * Sets the width property of this object.
1979: * @param vntWidth the width as non-negative integer or non-negative percentage. For example: 45%, 12.
1980: * @param bRepaint if <code>true</code>, the view of this object is immediately updated, obviating the need to call <code>repaint()</code>.
1981: * @return this object.
1982: */
1983: public jsx3.gui.Block setWidth(int vntWidth, boolean bRepaint) {
1984: ScriptBuffer script = new ScriptBuffer();
1985: script.appendCall(getContextPath() + "setWidth", vntWidth,
1986: bRepaint);
1987: getScriptProxy().addScript(script);
1988: return this ;
1989: }
1990:
1991: /**
1992: * Returns the CSS z-index property
1993: */
1994: @SuppressWarnings("unchecked")
1995: public void getZIndex(
1996: org.directwebremoting.proxy.Callback<Integer> callback) {
1997: ScriptBuffer script = new ScriptBuffer();
1998: String callbackPrefix = "";
1999:
2000: if (callback != null) {
2001: callbackPrefix = "var reply = ";
2002: }
2003:
2004: script.appendCall(callbackPrefix + getContextPath()
2005: + "getZIndex");
2006:
2007: if (callback != null) {
2008: String key = org.directwebremoting.extend.CallbackHelper
2009: .saveCallback(callback, Integer.class);
2010: script
2011: .appendCall("__System.activateCallback", key,
2012: "reply");
2013: }
2014:
2015: getScriptProxy().addScript(script);
2016: }
2017:
2018: /**
2019: * Sets the CSS z-index for the object
2020: * @param intZIndex z-index value
2021: * @param bRepaint if <code>true</code>, the view of this object is immediately updated, obviating the need to call <code>repaint()</code>.
2022: */
2023: public void setZIndex(int intZIndex, boolean bRepaint) {
2024: ScriptBuffer script = new ScriptBuffer();
2025: script.appendCall(getContextPath() + "setZIndex", intZIndex,
2026: bRepaint);
2027: getScriptProxy().addScript(script);
2028: }
2029:
2030: /**
2031: * displays a "blocking mask" inside the block to stop user interactions with content within the block. Applies only to Blocks. Use only on blocks with no padding (padding:0px)
2032: * @param strMessage text/message to display in the blocking mask to tell the user it is disabled
2033: */
2034: public void showMask(String strMessage) {
2035: ScriptBuffer script = new ScriptBuffer();
2036: script.appendCall(getContextPath() + "showMask", strMessage);
2037: getScriptProxy().addScript(script);
2038: }
2039:
2040: /**
2041: * removes the "blocking" mask inside the block to stop user interactions with existing content
2042: */
2043: public void hideMask() {
2044: ScriptBuffer script = new ScriptBuffer();
2045: script.appendCall(getContextPath() + "hideMask");
2046: getScriptProxy().addScript(script);
2047: }
2048:
2049: /**
2050: * Publishes a model event. This method both evaluates any registered event script for the given event type
2051: and publishes the event through the EventDispatcher interface. This method ensures that any
2052: registered event script is executed in isolation to prevent most side effects.
2053: * @param strType the event type, one of the model event types defined as static fields in this class
2054: * @param objContext JavaScript object array with name/value pairs that provide a local
2055: variable stack for the execution of the event script. This argument is also passed as the <code>context</code>
2056: property of the event object that is published through the <code>EventDispatcher</code> interface.
2057: * @return the result of evaluating the event script or <code>null</code> if not event script is registered
2058: */
2059: @SuppressWarnings("unchecked")
2060: public jsx3.lang.Object doEvent(String strType,
2061: jsx3.lang.Object objContext) {
2062: String extension = "doEvent(\"" + strType + "\", \""
2063: + objContext + "\").";
2064: try {
2065: java.lang.reflect.Constructor<jsx3.lang.Object> ctor = jsx3.lang.Object.class
2066: .getConstructor(Context.class, String.class,
2067: ScriptProxy.class);
2068: return ctor.newInstance(this , extension, getScriptProxy());
2069: } catch (Exception ex) {
2070: throw new IllegalArgumentException("Unsupported type: "
2071: + jsx3.lang.Object.class.getName());
2072: }
2073: }
2074:
2075: /**
2076: * Publishes a model event. This method both evaluates any registered event script for the given event type
2077: and publishes the event through the EventDispatcher interface. This method ensures that any
2078: registered event script is executed in isolation to prevent most side effects.
2079: * @param strType the event type, one of the model event types defined as static fields in this class
2080: * @param objContext JavaScript object array with name/value pairs that provide a local
2081: variable stack for the execution of the event script. This argument is also passed as the <code>context</code>
2082: property of the event object that is published through the <code>EventDispatcher</code> interface.
2083: * @param returnType The expected return type
2084: * @return the result of evaluating the event script or <code>null</code> if not event script is registered
2085: */
2086: @SuppressWarnings("unchecked")
2087: public <T> T doEvent(String strType, jsx3.lang.Object objContext,
2088: Class<T> returnType) {
2089: String extension = "doEvent(\"" + strType + "\", \""
2090: + objContext + "\").";
2091: try {
2092: java.lang.reflect.Constructor<T> ctor = returnType
2093: .getConstructor(Context.class, String.class,
2094: ScriptProxy.class);
2095: return ctor.newInstance(this , extension, getScriptProxy());
2096: } catch (Exception ex) {
2097: throw new IllegalArgumentException(
2098: "Unsupported return type: " + returnType.getName());
2099: }
2100: }
2101:
2102: /**
2103: * Returns whether is object supports programmatic drag, meanining it will allow any contained item to be
2104: dragged and dropped on another container supporting drop.
2105: * @param callback <code>jsx3.Boolean.TRUE</code> or <code>jsx3.Boolean.FALSE</code>
2106: */
2107: @SuppressWarnings("unchecked")
2108: public void getCanDrag(
2109: org.directwebremoting.proxy.Callback<Integer> callback) {
2110: ScriptBuffer script = new ScriptBuffer();
2111: String callbackPrefix = "";
2112:
2113: if (callback != null) {
2114: callbackPrefix = "var reply = ";
2115: }
2116:
2117: script.appendCall(callbackPrefix + getContextPath()
2118: + "getCanDrag");
2119:
2120: if (callback != null) {
2121: String key = org.directwebremoting.extend.CallbackHelper
2122: .saveCallback(callback, Integer.class);
2123: script
2124: .appendCall("__System.activateCallback", key,
2125: "reply");
2126: }
2127:
2128: getScriptProxy().addScript(script);
2129: }
2130:
2131: /**
2132: * Returns whether this object can be the target of a drop event.
2133: * @param callback <code>jsx3.Boolean.TRUE</code> or <code>jsx3.Boolean.FALSE</code>
2134: */
2135: @SuppressWarnings("unchecked")
2136: public void getCanDrop(
2137: org.directwebremoting.proxy.Callback<Integer> callback) {
2138: ScriptBuffer script = new ScriptBuffer();
2139: String callbackPrefix = "";
2140:
2141: if (callback != null) {
2142: callbackPrefix = "var reply = ";
2143: }
2144:
2145: script.appendCall(callbackPrefix + getContextPath()
2146: + "getCanDrop");
2147:
2148: if (callback != null) {
2149: String key = org.directwebremoting.extend.CallbackHelper
2150: .saveCallback(callback, Integer.class);
2151: script
2152: .appendCall("__System.activateCallback", key,
2153: "reply");
2154: }
2155:
2156: getScriptProxy().addScript(script);
2157: }
2158:
2159: /**
2160: * Returns whether is object can be moved around the screen (this is not the same as drag/drop).
2161: * @param callback <code>jsx3.Boolean.TRUE</code> or <code>jsx3.Boolean.FALSE</code>
2162: */
2163: @SuppressWarnings("unchecked")
2164: public void getCanMove(
2165: org.directwebremoting.proxy.Callback<Integer> callback) {
2166: ScriptBuffer script = new ScriptBuffer();
2167: String callbackPrefix = "";
2168:
2169: if (callback != null) {
2170: callbackPrefix = "var reply = ";
2171: }
2172:
2173: script.appendCall(callbackPrefix + getContextPath()
2174: + "getCanMove");
2175:
2176: if (callback != null) {
2177: String key = org.directwebremoting.extend.CallbackHelper
2178: .saveCallback(callback, Integer.class);
2179: script
2180: .appendCall("__System.activateCallback", key,
2181: "reply");
2182: }
2183:
2184: getScriptProxy().addScript(script);
2185: }
2186:
2187: /**
2188: * Returns whether is object can be spyglassed.
2189: * @param callback <code>jsx3.Boolean.TRUE</code> or <code>jsx3.Boolean.FALSE</code>
2190: */
2191: @SuppressWarnings("unchecked")
2192: public void getCanSpy(
2193: org.directwebremoting.proxy.Callback<Integer> callback) {
2194: ScriptBuffer script = new ScriptBuffer();
2195: String callbackPrefix = "";
2196:
2197: if (callback != null) {
2198: callbackPrefix = "var reply = ";
2199: }
2200:
2201: script.appendCall(callbackPrefix + getContextPath()
2202: + "getCanSpy");
2203:
2204: if (callback != null) {
2205: String key = org.directwebremoting.extend.CallbackHelper
2206: .saveCallback(callback, Integer.class);
2207: script
2208: .appendCall("__System.activateCallback", key,
2209: "reply");
2210: }
2211:
2212: getScriptProxy().addScript(script);
2213: }
2214:
2215: /**
2216: * Returns the event script registered for the given event type. This script could have been set by the
2217: setEvent() method or during component deserialization.
2218: * @param strType the event type, one of the model event types defined as static fields in this class
2219: * @param callback the JavaScript event script
2220: */
2221: @SuppressWarnings("unchecked")
2222: public void getEvent(String strType,
2223: org.directwebremoting.proxy.Callback<String> callback) {
2224: ScriptBuffer script = new ScriptBuffer();
2225: String callbackPrefix = "";
2226:
2227: if (callback != null) {
2228: callbackPrefix = "var reply = ";
2229: }
2230:
2231: script.appendCall(callbackPrefix + getContextPath()
2232: + "getEvent", strType);
2233:
2234: if (callback != null) {
2235: String key = org.directwebremoting.extend.CallbackHelper
2236: .saveCallback(callback, String.class);
2237: script
2238: .appendCall("__System.activateCallback", key,
2239: "reply");
2240: }
2241:
2242: getScriptProxy().addScript(script);
2243: }
2244:
2245: /**
2246: * Returns the associative array containing all the registered event script of this object. This method returns
2247: the instance field itself and not a copy.
2248: * @return an associative array mapping event type to event script
2249: */
2250: @SuppressWarnings("unchecked")
2251: public jsx3.lang.Object getEvents() {
2252: String extension = "getEvents().";
2253: try {
2254: java.lang.reflect.Constructor<jsx3.lang.Object> ctor = jsx3.lang.Object.class
2255: .getConstructor(Context.class, String.class,
2256: ScriptProxy.class);
2257: return ctor.newInstance(this , extension, getScriptProxy());
2258: } catch (Exception ex) {
2259: throw new IllegalArgumentException("Unsupported type: "
2260: + jsx3.lang.Object.class.getName());
2261: }
2262: }
2263:
2264: /**
2265: * Returns the associative array containing all the registered event script of this object. This method returns
2266: the instance field itself and not a copy.
2267: * @param returnType The expected return type
2268: * @return an associative array mapping event type to event script
2269: */
2270: @SuppressWarnings("unchecked")
2271: public <T> T getEvents(Class<T> returnType) {
2272: String extension = "getEvents().";
2273: try {
2274: java.lang.reflect.Constructor<T> ctor = returnType
2275: .getConstructor(Context.class, String.class,
2276: ScriptProxy.class);
2277: return ctor.newInstance(this , extension, getScriptProxy());
2278: } catch (Exception ex) {
2279: throw new IllegalArgumentException(
2280: "Unsupported return type: " + returnType.getName());
2281: }
2282: }
2283:
2284: /**
2285: * Returns the name of the jsx3.gui.Menu instance to display (as a context menu) when a user
2286: clicks on this object with the right button.
2287: */
2288: @SuppressWarnings("unchecked")
2289: public void getMenu(
2290: org.directwebremoting.proxy.Callback<String> callback) {
2291: ScriptBuffer script = new ScriptBuffer();
2292: String callbackPrefix = "";
2293:
2294: if (callback != null) {
2295: callbackPrefix = "var reply = ";
2296: }
2297:
2298: script
2299: .appendCall(callbackPrefix + getContextPath()
2300: + "getMenu");
2301:
2302: if (callback != null) {
2303: String key = org.directwebremoting.extend.CallbackHelper
2304: .saveCallback(callback, String.class);
2305: script
2306: .appendCall("__System.activateCallback", key,
2307: "reply");
2308: }
2309:
2310: getScriptProxy().addScript(script);
2311: }
2312:
2313: /**
2314: * Returns true if there is a event script registered for the given event type.
2315: * @param strType the event type, one of the model event types defined as static fields in this class
2316: * @param callback the JavaScript event script
2317: */
2318: @SuppressWarnings("unchecked")
2319: public void hasEvent(String strType,
2320: org.directwebremoting.proxy.Callback<String> callback) {
2321: ScriptBuffer script = new ScriptBuffer();
2322: String callbackPrefix = "";
2323:
2324: if (callback != null) {
2325: callbackPrefix = "var reply = ";
2326: }
2327:
2328: script.appendCall(callbackPrefix + getContextPath()
2329: + "hasEvent", strType);
2330:
2331: if (callback != null) {
2332: String key = org.directwebremoting.extend.CallbackHelper
2333: .saveCallback(callback, String.class);
2334: script
2335: .appendCall("__System.activateCallback", key,
2336: "reply");
2337: }
2338:
2339: getScriptProxy().addScript(script);
2340: }
2341:
2342: /**
2343: * Registers a hot key with this JSX model node. All keydown events that bubble up to this object
2344: will be checked against the hot key. If an event matches, the callback function will execute and the event
2345: bubble will be canceled.
2346:
2347: If the four parameters vntKey, bShift, bControl, and bAlt
2348: match a previously registered hot key, the previous hot key is clobbered by the new one. Only one hot key callback
2349: function (the most recently registered) will be executed by a single keydown event.
2350: * @param vntCallback either a function, or the name of a method bound to this object.
2351: When a keydown event bubbles up to this object that matches the hot key created by this method, this function
2352: is called on this object. If this function returns <code>false</code> then this hot key will not cancel the
2353: key event. This parameter can also be an instance of <code>HotKey</code>, in which case all
2354: other parameters are ignored.
2355: * @param vntKey if this parameter is a String, the hot key matches that key (the keycode to match is
2356: determined by <code>HotKey.keyDownCharToCode()</code>). If it is an integer, the hot key will match that
2357: keycode value.
2358: * @param bShift if not <code>null</code> the shift key state of the keydown event must match this value
2359: to invoke the hot key.
2360: * @param bControl if not <code>null</code> the control key state of the keydown event must match this value
2361: to invoke the hot key.
2362: * @param bAlt if not <code>null</code> the alt key state of the keydown event must match this value
2363: to invoke the hot key.
2364: * @return the registered hot key.
2365: */
2366: @SuppressWarnings("unchecked")
2367: public jsx3.gui.HotKey registerHotKey(String vntCallback,
2368: String vntKey, boolean bShift, boolean bControl,
2369: boolean bAlt) {
2370: String extension = "registerHotKey(\"" + vntCallback + "\", \""
2371: + vntKey + "\", \"" + bShift + "\", \"" + bControl
2372: + "\", \"" + bAlt + "\").";
2373: try {
2374: java.lang.reflect.Constructor<jsx3.gui.HotKey> ctor = jsx3.gui.HotKey.class
2375: .getConstructor(Context.class, String.class,
2376: ScriptProxy.class);
2377: return ctor.newInstance(this , extension, getScriptProxy());
2378: } catch (Exception ex) {
2379: throw new IllegalArgumentException("Unsupported type: "
2380: + jsx3.gui.HotKey.class.getName());
2381: }
2382: }
2383:
2384: /**
2385: * Registers a hot key with this JSX model node. All keydown events that bubble up to this object
2386: will be checked against the hot key. If an event matches, the callback function will execute and the event
2387: bubble will be canceled.
2388:
2389: If the four parameters vntKey, bShift, bControl, and bAlt
2390: match a previously registered hot key, the previous hot key is clobbered by the new one. Only one hot key callback
2391: function (the most recently registered) will be executed by a single keydown event.
2392: * @param vntCallback either a function, or the name of a method bound to this object.
2393: When a keydown event bubbles up to this object that matches the hot key created by this method, this function
2394: is called on this object. If this function returns <code>false</code> then this hot key will not cancel the
2395: key event. This parameter can also be an instance of <code>HotKey</code>, in which case all
2396: other parameters are ignored.
2397: * @param vntKey if this parameter is a String, the hot key matches that key (the keycode to match is
2398: determined by <code>HotKey.keyDownCharToCode()</code>). If it is an integer, the hot key will match that
2399: keycode value.
2400: * @param bShift if not <code>null</code> the shift key state of the keydown event must match this value
2401: to invoke the hot key.
2402: * @param bControl if not <code>null</code> the control key state of the keydown event must match this value
2403: to invoke the hot key.
2404: * @param bAlt if not <code>null</code> the alt key state of the keydown event must match this value
2405: to invoke the hot key.
2406: * @return the registered hot key.
2407: */
2408: @SuppressWarnings("unchecked")
2409: public jsx3.gui.HotKey registerHotKey(
2410: org.directwebremoting.proxy.CodeBlock vntCallback,
2411: String vntKey, boolean bShift, boolean bControl,
2412: boolean bAlt) {
2413: String extension = "registerHotKey(\"" + vntCallback + "\", \""
2414: + vntKey + "\", \"" + bShift + "\", \"" + bControl
2415: + "\", \"" + bAlt + "\").";
2416: try {
2417: java.lang.reflect.Constructor<jsx3.gui.HotKey> ctor = jsx3.gui.HotKey.class
2418: .getConstructor(Context.class, String.class,
2419: ScriptProxy.class);
2420: return ctor.newInstance(this , extension, getScriptProxy());
2421: } catch (Exception ex) {
2422: throw new IllegalArgumentException("Unsupported type: "
2423: + jsx3.gui.HotKey.class.getName());
2424: }
2425: }
2426:
2427: /**
2428: * Registers a hot key with this JSX model node. All keydown events that bubble up to this object
2429: will be checked against the hot key. If an event matches, the callback function will execute and the event
2430: bubble will be canceled.
2431:
2432: If the four parameters vntKey, bShift, bControl, and bAlt
2433: match a previously registered hot key, the previous hot key is clobbered by the new one. Only one hot key callback
2434: function (the most recently registered) will be executed by a single keydown event.
2435: * @param vntCallback either a function, or the name of a method bound to this object.
2436: When a keydown event bubbles up to this object that matches the hot key created by this method, this function
2437: is called on this object. If this function returns <code>false</code> then this hot key will not cancel the
2438: key event. This parameter can also be an instance of <code>HotKey</code>, in which case all
2439: other parameters are ignored.
2440: * @param vntKey if this parameter is a String, the hot key matches that key (the keycode to match is
2441: determined by <code>HotKey.keyDownCharToCode()</code>). If it is an integer, the hot key will match that
2442: keycode value.
2443: * @param bShift if not <code>null</code> the shift key state of the keydown event must match this value
2444: to invoke the hot key.
2445: * @param bControl if not <code>null</code> the control key state of the keydown event must match this value
2446: to invoke the hot key.
2447: * @param bAlt if not <code>null</code> the alt key state of the keydown event must match this value
2448: to invoke the hot key.
2449: * @return the registered hot key.
2450: */
2451: @SuppressWarnings("unchecked")
2452: public jsx3.gui.HotKey registerHotKey(String vntCallback,
2453: int vntKey, boolean bShift, boolean bControl, boolean bAlt) {
2454: String extension = "registerHotKey(\"" + vntCallback + "\", \""
2455: + vntKey + "\", \"" + bShift + "\", \"" + bControl
2456: + "\", \"" + bAlt + "\").";
2457: try {
2458: java.lang.reflect.Constructor<jsx3.gui.HotKey> ctor = jsx3.gui.HotKey.class
2459: .getConstructor(Context.class, String.class,
2460: ScriptProxy.class);
2461: return ctor.newInstance(this , extension, getScriptProxy());
2462: } catch (Exception ex) {
2463: throw new IllegalArgumentException("Unsupported type: "
2464: + jsx3.gui.HotKey.class.getName());
2465: }
2466: }
2467:
2468: /**
2469: * Registers a hot key with this JSX model node. All keydown events that bubble up to this object
2470: will be checked against the hot key. If an event matches, the callback function will execute and the event
2471: bubble will be canceled.
2472:
2473: If the four parameters vntKey, bShift, bControl, and bAlt
2474: match a previously registered hot key, the previous hot key is clobbered by the new one. Only one hot key callback
2475: function (the most recently registered) will be executed by a single keydown event.
2476: * @param vntCallback either a function, or the name of a method bound to this object.
2477: When a keydown event bubbles up to this object that matches the hot key created by this method, this function
2478: is called on this object. If this function returns <code>false</code> then this hot key will not cancel the
2479: key event. This parameter can also be an instance of <code>HotKey</code>, in which case all
2480: other parameters are ignored.
2481: * @param vntKey if this parameter is a String, the hot key matches that key (the keycode to match is
2482: determined by <code>HotKey.keyDownCharToCode()</code>). If it is an integer, the hot key will match that
2483: keycode value.
2484: * @param bShift if not <code>null</code> the shift key state of the keydown event must match this value
2485: to invoke the hot key.
2486: * @param bControl if not <code>null</code> the control key state of the keydown event must match this value
2487: to invoke the hot key.
2488: * @param bAlt if not <code>null</code> the alt key state of the keydown event must match this value
2489: to invoke the hot key.
2490: * @return the registered hot key.
2491: */
2492: @SuppressWarnings("unchecked")
2493: public jsx3.gui.HotKey registerHotKey(
2494: org.directwebremoting.proxy.CodeBlock vntCallback,
2495: int vntKey, boolean bShift, boolean bControl, boolean bAlt) {
2496: String extension = "registerHotKey(\"" + vntCallback + "\", \""
2497: + vntKey + "\", \"" + bShift + "\", \"" + bControl
2498: + "\", \"" + bAlt + "\").";
2499: try {
2500: java.lang.reflect.Constructor<jsx3.gui.HotKey> ctor = jsx3.gui.HotKey.class
2501: .getConstructor(Context.class, String.class,
2502: ScriptProxy.class);
2503: return ctor.newInstance(this , extension, getScriptProxy());
2504: } catch (Exception ex) {
2505: throw new IllegalArgumentException("Unsupported type: "
2506: + jsx3.gui.HotKey.class.getName());
2507: }
2508: }
2509:
2510: /**
2511: * Registers a hot key with this JSX model node. All keydown events that bubble up to this object
2512: will be checked against the hot key. If an event matches, the callback function will execute and the event
2513: bubble will be canceled.
2514:
2515: If the four parameters vntKey, bShift, bControl, and bAlt
2516: match a previously registered hot key, the previous hot key is clobbered by the new one. Only one hot key callback
2517: function (the most recently registered) will be executed by a single keydown event.
2518: * @param vntCallback either a function, or the name of a method bound to this object.
2519: When a keydown event bubbles up to this object that matches the hot key created by this method, this function
2520: is called on this object. If this function returns <code>false</code> then this hot key will not cancel the
2521: key event. This parameter can also be an instance of <code>HotKey</code>, in which case all
2522: other parameters are ignored.
2523: * @param vntKey if this parameter is a String, the hot key matches that key (the keycode to match is
2524: determined by <code>HotKey.keyDownCharToCode()</code>). If it is an integer, the hot key will match that
2525: keycode value.
2526: * @param bShift if not <code>null</code> the shift key state of the keydown event must match this value
2527: to invoke the hot key.
2528: * @param bControl if not <code>null</code> the control key state of the keydown event must match this value
2529: to invoke the hot key.
2530: * @param bAlt if not <code>null</code> the alt key state of the keydown event must match this value
2531: to invoke the hot key.
2532: * @return the registered hot key.
2533: */
2534: @SuppressWarnings("unchecked")
2535: public jsx3.gui.HotKey registerHotKey(jsx3.gui.HotKey vntCallback,
2536: String vntKey, boolean bShift, boolean bControl,
2537: boolean bAlt) {
2538: String extension = "registerHotKey(\"" + vntCallback + "\", \""
2539: + vntKey + "\", \"" + bShift + "\", \"" + bControl
2540: + "\", \"" + bAlt + "\").";
2541: try {
2542: java.lang.reflect.Constructor<jsx3.gui.HotKey> ctor = jsx3.gui.HotKey.class
2543: .getConstructor(Context.class, String.class,
2544: ScriptProxy.class);
2545: return ctor.newInstance(this , extension, getScriptProxy());
2546: } catch (Exception ex) {
2547: throw new IllegalArgumentException("Unsupported type: "
2548: + jsx3.gui.HotKey.class.getName());
2549: }
2550: }
2551:
2552: /**
2553: * Registers a hot key with this JSX model node. All keydown events that bubble up to this object
2554: will be checked against the hot key. If an event matches, the callback function will execute and the event
2555: bubble will be canceled.
2556:
2557: If the four parameters vntKey, bShift, bControl, and bAlt
2558: match a previously registered hot key, the previous hot key is clobbered by the new one. Only one hot key callback
2559: function (the most recently registered) will be executed by a single keydown event.
2560: * @param vntCallback either a function, or the name of a method bound to this object.
2561: When a keydown event bubbles up to this object that matches the hot key created by this method, this function
2562: is called on this object. If this function returns <code>false</code> then this hot key will not cancel the
2563: key event. This parameter can also be an instance of <code>HotKey</code>, in which case all
2564: other parameters are ignored.
2565: * @param vntKey if this parameter is a String, the hot key matches that key (the keycode to match is
2566: determined by <code>HotKey.keyDownCharToCode()</code>). If it is an integer, the hot key will match that
2567: keycode value.
2568: * @param bShift if not <code>null</code> the shift key state of the keydown event must match this value
2569: to invoke the hot key.
2570: * @param bControl if not <code>null</code> the control key state of the keydown event must match this value
2571: to invoke the hot key.
2572: * @param bAlt if not <code>null</code> the alt key state of the keydown event must match this value
2573: to invoke the hot key.
2574: * @return the registered hot key.
2575: */
2576: @SuppressWarnings("unchecked")
2577: public jsx3.gui.HotKey registerHotKey(jsx3.gui.HotKey vntCallback,
2578: int vntKey, boolean bShift, boolean bControl, boolean bAlt) {
2579: String extension = "registerHotKey(\"" + vntCallback + "\", \""
2580: + vntKey + "\", \"" + bShift + "\", \"" + bControl
2581: + "\", \"" + bAlt + "\").";
2582: try {
2583: java.lang.reflect.Constructor<jsx3.gui.HotKey> ctor = jsx3.gui.HotKey.class
2584: .getConstructor(Context.class, String.class,
2585: ScriptProxy.class);
2586: return ctor.newInstance(this , extension, getScriptProxy());
2587: } catch (Exception ex) {
2588: throw new IllegalArgumentException("Unsupported type: "
2589: + jsx3.gui.HotKey.class.getName());
2590: }
2591: }
2592:
2593: /**
2594: * Removes an event script registered for the given model event type.
2595: * @param strType the event type, one of the model event types defined as static fields in this class
2596: * @return this object
2597: */
2598: @SuppressWarnings("unchecked")
2599: public jsx3.gui.Interactive removeEvent(String strType) {
2600: String extension = "removeEvent(\"" + strType + "\").";
2601: try {
2602: java.lang.reflect.Constructor<jsx3.gui.Interactive> ctor = jsx3.gui.Interactive.class
2603: .getConstructor(Context.class, String.class,
2604: ScriptProxy.class);
2605: return ctor.newInstance(this , extension, getScriptProxy());
2606: } catch (Exception ex) {
2607: throw new IllegalArgumentException("Unsupported type: "
2608: + jsx3.gui.Interactive.class.getName());
2609: }
2610: }
2611:
2612: /**
2613: * Removes an event script registered for the given model event type.
2614: * @param strType the event type, one of the model event types defined as static fields in this class
2615: * @param returnType The expected return type
2616: * @return this object
2617: */
2618: @SuppressWarnings("unchecked")
2619: public <T> T removeEvent(String strType, Class<T> returnType) {
2620: String extension = "removeEvent(\"" + strType + "\").";
2621: try {
2622: java.lang.reflect.Constructor<T> ctor = returnType
2623: .getConstructor(Context.class, String.class,
2624: ScriptProxy.class);
2625: return ctor.newInstance(this , extension, getScriptProxy());
2626: } catch (Exception ex) {
2627: throw new IllegalArgumentException(
2628: "Unsupported return type: " + returnType.getName());
2629: }
2630: }
2631:
2632: /**
2633: * Removes all events scripts registered with this object.
2634: * @return this object
2635: */
2636: @SuppressWarnings("unchecked")
2637: public jsx3.gui.Interactive removeEvents() {
2638: String extension = "removeEvents().";
2639: try {
2640: java.lang.reflect.Constructor<jsx3.gui.Interactive> ctor = jsx3.gui.Interactive.class
2641: .getConstructor(Context.class, String.class,
2642: ScriptProxy.class);
2643: return ctor.newInstance(this , extension, getScriptProxy());
2644: } catch (Exception ex) {
2645: throw new IllegalArgumentException("Unsupported type: "
2646: + jsx3.gui.Interactive.class.getName());
2647: }
2648: }
2649:
2650: /**
2651: * Removes all events scripts registered with this object.
2652: * @param returnType The expected return type
2653: * @return this object
2654: */
2655: @SuppressWarnings("unchecked")
2656: public <T> T removeEvents(Class<T> returnType) {
2657: String extension = "removeEvents().";
2658: try {
2659: java.lang.reflect.Constructor<T> ctor = returnType
2660: .getConstructor(Context.class, String.class,
2661: ScriptProxy.class);
2662: return ctor.newInstance(this , extension, getScriptProxy());
2663: } catch (Exception ex) {
2664: throw new IllegalArgumentException(
2665: "Unsupported return type: " + returnType.getName());
2666: }
2667: }
2668:
2669: /**
2670: * Sets whether is object supports programmatic drag, meanining it will allow any contained item to be dragged/dropped.
2671: Implementing classes can decide whether to consult this value or ignore it.
2672: * @param bDrag <code>jsx3.Boolean.TRUE</code> or <code>jsx3.Boolean.FALSE</code>
2673: * @return this object
2674: */
2675: @SuppressWarnings("unchecked")
2676: public jsx3.gui.Interactive setCanDrag(int bDrag) {
2677: String extension = "setCanDrag(\"" + bDrag + "\").";
2678: try {
2679: java.lang.reflect.Constructor<jsx3.gui.Interactive> ctor = jsx3.gui.Interactive.class
2680: .getConstructor(Context.class, String.class,
2681: ScriptProxy.class);
2682: return ctor.newInstance(this , extension, getScriptProxy());
2683: } catch (Exception ex) {
2684: throw new IllegalArgumentException("Unsupported type: "
2685: + jsx3.gui.Interactive.class.getName());
2686: }
2687: }
2688:
2689: /**
2690: * Sets whether is object supports programmatic drag, meanining it will allow any contained item to be dragged/dropped.
2691: Implementing classes can decide whether to consult this value or ignore it.
2692: * @param bDrag <code>jsx3.Boolean.TRUE</code> or <code>jsx3.Boolean.FALSE</code>
2693: * @param returnType The expected return type
2694: * @return this object
2695: */
2696: @SuppressWarnings("unchecked")
2697: public <T> T setCanDrag(int bDrag, Class<T> returnType) {
2698: String extension = "setCanDrag(\"" + bDrag + "\").";
2699: try {
2700: java.lang.reflect.Constructor<T> ctor = returnType
2701: .getConstructor(Context.class, String.class,
2702: ScriptProxy.class);
2703: return ctor.newInstance(this , extension, getScriptProxy());
2704: } catch (Exception ex) {
2705: throw new IllegalArgumentException(
2706: "Unsupported return type: " + returnType.getName());
2707: }
2708: }
2709:
2710: /**
2711: * Sets whether this object can be the target of a drop event. Implementing classes can decide whether to consult
2712: this value or ignore it.
2713: * @param bDrop <code>jsx3.Boolean.TRUE</code> or <code>jsx3.Boolean.FALSE</code>
2714: * @return this object
2715: */
2716: @SuppressWarnings("unchecked")
2717: public jsx3.gui.Interactive setCanDrop(int bDrop) {
2718: String extension = "setCanDrop(\"" + bDrop + "\").";
2719: try {
2720: java.lang.reflect.Constructor<jsx3.gui.Interactive> ctor = jsx3.gui.Interactive.class
2721: .getConstructor(Context.class, String.class,
2722: ScriptProxy.class);
2723: return ctor.newInstance(this , extension, getScriptProxy());
2724: } catch (Exception ex) {
2725: throw new IllegalArgumentException("Unsupported type: "
2726: + jsx3.gui.Interactive.class.getName());
2727: }
2728: }
2729:
2730: /**
2731: * Sets whether this object can be the target of a drop event. Implementing classes can decide whether to consult
2732: this value or ignore it.
2733: * @param bDrop <code>jsx3.Boolean.TRUE</code> or <code>jsx3.Boolean.FALSE</code>
2734: * @param returnType The expected return type
2735: * @return this object
2736: */
2737: @SuppressWarnings("unchecked")
2738: public <T> T setCanDrop(int bDrop, Class<T> returnType) {
2739: String extension = "setCanDrop(\"" + bDrop + "\").";
2740: try {
2741: java.lang.reflect.Constructor<T> ctor = returnType
2742: .getConstructor(Context.class, String.class,
2743: ScriptProxy.class);
2744: return ctor.newInstance(this , extension, getScriptProxy());
2745: } catch (Exception ex) {
2746: throw new IllegalArgumentException(
2747: "Unsupported return type: " + returnType.getName());
2748: }
2749: }
2750:
2751: /**
2752: * Sets whether is object can be moved around the screen (this is not the same as drag/drop). Implementing classes
2753: can decide whether to consult this value or ignore it.
2754: * @param bMovable <code>jsx3.Boolean.TRUE</code> or <code>jsx3.Boolean.FALSE</code>
2755: * @return this object
2756: */
2757: @SuppressWarnings("unchecked")
2758: public jsx3.gui.Interactive setCanMove(int bMovable) {
2759: String extension = "setCanMove(\"" + bMovable + "\").";
2760: try {
2761: java.lang.reflect.Constructor<jsx3.gui.Interactive> ctor = jsx3.gui.Interactive.class
2762: .getConstructor(Context.class, String.class,
2763: ScriptProxy.class);
2764: return ctor.newInstance(this , extension, getScriptProxy());
2765: } catch (Exception ex) {
2766: throw new IllegalArgumentException("Unsupported type: "
2767: + jsx3.gui.Interactive.class.getName());
2768: }
2769: }
2770:
2771: /**
2772: * Sets whether is object can be moved around the screen (this is not the same as drag/drop). Implementing classes
2773: can decide whether to consult this value or ignore it.
2774: * @param bMovable <code>jsx3.Boolean.TRUE</code> or <code>jsx3.Boolean.FALSE</code>
2775: * @param returnType The expected return type
2776: * @return this object
2777: */
2778: @SuppressWarnings("unchecked")
2779: public <T> T setCanMove(int bMovable, Class<T> returnType) {
2780: String extension = "setCanMove(\"" + bMovable + "\").";
2781: try {
2782: java.lang.reflect.Constructor<T> ctor = returnType
2783: .getConstructor(Context.class, String.class,
2784: ScriptProxy.class);
2785: return ctor.newInstance(this , extension, getScriptProxy());
2786: } catch (Exception ex) {
2787: throw new IllegalArgumentException(
2788: "Unsupported return type: " + returnType.getName());
2789: }
2790: }
2791:
2792: /**
2793: * Sets whether is object can be spyglassed. Implementing classes can decide whether to consult
2794: this value or ignore it.
2795: * @param bSpy <code>jsx3.Boolean.TRUE</code> or <code>jsx3.Boolean.FALSE</code>
2796: * @return this object
2797: */
2798: @SuppressWarnings("unchecked")
2799: public jsx3.gui.Interactive setCanSpy(int bSpy) {
2800: String extension = "setCanSpy(\"" + bSpy + "\").";
2801: try {
2802: java.lang.reflect.Constructor<jsx3.gui.Interactive> ctor = jsx3.gui.Interactive.class
2803: .getConstructor(Context.class, String.class,
2804: ScriptProxy.class);
2805: return ctor.newInstance(this , extension, getScriptProxy());
2806: } catch (Exception ex) {
2807: throw new IllegalArgumentException("Unsupported type: "
2808: + jsx3.gui.Interactive.class.getName());
2809: }
2810: }
2811:
2812: /**
2813: * Sets whether is object can be spyglassed. Implementing classes can decide whether to consult
2814: this value or ignore it.
2815: * @param bSpy <code>jsx3.Boolean.TRUE</code> or <code>jsx3.Boolean.FALSE</code>
2816: * @param returnType The expected return type
2817: * @return this object
2818: */
2819: @SuppressWarnings("unchecked")
2820: public <T> T setCanSpy(int bSpy, Class<T> returnType) {
2821: String extension = "setCanSpy(\"" + bSpy + "\").";
2822: try {
2823: java.lang.reflect.Constructor<T> ctor = returnType
2824: .getConstructor(Context.class, String.class,
2825: ScriptProxy.class);
2826: return ctor.newInstance(this , extension, getScriptProxy());
2827: } catch (Exception ex) {
2828: throw new IllegalArgumentException(
2829: "Unsupported return type: " + returnType.getName());
2830: }
2831: }
2832:
2833: /**
2834: * Programmatically sets an event of this instance. Sets the script that will execute when this object publishes
2835: a model event. The script value will be saved in the serialization file of a component. Not all classes that
2836: implement this interface will publish events of every type. Consult the documentation of a class for a
2837: description of the events it publishes.
2838:
2839: For programmatic registering of event handlers when persistence in a serialization file is not required,
2840: consider using jsx3.util.EventDispatcher.subscribe() instead of this method. Whenever a model
2841: event is published, it is published using the EventDispatcher interface as well as by executing
2842: any registered event script.
2843: * @param strScript the actual JavaScript code that will execute when the given event is published.
2844: For example: <code>obj.setEvent("alert('hello.');", jsx3.gui.Interactive.EXECUTE);</code>
2845: * @param strType the event type. Must be one of the model event types defined as static fields in this class
2846: * @return reference to this
2847: */
2848: @SuppressWarnings("unchecked")
2849: public jsx3.gui.Interactive setEvent(String strScript,
2850: String strType) {
2851: String extension = "setEvent(\"" + strScript + "\", \""
2852: + strType + "\").";
2853: try {
2854: java.lang.reflect.Constructor<jsx3.gui.Interactive> ctor = jsx3.gui.Interactive.class
2855: .getConstructor(Context.class, String.class,
2856: ScriptProxy.class);
2857: return ctor.newInstance(this , extension, getScriptProxy());
2858: } catch (Exception ex) {
2859: throw new IllegalArgumentException("Unsupported type: "
2860: + jsx3.gui.Interactive.class.getName());
2861: }
2862: }
2863:
2864: /**
2865: * Programmatically sets an event of this instance. Sets the script that will execute when this object publishes
2866: a model event. The script value will be saved in the serialization file of a component. Not all classes that
2867: implement this interface will publish events of every type. Consult the documentation of a class for a
2868: description of the events it publishes.
2869:
2870: For programmatic registering of event handlers when persistence in a serialization file is not required,
2871: consider using jsx3.util.EventDispatcher.subscribe() instead of this method. Whenever a model
2872: event is published, it is published using the EventDispatcher interface as well as by executing
2873: any registered event script.
2874: * @param strScript the actual JavaScript code that will execute when the given event is published.
2875: For example: <code>obj.setEvent("alert('hello.');", jsx3.gui.Interactive.EXECUTE);</code>
2876: * @param strType the event type. Must be one of the model event types defined as static fields in this class
2877: * @param returnType The expected return type
2878: * @return reference to this
2879: */
2880: @SuppressWarnings("unchecked")
2881: public <T> T setEvent(String strScript, String strType,
2882: Class<T> returnType) {
2883: String extension = "setEvent(\"" + strScript + "\", \""
2884: + strType + "\").";
2885: try {
2886: java.lang.reflect.Constructor<T> ctor = returnType
2887: .getConstructor(Context.class, String.class,
2888: ScriptProxy.class);
2889: return ctor.newInstance(this , extension, getScriptProxy());
2890: } catch (Exception ex) {
2891: throw new IllegalArgumentException(
2892: "Unsupported return type: " + returnType.getName());
2893: }
2894: }
2895:
2896: /**
2897: * Sets the name of the jsx3.gui.Menu instance to display when a user
2898: clicks on this object with the right button. The name is a pointer by-name to a JSX object in the same server.
2899: * @param strMenu name or id (jsxname or jsxid) of the context menu
2900: * @return this object
2901: */
2902: @SuppressWarnings("unchecked")
2903: public jsx3.gui.Interactive setMenu(String strMenu) {
2904: String extension = "setMenu(\"" + strMenu + "\").";
2905: try {
2906: java.lang.reflect.Constructor<jsx3.gui.Interactive> ctor = jsx3.gui.Interactive.class
2907: .getConstructor(Context.class, String.class,
2908: ScriptProxy.class);
2909: return ctor.newInstance(this , extension, getScriptProxy());
2910: } catch (Exception ex) {
2911: throw new IllegalArgumentException("Unsupported type: "
2912: + jsx3.gui.Interactive.class.getName());
2913: }
2914: }
2915:
2916: /**
2917: * Sets the name of the jsx3.gui.Menu instance to display when a user
2918: clicks on this object with the right button. The name is a pointer by-name to a JSX object in the same server.
2919: * @param strMenu name or id (jsxname or jsxid) of the context menu
2920: * @param returnType The expected return type
2921: * @return this object
2922: */
2923: @SuppressWarnings("unchecked")
2924: public <T> T setMenu(String strMenu, Class<T> returnType) {
2925: String extension = "setMenu(\"" + strMenu + "\").";
2926: try {
2927: java.lang.reflect.Constructor<T> ctor = returnType
2928: .getConstructor(Context.class, String.class,
2929: ScriptProxy.class);
2930: return ctor.newInstance(this , extension, getScriptProxy());
2931: } catch (Exception ex) {
2932: throw new IllegalArgumentException(
2933: "Unsupported return type: " + returnType.getName());
2934: }
2935: }
2936:
2937: /**
2938: * Sets the CSS definition to apply to an HTML element when a spyglass is shown for that element
2939: * @param strCSS valid CSS. For example, text-decoration:underline;color:red;
2940: */
2941: public void setSpyStyles(String strCSS) {
2942: ScriptBuffer script = new ScriptBuffer();
2943: script.appendCall(getContextPath() + "setSpyStyles", strCSS);
2944: getScriptProxy().addScript(script);
2945: }
2946:
2947: /**
2948: * called by 'window.setTimeout()' to display the spyglass hover for a given object;
2949: * @param strHTML HTML/text to display in the spyglass; as the spyglass does not define a height/width, this content will
2950: have improved layout if it specifies a preferred width in its in-line-style or referenced-css rule.
2951: * @param intLeft use an integer to specify an on-screen location; otherwise, use a <code>jsx3.gui.Event</code> instance to have the system automatically calculate the x/y position.
2952: * @param intTop use an integer if <code>intLeft</code> also uses an integer. Otherwise, use null.
2953: */
2954: public void showSpy(String strHTML, int intLeft, int intTop) {
2955: ScriptBuffer script = new ScriptBuffer();
2956: script.appendCall(getContextPath() + "showSpy", strHTML,
2957: intLeft, intTop);
2958: getScriptProxy().addScript(script);
2959: }
2960:
2961: /**
2962: * called by 'window.setTimeout()' to display the spyglass hover for a given object;
2963: * @param strHTML HTML/text to display in the spyglass; as the spyglass does not define a height/width, this content will
2964: have improved layout if it specifies a preferred width in its in-line-style or referenced-css rule.
2965: * @param intLeft use an integer to specify an on-screen location; otherwise, use a <code>jsx3.gui.Event</code> instance to have the system automatically calculate the x/y position.
2966: * @param intTop use an integer if <code>intLeft</code> also uses an integer. Otherwise, use null.
2967: */
2968: public void showSpy(String strHTML, jsx3.gui.Event intLeft,
2969: int intTop) {
2970: ScriptBuffer script = new ScriptBuffer();
2971: script.appendCall(getContextPath() + "showSpy", strHTML,
2972: intLeft, intTop);
2973: getScriptProxy().addScript(script);
2974: }
2975:
2976: }
|