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.matrix;
0017:
0018: import org.directwebremoting.ScriptBuffer;
0019: import org.directwebremoting.proxy.ScriptProxy;
0020: import org.directwebremoting.proxy.io.Context;
0021:
0022: /**
0023: * Column control for use as a child of a jsx3.gui.Matrix class
0024: * @author Joe Walker [joe at getahead dot org]
0025: * @author DRAPGEN - Dwr Reverse Ajax Proxy GENerator
0026: */
0027: public class Column extends jsx3.gui.Block {
0028: /**
0029: * All reverse ajax proxies need context to work from
0030: * @param scriptProxy The place we are writing scripts to
0031: * @param context The script that got us to where we are now
0032: */
0033: public Column(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: */
0042: public Column(String strName) {
0043: super ((Context) null, (String) null, (ScriptProxy) null);
0044: ScriptBuffer script = new ScriptBuffer();
0045: script.appendCall("new Column", strName);
0046: setInitScript(script);
0047: }
0048:
0049: /**
0050: * 100
0051: */
0052: public static final int DEFAULT_WIDTH = 100;
0053:
0054: /**
0055: * text (default)
0056: */
0057: public static final String TYPE_TEXT = "text";
0058:
0059: /**
0060: * number
0061: */
0062: public static final String TYPE_NUMBER = "number";
0063:
0064: /**
0065: * top
0066: */
0067: public static final String DEFAULT_VALIGN = "top";
0068:
0069: /**
0070: * Gets the user-defined XSL template (xsl:template) that will override the defualt template defined by Column.TEMPLATES.default.
0071: * @param strDefault xsl:template
0072: */
0073: @SuppressWarnings("unchecked")
0074: public void getValueTemplate(String strDefault,
0075: org.directwebremoting.proxy.Callback<String> callback) {
0076: ScriptBuffer script = new ScriptBuffer();
0077: String callbackPrefix = "";
0078:
0079: if (callback != null) {
0080: callbackPrefix = "var reply = ";
0081: }
0082:
0083: script.appendCall(callbackPrefix + getContextPath()
0084: + "getValueTemplate", strDefault);
0085:
0086: if (callback != null) {
0087: String key = org.directwebremoting.extend.CallbackHelper
0088: .saveCallback(callback, String.class);
0089: script
0090: .appendCall("__System.activateCallback", key,
0091: "reply");
0092: }
0093:
0094: getScriptProxy().addScript(script);
0095: }
0096:
0097: /**
0098: * Sets the user-defined XSL template (xsl:template) that will override the defualt template defined by Column.DEFAULT_VALUE_TEMPLATE.
0099: The path wildcard is as follows:
0100:
0101:
0102: {0} this will be replaced with the result of [instance].getPath(). For example: jsxtext
0103: * @param TEMPLATE Either a valid xsl:template or a named system template, including: @default, @empty, @unescape, and @image
0104: */
0105: public void setValueTemplate(String TEMPLATE) {
0106: ScriptBuffer script = new ScriptBuffer();
0107: script.appendCall(getContextPath() + "setValueTemplate",
0108: TEMPLATE);
0109: getScriptProxy().addScript(script);
0110: }
0111:
0112: /**
0113: * Gets whether or not this column can be resized by the user. If not set, the column will be assumed resizable
0114: */
0115: @SuppressWarnings("unchecked")
0116: public void getResizable(
0117: org.directwebremoting.proxy.Callback<Boolean> callback) {
0118: ScriptBuffer script = new ScriptBuffer();
0119: String callbackPrefix = "";
0120:
0121: if (callback != null) {
0122: callbackPrefix = "var reply = ";
0123: }
0124:
0125: script.appendCall(callbackPrefix + getContextPath()
0126: + "getResizable");
0127:
0128: if (callback != null) {
0129: String key = org.directwebremoting.extend.CallbackHelper
0130: .saveCallback(callback, Boolean.class);
0131: script
0132: .appendCall("__System.activateCallback", key,
0133: "reply");
0134: }
0135:
0136: getScriptProxy().addScript(script);
0137: }
0138:
0139: /**
0140: * Sets whether or not this column can be resized by the user. If not set, the column will be assumed resizable. Note that if the parent Matrix
0141: is set as NOT resizable, this setting is ignored and no child columns can be resized. Note that the header row is immediately repainted to reflect the change.
0142: * @param RESIZE
0143: */
0144: public void setResizable(Boolean RESIZE) {
0145: ScriptBuffer script = new ScriptBuffer();
0146: script.appendCall(getContextPath() + "setResizable", RESIZE);
0147: getScriptProxy().addScript(script);
0148: }
0149:
0150: /**
0151: * Returns one or more named attributes. When one of these attributes is updated by another column's edit mask iterface,
0152: this column will called to repaint to reflect the updated value
0153: * @param callback Comma-delimited attribute list
0154: */
0155: @SuppressWarnings("unchecked")
0156: public void getTriggers(
0157: org.directwebremoting.proxy.Callback<String> callback) {
0158: ScriptBuffer script = new ScriptBuffer();
0159: String callbackPrefix = "";
0160:
0161: if (callback != null) {
0162: callbackPrefix = "var reply = ";
0163: }
0164:
0165: script.appendCall(callbackPrefix + getContextPath()
0166: + "getTriggers");
0167:
0168: if (callback != null) {
0169: String key = org.directwebremoting.extend.CallbackHelper
0170: .saveCallback(callback, String.class);
0171: script
0172: .appendCall("__System.activateCallback", key,
0173: "reply");
0174: }
0175:
0176: getScriptProxy().addScript(script);
0177: }
0178:
0179: /**
0180: * Sets one or more named attributes. When one of these attributes is updated by another column's edit mask iterface,
0181: this column will called to repaint to reflect the updated value
0182: * @param strTriggers Comma-delimited attribute list. For example: <code>jsxtext, ssn, phone</code>.
0183: */
0184: public void setTriggers(String strTriggers) {
0185: ScriptBuffer script = new ScriptBuffer();
0186: script
0187: .appendCall(getContextPath() + "setTriggers",
0188: strTriggers);
0189: getScriptProxy().addScript(script);
0190: }
0191:
0192: /**
0193: * Returns the selection path for this column of data. Returns 'jsxid' if no path specified
0194: * @param callback selection path
0195: */
0196: @SuppressWarnings("unchecked")
0197: public void getPath(
0198: org.directwebremoting.proxy.Callback<String> callback) {
0199: ScriptBuffer script = new ScriptBuffer();
0200: String callbackPrefix = "";
0201:
0202: if (callback != null) {
0203: callbackPrefix = "var reply = ";
0204: }
0205:
0206: script
0207: .appendCall(callbackPrefix + getContextPath()
0208: + "getPath");
0209:
0210: if (callback != null) {
0211: String key = org.directwebremoting.extend.CallbackHelper
0212: .saveCallback(callback, String.class);
0213: script
0214: .appendCall("__System.activateCallback", key,
0215: "reply");
0216: }
0217:
0218: getScriptProxy().addScript(script);
0219: }
0220:
0221: /**
0222: * Sets the selection path for this column of data.
0223: * @param strPath The name of the attribute For example <code>jsxtext</code>
0224: * @param bSuppressRepaint Pass <code>true</code> to stop the default repaint from occurring.
0225: Typically property updates that affect the XSLT (such as path) require that the XSLT be regenerated.
0226: However, the repaint can be suppressed to avoid unnecessary reparsing of the XSLT during repeated property updates.
0227: */
0228: public void setPath(String strPath, boolean bSuppressRepaint) {
0229: ScriptBuffer script = new ScriptBuffer();
0230: script.appendCall(getContextPath() + "setPath", strPath,
0231: bSuppressRepaint);
0232: getScriptProxy().addScript(script);
0233: }
0234:
0235: /**
0236: * Returns the CDF attribute to use to sort on this column. If the sort path has not been set explicitly, this method
0237: returns the value of this.getPath(). The data source of the matrix containing this column is
0238: sorted on this attribute when the matrix is sorted on this column.
0239: */
0240: @SuppressWarnings("unchecked")
0241: public void getSortPath(
0242: org.directwebremoting.proxy.Callback<String> callback) {
0243: ScriptBuffer script = new ScriptBuffer();
0244: String callbackPrefix = "";
0245:
0246: if (callback != null) {
0247: callbackPrefix = "var reply = ";
0248: }
0249:
0250: script.appendCall(callbackPrefix + getContextPath()
0251: + "getSortPath");
0252:
0253: if (callback != null) {
0254: String key = org.directwebremoting.extend.CallbackHelper
0255: .saveCallback(callback, String.class);
0256: script
0257: .appendCall("__System.activateCallback", key,
0258: "reply");
0259: }
0260:
0261: getScriptProxy().addScript(script);
0262: }
0263:
0264: /**
0265: * Sets the CDF attribute to use to sort on this column.
0266: * @param strPath
0267: */
0268: public void setSortPath(String strPath) {
0269: ScriptBuffer script = new ScriptBuffer();
0270: script.appendCall(getContextPath() + "setSortPath", strPath);
0271: getScriptProxy().addScript(script);
0272: }
0273:
0274: /**
0275: * Returns the data type for this column of data (affects sorting if this column is used for sorting the data); valid types include: jsx3.gui.Matrix.Column.TYPE_TEXT and jsx3.gui.Matrix.Column.TYPE_NUMBER
0276: * @param callback data type for this column's data
0277: */
0278: @SuppressWarnings("unchecked")
0279: public void getDataType(
0280: org.directwebremoting.proxy.Callback<String> callback) {
0281: ScriptBuffer script = new ScriptBuffer();
0282: String callbackPrefix = "";
0283:
0284: if (callback != null) {
0285: callbackPrefix = "var reply = ";
0286: }
0287:
0288: script.appendCall(callbackPrefix + getContextPath()
0289: + "getDataType");
0290:
0291: if (callback != null) {
0292: String key = org.directwebremoting.extend.CallbackHelper
0293: .saveCallback(callback, String.class);
0294: script
0295: .appendCall("__System.activateCallback", key,
0296: "reply");
0297: }
0298:
0299: getScriptProxy().addScript(script);
0300: }
0301:
0302: /**
0303: * Sets the data type for this column of data (affects sorting if this column is used for sorting the data); returns ref to self
0304: * @param DATATYPE one of: jsx3.gui.Matrix.Column.TYPE_TEXT, jsx3.gui.Matrix.Column.TYPE_NUMBER
0305: */
0306: public void setDataType(String DATATYPE) {
0307: ScriptBuffer script = new ScriptBuffer();
0308: script.appendCall(getContextPath() + "setDataType", DATATYPE);
0309: getScriptProxy().addScript(script);
0310: }
0311:
0312: /**
0313: * Returns the data type for this column of data (affects sorting if this column is used for sorting the data).
0314: * @param callback one of: jsx3.gui.Matrix.Column.TYPE_TEXT, jsx3.gui.Matrix.Column.TYPE_NUMBER
0315: */
0316: @SuppressWarnings("unchecked")
0317: public void getSortDataType(
0318: org.directwebremoting.proxy.Callback<String> callback) {
0319: ScriptBuffer script = new ScriptBuffer();
0320: String callbackPrefix = "";
0321:
0322: if (callback != null) {
0323: callbackPrefix = "var reply = ";
0324: }
0325:
0326: script.appendCall(callbackPrefix + getContextPath()
0327: + "getSortDataType");
0328:
0329: if (callback != null) {
0330: String key = org.directwebremoting.extend.CallbackHelper
0331: .saveCallback(callback, String.class);
0332: script
0333: .appendCall("__System.activateCallback", key,
0334: "reply");
0335: }
0336:
0337: getScriptProxy().addScript(script);
0338: }
0339:
0340: /**
0341: * Sets the data type for this column of data (affects sorting if this column is used for sorting the data); returns ref to self
0342: * @param DATATYPE data type for this column's data. valid types include: jsx3.gui.Matrix.Column.TYPE_TEXT and jsx3.gui.Matrix.Column.TYPE_NUMBER
0343: */
0344: public void setSortDataType(String DATATYPE) {
0345: ScriptBuffer script = new ScriptBuffer();
0346: script.appendCall(getContextPath() + "setSortDataType",
0347: DATATYPE);
0348: getScriptProxy().addScript(script);
0349: }
0350:
0351: /**
0352: * Returns whether the parent list/grid can be sorted on this column. If no value is provided, the column is assumed sortable unless
0353: the parent control explicitly specifies that no column should sort.
0354: */
0355: @SuppressWarnings("unchecked")
0356: public void getCanSort(
0357: org.directwebremoting.proxy.Callback<Boolean> callback) {
0358: ScriptBuffer script = new ScriptBuffer();
0359: String callbackPrefix = "";
0360:
0361: if (callback != null) {
0362: callbackPrefix = "var reply = ";
0363: }
0364:
0365: script.appendCall(callbackPrefix + getContextPath()
0366: + "getCanSort");
0367:
0368: if (callback != null) {
0369: String key = org.directwebremoting.extend.CallbackHelper
0370: .saveCallback(callback, Boolean.class);
0371: script
0372: .appendCall("__System.activateCallback", key,
0373: "reply");
0374: }
0375:
0376: getScriptProxy().addScript(script);
0377: }
0378:
0379: /**
0380: * Sets whether the parnet list/grid can be sorted on this column. Note that the header row is immediately repainted to reflect the change.
0381: * @param SORT
0382: */
0383: public void setCanSort(Boolean SORT) {
0384: ScriptBuffer script = new ScriptBuffer();
0385: script.appendCall(getContextPath() + "setCanSort", SORT);
0386: getScriptProxy().addScript(script);
0387: }
0388:
0389: /**
0390: * Sets the identifier for which of the default column formatters should be implemented. A function literal can also be passed.
0391: * @param handler including @unescape, @lookup, @message, @datetime, @date, @time, and @number. For example: <code>@unescape</code>.
0392: <p><b>- or -</b></p>
0393: Function literal with the signature, <code>function(element,cdfkey, matrix, column, rownumber,server)</code>. For example:
0394: <p><pre>
0395: function(element, cdfkey, matrix, column, rownumber, server) {
0396: var mf = new jsx3.util.MessageFormat("{0,number,currency}");
0397: element.innerHTML = mf.format(element.innerHTML);
0398: };
0399: </pre></p>
0400: */
0401: public void setFormatHandler(String handler) {
0402: ScriptBuffer script = new ScriptBuffer();
0403: script.appendCall(getContextPath() + "setFormatHandler",
0404: handler);
0405: getScriptProxy().addScript(script);
0406: }
0407:
0408: /**
0409: * Sets the identifier for which of the default column formatters should be implemented. A function literal can also be passed.
0410: * @param handler including @unescape, @lookup, @message, @datetime, @date, @time, and @number. For example: <code>@unescape</code>.
0411: <p><b>- or -</b></p>
0412: Function literal with the signature, <code>function(element,cdfkey, matrix, column, rownumber,server)</code>. For example:
0413: <p><pre>
0414: function(element, cdfkey, matrix, column, rownumber, server) {
0415: var mf = new jsx3.util.MessageFormat("{0,number,currency}");
0416: element.innerHTML = mf.format(element.innerHTML);
0417: };
0418: </pre></p>
0419: */
0420: public void setFormatHandler(
0421: org.directwebremoting.proxy.CodeBlock handler) {
0422: ScriptBuffer script = new ScriptBuffer();
0423: script.appendCall(getContextPath() + "setFormatHandler",
0424: handler);
0425: getScriptProxy().addScript(script);
0426: }
0427:
0428: /**
0429: * Sets the identifier for which of the default column formatters should be implemented. A function literal can also be passed.
0430: * @param handler including @unescape, @lookup, @message, @datetime, @date, @time, and @number. For example: <code>@unescape</code>.
0431: <p><b>- or -</b></p>
0432: Function literal with the signature, <code>function(element,cdfkey, matrix, column, rownumber,server)</code>. For example:
0433: <p><pre>
0434: function(element, cdfkey, matrix, column, rownumber, server) {
0435: var mf = new jsx3.util.MessageFormat("{0,number,currency}");
0436: element.innerHTML = mf.format(element.innerHTML);
0437: };
0438: </pre></p>
0439: */
0440: public void setFormatHandler(jsx3.gui.matrix.ColumnFormat handler) {
0441: ScriptBuffer script = new ScriptBuffer();
0442: script.appendCall(getContextPath() + "setFormatHandler",
0443: handler);
0444: getScriptProxy().addScript(script);
0445: }
0446:
0447: /**
0448: * Gets the named object that will handle the reformatting of a given column's data cells. This object should
0449: implment the interface, jsx3.gui.Matrix.ColumnFormat, or adhere to its APIs.
0450: Can also return the function literal
0451: * @param callback named object or function literal
0452: */
0453: @SuppressWarnings("unchecked")
0454: public void getFormatHandler(
0455: org.directwebremoting.proxy.Callback<String> callback) {
0456: ScriptBuffer script = new ScriptBuffer();
0457: String callbackPrefix = "";
0458:
0459: if (callback != null) {
0460: callbackPrefix = "var reply = ";
0461: }
0462:
0463: script.appendCall(callbackPrefix + getContextPath()
0464: + "getFormatHandler");
0465:
0466: if (callback != null) {
0467: String key = org.directwebremoting.extend.CallbackHelper
0468: .saveCallback(callback, String.class);
0469: script
0470: .appendCall("__System.activateCallback", key,
0471: "reply");
0472: }
0473:
0474: getScriptProxy().addScript(script);
0475: }
0476:
0477: /**
0478: * Returns the zero-based index for ths column in relation to its siblings. This is different from getChildIndex in that
0479: it corresponds to the position of this column as rendered on-screen, meaning if a child of a lesser index is not
0480: displayed (e.g., display = none), the value returned from this method will be less than what would be returned by getChildIndex.
0481: Returns null if this object is not displayed.
0482: */
0483: @SuppressWarnings("unchecked")
0484: public void getDisplayIndex(
0485: org.directwebremoting.proxy.Callback<Integer> callback) {
0486: ScriptBuffer script = new ScriptBuffer();
0487: String callbackPrefix = "";
0488:
0489: if (callback != null) {
0490: callbackPrefix = "var reply = ";
0491: }
0492:
0493: script.appendCall(callbackPrefix + getContextPath()
0494: + "getDisplayIndex");
0495:
0496: if (callback != null) {
0497: String key = org.directwebremoting.extend.CallbackHelper
0498: .saveCallback(callback, Integer.class);
0499: script
0500: .appendCall("__System.activateCallback", key,
0501: "reply");
0502: }
0503:
0504: getScriptProxy().addScript(script);
0505: }
0506:
0507: /**
0508: * Returns CSS property value for the data cell background-color.
0509: */
0510: @SuppressWarnings("unchecked")
0511: public void getCellBackgroundColor(
0512: org.directwebremoting.proxy.Callback<String> callback) {
0513: ScriptBuffer script = new ScriptBuffer();
0514: String callbackPrefix = "";
0515:
0516: if (callback != null) {
0517: callbackPrefix = "var reply = ";
0518: }
0519:
0520: script.appendCall(callbackPrefix + getContextPath()
0521: + "getCellBackgroundColor");
0522:
0523: if (callback != null) {
0524: String key = org.directwebremoting.extend.CallbackHelper
0525: .saveCallback(callback, String.class);
0526: script
0527: .appendCall("__System.activateCallback", key,
0528: "reply");
0529: }
0530:
0531: getScriptProxy().addScript(script);
0532: }
0533:
0534: /**
0535: * Sets CSS property value for the data cell background-color. Call repaint on the parent instance to update the view.
0536: * @param strColor valid CSS property value, (e.g., red, #ff0000, rgb(255,0,0))
0537: */
0538: public void setCellBackgroundColor(String strColor) {
0539: ScriptBuffer script = new ScriptBuffer();
0540: script.appendCall(getContextPath() + "setCellBackgroundColor",
0541: strColor);
0542: getScriptProxy().addScript(script);
0543: }
0544:
0545: /**
0546: * Returns CSS property value for the data cell border.
0547: */
0548: @SuppressWarnings("unchecked")
0549: public void getCellBorder(
0550: org.directwebremoting.proxy.Callback<String> callback) {
0551: ScriptBuffer script = new ScriptBuffer();
0552: String callbackPrefix = "";
0553:
0554: if (callback != null) {
0555: callbackPrefix = "var reply = ";
0556: }
0557:
0558: script.appendCall(callbackPrefix + getContextPath()
0559: + "getCellBorder");
0560:
0561: if (callback != null) {
0562: String key = org.directwebremoting.extend.CallbackHelper
0563: .saveCallback(callback, String.class);
0564: script
0565: .appendCall("__System.activateCallback", key,
0566: "reply");
0567: }
0568:
0569: getScriptProxy().addScript(script);
0570: }
0571:
0572: /**
0573: * Sets CSS property value(s) for a border for the data cells. Updates MODEL and VIEW (unless repaint is suppressed).
0574: * @param strCSS valid CSS property value for border. For example: <code>solid 1px red;solid 0px;solid 0px;solid 1px white</code>
0575: * @param bSuppressRepaint Pass <code>true</code> to stop the default repaint from occurring.
0576: Typically property updates that affect the browser-specific box model (such as borders) are repainted
0577: immediately to keep the box model abstraction in synch with the native view. However, the repaint can be
0578: suppressed to avoid unnecessary reparsing of the XSLT during repeated property updates.
0579: */
0580: public void setCellBorder(String strCSS, boolean bSuppressRepaint) {
0581: ScriptBuffer script = new ScriptBuffer();
0582: script.appendCall(getContextPath() + "setCellBorder", strCSS,
0583: bSuppressRepaint);
0584: getScriptProxy().addScript(script);
0585: }
0586:
0587: /**
0588: * Returns CSS property value for the data cell color.
0589: */
0590: @SuppressWarnings("unchecked")
0591: public void getCellColor(
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: + "getCellColor");
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 CSS property value for the data cell color. Call repaint on the parent instance to update the view.
0616: * @param strColor valid CSS property value, (e.g., red, #ffffff, rgb(255,0,0))
0617: */
0618: public void setCellColor(String strColor) {
0619: ScriptBuffer script = new ScriptBuffer();
0620: script.appendCall(getContextPath() + "setCellColor", strColor);
0621: getScriptProxy().addScript(script);
0622: }
0623:
0624: /**
0625: * Returns CSS property value for the data cell cursor.
0626: */
0627: @SuppressWarnings("unchecked")
0628: public void getCellCursor(
0629: org.directwebremoting.proxy.Callback<String> callback) {
0630: ScriptBuffer script = new ScriptBuffer();
0631: String callbackPrefix = "";
0632:
0633: if (callback != null) {
0634: callbackPrefix = "var reply = ";
0635: }
0636:
0637: script.appendCall(callbackPrefix + getContextPath()
0638: + "getCellCursor");
0639:
0640: if (callback != null) {
0641: String key = org.directwebremoting.extend.CallbackHelper
0642: .saveCallback(callback, String.class);
0643: script
0644: .appendCall("__System.activateCallback", key,
0645: "reply");
0646: }
0647:
0648: getScriptProxy().addScript(script);
0649: }
0650:
0651: /**
0652: * Sets CSS property value for the data cell cursor. Call repaint on the parent instance to update the view.
0653: * @param strCursor CSS property value, (e.g., default, wait, col-resize)
0654: */
0655: public void setCellCursor(String strCursor) {
0656: ScriptBuffer script = new ScriptBuffer();
0657: script
0658: .appendCall(getContextPath() + "setCellCursor",
0659: strCursor);
0660: getScriptProxy().addScript(script);
0661: }
0662:
0663: /**
0664: * Returns the CSS property value for the data cell font-family.
0665: */
0666: @SuppressWarnings("unchecked")
0667: public void getCellFontName(
0668: org.directwebremoting.proxy.Callback<String> callback) {
0669: ScriptBuffer script = new ScriptBuffer();
0670: String callbackPrefix = "";
0671:
0672: if (callback != null) {
0673: callbackPrefix = "var reply = ";
0674: }
0675:
0676: script.appendCall(callbackPrefix + getContextPath()
0677: + "getCellFontName");
0678:
0679: if (callback != null) {
0680: String key = org.directwebremoting.extend.CallbackHelper
0681: .saveCallback(callback, String.class);
0682: script
0683: .appendCall("__System.activateCallback", key,
0684: "reply");
0685: }
0686:
0687: getScriptProxy().addScript(script);
0688: }
0689:
0690: /**
0691: * Sets the CSS property value for the data cell font-family. Call repaint on the parent instance to update the view.
0692: * @param strFontName valid CSS font-family property value (e.g., Arial, Courier)
0693: */
0694: public void setCellFontName(String strFontName) {
0695: ScriptBuffer script = new ScriptBuffer();
0696: script.appendCall(getContextPath() + "setCellFontName",
0697: strFontName);
0698: getScriptProxy().addScript(script);
0699: }
0700:
0701: /**
0702: * Returns the CSS property value for the data cell font-size.
0703: */
0704: @SuppressWarnings("unchecked")
0705: public void getCellFontSize(
0706: org.directwebremoting.proxy.Callback<Integer> callback) {
0707: ScriptBuffer script = new ScriptBuffer();
0708: String callbackPrefix = "";
0709:
0710: if (callback != null) {
0711: callbackPrefix = "var reply = ";
0712: }
0713:
0714: script.appendCall(callbackPrefix + getContextPath()
0715: + "getCellFontSize");
0716:
0717: if (callback != null) {
0718: String key = org.directwebremoting.extend.CallbackHelper
0719: .saveCallback(callback, Integer.class);
0720: script
0721: .appendCall("__System.activateCallback", key,
0722: "reply");
0723: }
0724:
0725: getScriptProxy().addScript(script);
0726: }
0727:
0728: /**
0729: * Sets the CSS property value for the data cell font-size. Call repaint on the parent instance to update the view.
0730: * @param intPixelSize font-size (in pixels)
0731: */
0732: public void setCellFontSize(int intPixelSize) {
0733: ScriptBuffer script = new ScriptBuffer();
0734: script.appendCall(getContextPath() + "setCellFontSize",
0735: intPixelSize);
0736: getScriptProxy().addScript(script);
0737: }
0738:
0739: /**
0740: * Returns the CSS property value for the data cell font-weight.
0741: */
0742: @SuppressWarnings("unchecked")
0743: public void getCellFontWeight(
0744: org.directwebremoting.proxy.Callback<String> callback) {
0745: ScriptBuffer script = new ScriptBuffer();
0746: String callbackPrefix = "";
0747:
0748: if (callback != null) {
0749: callbackPrefix = "var reply = ";
0750: }
0751:
0752: script.appendCall(callbackPrefix + getContextPath()
0753: + "getCellFontWeight");
0754:
0755: if (callback != null) {
0756: String key = org.directwebremoting.extend.CallbackHelper
0757: .saveCallback(callback, String.class);
0758: script
0759: .appendCall("__System.activateCallback", key,
0760: "reply");
0761: }
0762:
0763: getScriptProxy().addScript(script);
0764: }
0765:
0766: /**
0767: * Sets the CSS property value for the data cell font-weight. Call repaint on the parent instance to update the view.
0768: * @param FONTWEIGHT one of: <code>jsx3.gui.Block.FONTBOLD</code>, <code>jsx3.gui.Block.FONTNORMAL</code>
0769: */
0770: public void setCellFontWeight(String FONTWEIGHT) {
0771: ScriptBuffer script = new ScriptBuffer();
0772: script.appendCall(getContextPath() + "setCellFontWeight",
0773: FONTWEIGHT);
0774: getScriptProxy().addScript(script);
0775: }
0776:
0777: /**
0778: * Returns the CSS property value for the data cell padding.
0779: */
0780: @SuppressWarnings("unchecked")
0781: public void getCellPadding(
0782: org.directwebremoting.proxy.Callback<String> callback) {
0783: ScriptBuffer script = new ScriptBuffer();
0784: String callbackPrefix = "";
0785:
0786: if (callback != null) {
0787: callbackPrefix = "var reply = ";
0788: }
0789:
0790: script.appendCall(callbackPrefix + getContextPath()
0791: + "getCellPadding");
0792:
0793: if (callback != null) {
0794: String key = org.directwebremoting.extend.CallbackHelper
0795: .saveCallback(callback, String.class);
0796: script
0797: .appendCall("__System.activateCallback", key,
0798: "reply");
0799: }
0800:
0801: getScriptProxy().addScript(script);
0802: }
0803:
0804: /**
0805: * Sets the CSS property value for the data cell padding. Updates MODEL and VIEW (unless repaint is suppressed).
0806: * @param strCSS valid CSS property value for padding. For example: <code>8 4 8 4</code>
0807: * @param bSuppressRepaint Pass <code>true</code> to stop the default repaint from occurring.
0808: Typically property updates that affect the browser-specific box model (such as padding) are repainted
0809: immediately to keep the box model abstraction in synch with the native view. However, the repaint can be
0810: suppressed to avoid unnecessary reparsing of the XSLT during repeated property updates.
0811: */
0812: public void setCellPadding(String strCSS, boolean bSuppressRepaint) {
0813: ScriptBuffer script = new ScriptBuffer();
0814: script.appendCall(getContextPath() + "setCellPadding", strCSS,
0815: bSuppressRepaint);
0816: getScriptProxy().addScript(script);
0817: }
0818:
0819: /**
0820: * Returns the CSS property value for the data cell text-align.
0821: */
0822: @SuppressWarnings("unchecked")
0823: public void getCellTextAlign(
0824: org.directwebremoting.proxy.Callback<String> callback) {
0825: ScriptBuffer script = new ScriptBuffer();
0826: String callbackPrefix = "";
0827:
0828: if (callback != null) {
0829: callbackPrefix = "var reply = ";
0830: }
0831:
0832: script.appendCall(callbackPrefix + getContextPath()
0833: + "getCellTextAlign");
0834:
0835: if (callback != null) {
0836: String key = org.directwebremoting.extend.CallbackHelper
0837: .saveCallback(callback, String.class);
0838: script
0839: .appendCall("__System.activateCallback", key,
0840: "reply");
0841: }
0842:
0843: getScriptProxy().addScript(script);
0844: }
0845:
0846: /**
0847: * Sets the CSS property value for the data cell text-align. Call repaint on the parent instance to update the view.
0848: * @param ALIGN one of: <code>jsx3.gui.Block.ALIGNLEFT</code>, <code>jsx3.gui.Block.ALIGNRIGHT</code>, <code>jsx3.gui.Block.ALIGNCENTER</code>
0849: */
0850: public void setCellTextAlign(String ALIGN) {
0851: ScriptBuffer script = new ScriptBuffer();
0852: script.appendCall(getContextPath() + "setCellTextAlign", ALIGN);
0853: getScriptProxy().addScript(script);
0854: }
0855:
0856: /**
0857: * Returns the CSS property value for the data cell vertical-align. If no value is provided, the data cells render top-aligned.
0858: */
0859: @SuppressWarnings("unchecked")
0860: public void getCellVAlign(
0861: org.directwebremoting.proxy.Callback<String> callback) {
0862: ScriptBuffer script = new ScriptBuffer();
0863: String callbackPrefix = "";
0864:
0865: if (callback != null) {
0866: callbackPrefix = "var reply = ";
0867: }
0868:
0869: script.appendCall(callbackPrefix + getContextPath()
0870: + "getCellVAlign");
0871:
0872: if (callback != null) {
0873: String key = org.directwebremoting.extend.CallbackHelper
0874: .saveCallback(callback, String.class);
0875: script
0876: .appendCall("__System.activateCallback", key,
0877: "reply");
0878: }
0879:
0880: getScriptProxy().addScript(script);
0881: }
0882:
0883: /**
0884: * Sets the CSS property value for the data cell vertical-align. Call repaint on the parent instance to update the view.
0885: * @param VALIGN valid CSS value for vertical-align style.
0886: */
0887: public void setCellVAlign(String VALIGN) {
0888: ScriptBuffer script = new ScriptBuffer();
0889: script.appendCall(getContextPath() + "setCellVAlign", VALIGN);
0890: getScriptProxy().addScript(script);
0891: }
0892:
0893: /**
0894: * Returns whether or not the data cellc will support text-wrapping. If no value is specified, the text will not wrap
0895: * @param strDefault The default value to use if null
0896: */
0897: @SuppressWarnings("unchecked")
0898: public void getCellWrap(String strDefault,
0899: org.directwebremoting.proxy.Callback<Integer> callback) {
0900: ScriptBuffer script = new ScriptBuffer();
0901: String callbackPrefix = "";
0902:
0903: if (callback != null) {
0904: callbackPrefix = "var reply = ";
0905: }
0906:
0907: script.appendCall(callbackPrefix + getContextPath()
0908: + "getCellWrap", strDefault);
0909:
0910: if (callback != null) {
0911: String key = org.directwebremoting.extend.CallbackHelper
0912: .saveCallback(callback, Integer.class);
0913: script
0914: .appendCall("__System.activateCallback", key,
0915: "reply");
0916: }
0917:
0918: getScriptProxy().addScript(script);
0919: }
0920:
0921: /**
0922: * Sets whether or not the data cellc will support text-wrapping. If no value is
0923: specified, the text will not wrap. Call repaint to update the VIEW
0924: * @param WRAP <code>jsx3.Boolean.TRUE</code> or <code>jsx3.Boolean.FALSE</code>
0925: */
0926: public void setCellWrap(int WRAP) {
0927: ScriptBuffer script = new ScriptBuffer();
0928: script.appendCall(getContextPath() + "setCellWrap", WRAP);
0929: getScriptProxy().addScript(script);
0930: }
0931:
0932: /**
0933: * Gets whether or not the header cell will support text-wrapping. If not specified, the cell will be painted with no wrapping.
0934: * @param strDefault The default value to use if null
0935: */
0936: @SuppressWarnings("unchecked")
0937: public void getWrap(String strDefault,
0938: org.directwebremoting.proxy.Callback<Boolean> callback) {
0939: ScriptBuffer script = new ScriptBuffer();
0940: String callbackPrefix = "";
0941:
0942: if (callback != null) {
0943: callbackPrefix = "var reply = ";
0944: }
0945:
0946: script.appendCall(
0947: callbackPrefix + getContextPath() + "getWrap",
0948: strDefault);
0949:
0950: if (callback != null) {
0951: String key = org.directwebremoting.extend.CallbackHelper
0952: .saveCallback(callback, Boolean.class);
0953: script
0954: .appendCall("__System.activateCallback", key,
0955: "reply");
0956: }
0957:
0958: getScriptProxy().addScript(script);
0959: }
0960:
0961: /**
0962: * Sets whether or not the header cell will support text-wrapping. Repaints the header to immediately reflect this change.
0963: * @param WRAP
0964: */
0965: public void setWrap(Boolean WRAP) {
0966: ScriptBuffer script = new ScriptBuffer();
0967: script.appendCall(getContextPath() + "setWrap", WRAP);
0968: getScriptProxy().addScript(script);
0969: }
0970:
0971: /**
0972: * Returns the CSS property value for the header cell vertical-align. If no value is provided, the header cell render top-aligned.
0973: */
0974: @SuppressWarnings("unchecked")
0975: public void getVAlign(
0976: org.directwebremoting.proxy.Callback<String> callback) {
0977: ScriptBuffer script = new ScriptBuffer();
0978: String callbackPrefix = "";
0979:
0980: if (callback != null) {
0981: callbackPrefix = "var reply = ";
0982: }
0983:
0984: script.appendCall(callbackPrefix + getContextPath()
0985: + "getVAlign");
0986:
0987: if (callback != null) {
0988: String key = org.directwebremoting.extend.CallbackHelper
0989: .saveCallback(callback, String.class);
0990: script
0991: .appendCall("__System.activateCallback", key,
0992: "reply");
0993: }
0994:
0995: getScriptProxy().addScript(script);
0996: }
0997:
0998: /**
0999: * Sets the CSS property value for the header cell vertical-align. Repaints the header to immediately reflect this change.
1000: * @param VALIGN valid CSS value for vertical-align style.
1001: */
1002: public void setVAlign(String VALIGN) {
1003: ScriptBuffer script = new ScriptBuffer();
1004: script.appendCall(getContextPath() + "setVAlign", VALIGN);
1005: getScriptProxy().addScript(script);
1006: }
1007:
1008: }
|