From xap-commits-return-516-apmail-incubator-xap-commits-archive=incubator.apache.org@incubator.apache.org Sun Oct 01 07:24:01 2006 Return-Path: Delivered-To: apmail-incubator-xap-commits-archive@locus.apache.org Received: (qmail 78142 invoked from network); 1 Oct 2006 07:24:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 1 Oct 2006 07:24:01 -0000 Received: (qmail 71848 invoked by uid 500); 1 Oct 2006 07:24:01 -0000 Delivered-To: apmail-incubator-xap-commits-archive@incubator.apache.org Received: (qmail 71826 invoked by uid 500); 1 Oct 2006 07:24:01 -0000 Mailing-List: contact xap-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: xap-dev@incubator.apache.org Delivered-To: mailing list xap-commits@incubator.apache.org Received: (qmail 71817 invoked by uid 99); 1 Oct 2006 07:24:01 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (140.211.166.84) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 01 Oct 2006 00:24:01 -0700 X-ASF-Spam-Status: No, hits=-8.6 required=5.0 tests=ALL_TRUSTED,INFO_TLD,NO_REAL_NAME Received: from [140.211.166.113] ([140.211.166.113:56500] helo=eris.apache.org) by idunn.apache.osuosl.org (ecelerity 2.1.1.8 r(12930)) with ESMTP id CD/31-01321-90D6F154 for ; Sun, 01 Oct 2006 00:23:55 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 1455C1A9820; Sun, 1 Oct 2006 00:23:52 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r451723 [3/3] - in /incubator/xap/trunk: WebContent/examples/dataBinding/ src/xap/data/ src/xap/data/bridge/ src/xap/data/controller/ src/xap/data/datasource/ src/xap/taghandling/ src/xap/xml/ Date: Sun, 01 Oct 2006 07:23:50 -0000 To: xap-commits@incubator.apache.org From: mturyn@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20061001072352.1455C1A9820@eris.apache.org> X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Modified: incubator/xap/trunk/src/xap/taghandling/AttributeConverter.js URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/taghandling/AttributeConverter.js?view=diff&rev=451723&r1=451722&r2=451723 ============================================================================== --- incubator/xap/trunk/src/xap/taghandling/AttributeConverter.js (original) +++ incubator/xap/trunk/src/xap/taghandling/AttributeConverter.js Sun Oct 1 00:23:49 2006 @@ -1,121 +1,121 @@ -/* - * Copyright 2006 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * -**/ - -Xap.provide("xap.taghandling.AttributeConverter") ; +/* + * Copyright 2006 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * +**/ + +Xap.provide("xap.taghandling.AttributeConverter") ; -Xap.require("xap.session.ClientSession"); -//Xap.require("xap.XmlTokens") ; -//Xap.require("xap.bridges.GradientBridge") ; -//Xap.require("xap.component.NPanel") ; +Xap.require("xap.session.ClientSession"); +//Xap.require("xap.xml.XmlTokens") ; +//Xap.require("xap.bridges.GradientBridge") ; +//Xap.require("xap.component.NPanel") ; //Xap.require("xap.stylesheet.Style") ; -Xap.require("xap.xml.dom.Document"); - +Xap.require("xap.xml.dom.Document"); + //Xap.require("xap.xml.DocumentRegistry") ; Xap.require("xap.xml.DocumentContainer"); Xap.require("xap.xml.dom.XapElement"); -/** - * - * A helper class for converting Strings (usually attributes) - * into other data types. This should be used by tag-handlers - * to convert attributes into the property data types, typically - * in the attributeSet() method. - * - * @author James Margaris - * @author Stan - * +/** + * + * A helper class for converting Strings (usually attributes) + * into other data types. This should be used by tag-handlers + * to convert attributes into the property data types, typically + * in the attributeSet() method. + * + * @author James Margaris + * @author Stan + * */ xap.taghandling.AttributeConverter = function () { }; Xap.setupClassAsSubclassOf("xap.taghandling.AttributeConverter", "Object"); -/** - * Indicates that a value is not set. This can be useful - * for tracking things like "fontBold", which can be set to true - * or false or not set, which maked in inherit the style - * from the parent. +/** + * Indicates that a value is not set. This can be useful + * for tracking things like "fontBold", which can be set to true + * or false or not set, which maked in inherit the style + * from the parent. *public static final int*/ xap.taghandling.AttributeConverter.NOT_SET = null; -/** - * Indicates that a value is set to false. +/** + * Indicates that a value is set to false. *public static final int*/ xap.taghandling.AttributeConverter.FALSE = 0; -/** - * Indicates that a value is set to true. +/** + * Indicates that a value is set to true. *public static final int*/ xap.taghandling.AttributeConverter.TRUE = 1; /*private static final Color[]*/ -xap.taghandling.AttributeConverter.s_colorValues = []; -// TODO: Add these? -// Color.black, Color.blue, Color.cyan, -// Color.darkGray, Color.gray, Color.green, -// Color.lightGray, Color.magenta, Color.orange, -// Color.pink, Color.red, Color.white, -// Color.yellow, SystemColor.activeCaptionBorder, SystemColor.activeCaption, -// SystemColor.control, SystemColor.activeCaptionText, SystemColor.inactiveCaptionBorder, -// SystemColor.inactiveCaptionText, SystemColor.controlHighlight, SystemColor.infoText, -// SystemColor.info, SystemColor.menu, SystemColor.menuText, -// SystemColor.controlDkShadow, SystemColor.desktop, SystemColor.scrollbar, -// SystemColor.textHighlightText, SystemColor.textHighlight, SystemColor.window, +xap.taghandling.AttributeConverter.s_colorValues = []; +// TODO: Add these? +// Color.black, Color.blue, Color.cyan, +// Color.darkGray, Color.gray, Color.green, +// Color.lightGray, Color.magenta, Color.orange, +// Color.pink, Color.red, Color.white, +// Color.yellow, SystemColor.activeCaptionBorder, SystemColor.activeCaption, +// SystemColor.control, SystemColor.activeCaptionText, SystemColor.inactiveCaptionBorder, +// SystemColor.inactiveCaptionText, SystemColor.controlHighlight, SystemColor.infoText, +// SystemColor.info, SystemColor.menu, SystemColor.menuText, +// SystemColor.controlDkShadow, SystemColor.desktop, SystemColor.scrollbar, +// SystemColor.textHighlightText, SystemColor.textHighlight, SystemColor.window, // SystemColor.windowText, SystemColor.controlShadow,SystemColor.inactiveCaption /*private static final int[]*/ -xap.taghandling.AttributeConverter.s_cursorConstants = []; -// TODO: Add these? -// Cursor.HAND_CURSOR, Cursor.CROSSHAIR_CURSOR, Cursor.E_RESIZE_CURSOR, -// Cursor.W_RESIZE_CURSOR, Cursor.S_RESIZE_CURSOR, Cursor.N_RESIZE_CURSOR, -// Cursor.NE_RESIZE_CURSOR, Cursor.NW_RESIZE_CURSOR, Cursor.SE_RESIZE_CURSOR, -// Cursor.SW_RESIZE_CURSOR, Cursor.TEXT_CURSOR, Cursor.MOVE_CURSOR, +xap.taghandling.AttributeConverter.s_cursorConstants = []; +// TODO: Add these? +// Cursor.HAND_CURSOR, Cursor.CROSSHAIR_CURSOR, Cursor.E_RESIZE_CURSOR, +// Cursor.W_RESIZE_CURSOR, Cursor.S_RESIZE_CURSOR, Cursor.N_RESIZE_CURSOR, +// Cursor.NE_RESIZE_CURSOR, Cursor.NW_RESIZE_CURSOR, Cursor.SE_RESIZE_CURSOR, +// Cursor.SW_RESIZE_CURSOR, Cursor.TEXT_CURSOR, Cursor.MOVE_CURSOR, // Cursor.DEFAULT_CURSOR, Cursor.WAIT_CURSOR -/** - * Converts the string to a java.awt.Cursor. - * @param s The name of a cursor. - * @return A Cursor. - * @throws xap.taghandling.AttributeConversionException Throws if the cursor name is invalid. - * - * @public - * @return {Cursor} - * - * @param s{String} - * @throws xap.taghandling.AttributeConversionException +/** + * Converts the string to a java.awt.Cursor. + * @param s The name of a cursor. + * @return A Cursor. + * @throws xap.taghandling.AttributeConversionException Throws if the cursor name is invalid. + * + * @public + * @return {Cursor} + * + * @param s{String} + * @throws xap.taghandling.AttributeConversionException **/ xap.taghandling.AttributeConverter.toCursor = function (s) { if (xap.taghandling.isEmptyOrNull(s)) { throw new xap.taghandling.AttributeConversionException(s, "cursor", null); } - if (s.equals("")) { + if (s == "") { return null; } //TODO does this make sense? - for (var i = 0; i < XmlTokens.CURSOR_NAMES.length; i++) { - if (s.equals(XmlTokens.CURSOR_NAMES[i])) { + for (var i = 0; i < xap.xml.XmlTokens.CURSOR_NAMES.length; i++) { + if (s == xap.xml.XmlTokens.CURSOR_NAMES[i]) { return Cursor.getPredefinedCursor(s_cursorConstants[i]); } } throw new xap.taghandling.AttributeConversionException(s, "cursor", null); }; -/** - * Converts the string to a boolean. - * @param s The string to convert. - * @return A boolean. - * @throws xap.taghandling.AttributeConversionException If the string is empty, null, - * or otherwise cannot be converted. - * - * @public - * @return {boolean} - * - * @param s{String} - * @throws xap.taghandling.AttributeConversionException +/** + * Converts the string to a boolean. + * @param s The string to convert. + * @return A boolean. + * @throws xap.taghandling.AttributeConversionException If the string is empty, null, + * or otherwise cannot be converted. + * + * @public + * @return {boolean} + * + * @param s{String} + * @throws xap.taghandling.AttributeConversionException **/ xap.taghandling.AttributeConverter.toBoolean = function (s) { if (xap.taghandling.isEmptyOrNull(s)) { @@ -123,21 +123,21 @@ } return (new Boolean(s)).booleanValue(); }; -/** - * Convert a String "true", "false", "", or null to integer TRUE, - * FALSE, NOT_SET, or NOT_SET, throwing an exception if any other value encountered. - * Tristate values are used to track things that can be true, false, - * or not set by the user. For example, the bold style of a component - * can be set to false, true, or left unspecified. - * @param s String to parse - * @return TRUE, FALSE, or NOT_SET - * @throws xap.taghandling.AttributeConversionException - * - * @public - * @return {int} - * - * @param s{String} - * @throws xap.taghandling.AttributeConversionException{ +/** + * Convert a String "true", "false", "", or null to integer TRUE, + * FALSE, NOT_SET, or NOT_SET, throwing an exception if any other value encountered. + * Tristate values are used to track things that can be true, false, + * or not set by the user. For example, the bold style of a component + * can be set to false, true, or left unspecified. + * @param s String to parse + * @return TRUE, FALSE, or NOT_SET + * @throws xap.taghandling.AttributeConversionException + * + * @public + * @return {int} + * + * @param s{String} + * @throws xap.taghandling.AttributeConversionException{ **/ xap.taghandling.AttributeConverter.toTriState = function (s) { var result = xap.taghandling.AttributeConverter.NOT_SET; @@ -146,23 +146,23 @@ result = xap.taghandling.AttributeConverter.TRUE; } else if (s == "false") { result = xap.taghandling.AttributeConverter.FALSE; - } else { + } else { throw new xap.taghandling.AttributeConversionException(s,"tristate",null); } } return result; }; -/** - * Convert an int TRUE, FALSE, or NOT_SET to a boolean, - * using the passed default value in the last case. - * @param ts an int TRUE, FALSE, or NOT_SET - * @param defalt default value to use - * @return passed default value or forced true or false - * - * @public - * @param ts{integer} - * @param defalt{boolean} Use default value? - * @return {boolean} +/** + * Convert an int TRUE, FALSE, or NOT_SET to a boolean, + * using the passed default value in the last case. + * @param ts an int TRUE, FALSE, or NOT_SET + * @param defalt default value to use + * @return passed default value or forced true or false + * + * @public + * @param ts{integer} + * @param defalt{boolean} Use default value? + * @return {boolean} **/ xap.taghandling.AttributeConverter.toBooleanFromTriStateInt = function (ts, defalt) { var defalt = null; @@ -176,98 +176,98 @@ } return defalt; }; -/** - * Convert a String "true", "false", "", or null to a boolean, - * using the passed default value in the last 2 cases. - * @param s String to parse - * @param defalt default value to use - * @return passed default value or forced true or false - * @throws xap.taghandling.AttributeConversionException - * - * @public - * @return {boolean} - * @throws xap.taghandling.AttributeConversionException +/** + * Convert a String "true", "false", "", or null to a boolean, + * using the passed default value in the last 2 cases. + * @param s String to parse + * @param defalt default value to use + * @return passed default value or forced true or false + * @throws xap.taghandling.AttributeConversionException + * + * @public + * @return {boolean} + * @throws xap.taghandling.AttributeConversionException **/ xap.taghandling.AttributeConverter.toBooleanFromTriState = function (s, defalt) { return toBooleanFromTriStateInt(this.toTriState(s), defalt); }; -/** - * Converts a string to a date given the SimpleDateFormat - * @param s The String to convert - * @param dateFormat The dateFormat to use in conversion. - * @return A Date object. - * @throws xap.taghandling.AttributeConversionException - * - * @public - * @return {Date} - * @throws xap.taghandling.AttributeConversionException +/** + * Converts a string to a date given the SimpleDateFormat + * @param s The String to convert + * @param dateFormat The dateFormat to use in conversion. + * @return A Date object. + * @throws xap.taghandling.AttributeConversionException + * + * @public + * @return {Date} + * @throws xap.taghandling.AttributeConversionException **/ xap.taghandling.AttributeConverter.toDate = function (s, dateFormat) { try { return dateFormat.parse(s); } - catch (e) { //ParseException + catch (e) { //ParseException //TODO include data format info? throw new xap.taghandling.AttributeConversionException(s, "date", e); } }; -/** - * Coverts the string to an integer. - * @param s The String to convert. - * @return An int. - * @throws xap.taghandling.AttributeConversionException - * - * @public - * @return {int} - * - * @param s{String} - * @throws xap.taghandling.AttributeConversionException +/** + * Coverts the string to an integer. + * @param s The String to convert. + * @return An int. + * @throws xap.taghandling.AttributeConversionException + * + * @public + * @return {int} + * + * @param s{String} + * @throws xap.taghandling.AttributeConversionException **/ xap.taghandling.AttributeConverter.toInteger = function (s) { try { return ((new Integer(s))).intValue(); } - catch (e) { //Exception - //don't wrap the exception we get, it makes the stack trace + catch (e) { //Exception + //don't wrap the exception we get, it makes the stack trace //way too long and the problem is obvious anyway throw new xap.taghandling.AttributeConversionException(s, "integer", null); } }; -/** - * Converts the string to a float. - * @param s The string to convert. - * @return A float. - * @throws xap.taghandling.AttributeConversionException - * - * @public - * @return {float} - * - * @param s{String} - * @throws xap.taghandling.AttributeConversionException +/** + * Converts the string to a float. + * @param s The string to convert. + * @return A float. + * @throws xap.taghandling.AttributeConversionException + * + * @public + * @return {float} + * + * @param s{String} + * @throws xap.taghandling.AttributeConversionException **/ xap.taghandling.AttributeConverter.toFloat = function (s) { try { return ((new Float(s))).floatValue(); } - catch (e) { //Exception - //don't wrap the exception we get, it makes the stack trace + catch (e) { //Exception + //don't wrap the exception we get, it makes the stack trace //way too long and the problem is obvious anyway throw new xap.taghandling.AttributeConversionException(s, "float", null); } }; -/** - * Converts a string into an array of length number. - * If the string is just one value, the array is all duplicates - * If th string is number different comma separated value and - * length is not number this throws an error - * @param s The String to convert - * @param number The length of the array to return. - * @return An int[] of length number. - * @throws xap.taghandling.AttributeConversionException - * - * @public - * @return {int[]} - * @throws xap.taghandling.AttributeConversionException +/** + * Converts a string into an array of length number. + * If the string is just one value, the array is all duplicates + * If th string is number different comma separated value and + * length is not number this throws an error + * @param s The String to convert + * @param number The length of the array to return. + * @return An int[] of length number. + * @throws xap.taghandling.AttributeConversionException + * + * @public + * @return {int[]} + * @throws xap.taghandling.AttributeConversionException **/ xap.taghandling.AttributeConverter.toIntegers = function (s, number) { if (xap.taghandling.isEmptyOrNull(s)) { @@ -294,18 +294,18 @@ } return ints; }; -/** - * Converts a comma separated list into an array of floats of any size, - * can return null. - * @param s The String to convert. - * @return A float[]. - * @throws xap.taghandling.AttributeConversionException - * - * @public - * @return {float[]} - * - * @param s{String} - * @throws xap.taghandling.AttributeConversionException +/** + * Converts a comma separated list into an array of floats of any size, + * can return null. + * @param s The String to convert. + * @return A float[]. + * @throws xap.taghandling.AttributeConversionException + * + * @public + * @return {float[]} + * + * @param s{String} + * @throws xap.taghandling.AttributeConversionException **/ xap.taghandling.AttributeConverter.toFloats = function (s) { if (xap.taghandling.isEmptyOrNull(s)) { @@ -327,17 +327,17 @@ } return floats; }; -/** - * Converts the string to an array of integers. - * @param s A comma-separated list of integers. - * @return An int[]. - * @throws xap.taghandling.AttributeConversionException - * - * @public - * @return {int[]} - * - * @param s{String} - * @throws xap.taghandling.AttributeConversionException +/** + * Converts the string to an array of integers. + * @param s A comma-separated list of integers. + * @return An int[]. + * @throws xap.taghandling.AttributeConversionException + * + * @public + * @return {int[]} + * + * @param s{String} + * @throws xap.taghandling.AttributeConversionException **/ xap.taghandling.AttributeConverter.toIntegers = function (s) { if (xap.taghandling.isEmptyOrNull(s)) { @@ -359,17 +359,17 @@ } return ints; }; -/** - * Expects a string like "78.4%", returns a float - * between 0 and 1. - * @param s The String to convert. - * @return A float between 0 and 1. - * - * @public - * @return {float} - * - * @param s{String} - * @throws xap.taghandling.AttributeConversionException +/** + * Expects a string like "78.4%", returns a float + * between 0 and 1. + * @param s The String to convert. + * @return A float between 0 and 1. + * + * @public + * @return {float} + * + * @param s{String} + * @throws xap.taghandling.AttributeConversionException **/ xap.taghandling.AttributeConverter.toPercentage = function (s) { if (s == null || !s.endsWith("%") || s.length() <= 1) { @@ -390,19 +390,19 @@ throw new xap.taghandling.AttributeConversionException(s, "percentage", null); } }; -/** - * Converts the string to a color. The string should be of the form - * #HHHHHH where H is a hex digit, or an r,g,b string, - * or a proper color name. - * @param s The String to convert. "transparent" will return null. - * @return An AWT Color. - * @throws xap.taghandling.AttributeConversionException - * - * @public - * @return {Color} - * - * @param s{String} - * @throws xap.taghandling.AttributeConversionException +/** + * Converts the string to a color. The string should be of the form + * #HHHHHH where H is a hex digit, or an r,g,b string, + * or a proper color name. + * @param s The String to convert. "transparent" will return null. + * @return An AWT Color. + * @throws xap.taghandling.AttributeConversionException + * + * @public + * @return {Color} + * + * @param s{String} + * @throws xap.taghandling.AttributeConversionException **/ xap.taghandling.AttributeConverter.toColor = function (s) { try { @@ -412,68 +412,68 @@ throw new xap.taghandling.AttributeConversionException(s, "color", null); } }; -/** - * @private - * @return {Color} - * - * @param s{String} - * @throws IllegalArgumentException +/** + * @private + * @return {Color} + * + * @param s{String} + * @throws IllegalArgumentException **/ xap.taghandling.AttributeConverter.toColorInternal = function (s) { if (xap.taghandling.isEmptyOrNull(s)) { throw new IllegalArgumentException(); } try { - if (s.equals(XmlTokens.TRANSPARENT)) { + if (s == xap.xml.XmlTokens.TRANSPARENT) { return null; } if (s.startsWith("#") && s.trim().length() == 7) { return Color.decode(s); } - for (var i = 0; i < XmlTokens.COLOR_NAMES.length; i++) { - if (s.equals(XmlTokens.COLOR_NAMES[i])) { + for (var i = 0; i < xap.xml.XmlTokens.COLOR_NAMES.length; i++) { + if (s == xap.xml.XmlTokens.COLOR_NAMES[i]) { return s_colorValues[i]; } - } + } // TODO: un-punt this: - /*StringTokenizer*/ -//var st = new StringTokenizer(s,","); -// /*Integer r*/ -//var = new Integer(st.nextToken()); -// /*Integer g*/ -//var = new Integer(st.nextToken()); -// /*Integer b*/ -//var = new Integer(st.nextToken()); -// + /*StringTokenizer*/ +//var st = new StringTokenizer(s,","); +// /*Integer r*/ +//var = new Integer(st.nextToken()); +// /*Integer g*/ +//var = new Integer(st.nextToken()); +// /*Integer b*/ +//var = new Integer(st.nextToken()); +// // return new Color(r.intValue(),g.intValue(),b.intValue()); } catch (e) { // Exception throw new IllegalArgumentException(); } }; -/** - * If passed attribute string is in the passed String array, - * return the corresponding int from the passed int array, - * else throw an xap.taghandling.AttributeConversionException. This can be used - * to turn an enumerated type into a constant, for example turn - * "left","center","right" into 1,2,3 - * @param s The string to convert - * @param names Array of enumeration names - * @param values Array of enumeration values - * @return int from values matching parallel name - * @throws xap.taghandling.AttributeConversionException - * - * @public - * @throws xap.taghandling.AttributeConversionException +/** + * If passed attribute string is in the passed String array, + * return the corresponding int from the passed int array, + * else throw an xap.taghandling.AttributeConversionException. This can be used + * to turn an enumerated type into a constant, for example turn + * "left","center","right" into 1,2,3 + * @param s The string to convert + * @param names Array of enumeration names + * @param values Array of enumeration values + * @return int from values matching parallel name + * @throws xap.taghandling.AttributeConversionException + * + * @public + * @throws xap.taghandling.AttributeConversionException **/ xap.taghandling.AttributeConverter.toIntFromEnum = function (s, names, values) { for (var i = 0; i < values.length; ++i) { - if (names[i].equals(s)) { + if (names[i] == s) { return values[i]; } - } - - //if there was an error produce a string like: + } + + //if there was an error produce a string like: //could not convert to datatype: enumeration of{ true false } /*StringBuffer*/ var stringBuffer = new StringBuffer("enumeration of{ "); @@ -484,30 +484,30 @@ stringBuffer.append("}"); throw new xap.taghandling.AttributeConversionException(s, stringBuffer.toString(), null); }; -/** - * If passed attribute string is in the passed String array, - * return the corresponding Object from the passed Object array, - * else throw an xap.taghandling.AttributeConversionException. This can be used - * to turn an enumerated type into a constant, for example turn - * "left","center","right" into 1,2,3 - * @param s The string to convert - * @param names{String []} Array of enumeration names - * @param values{Object[] } Array of enumeration values - * @return Object from values matching parallel name - * @throws xap.taghandling.AttributeConversionException - * - * @public - * @return {Object} - * @throws xap.taghandling.AttributeConversionException +/** + * If passed attribute string is in the passed String array, + * return the corresponding Object from the passed Object array, + * else throw an xap.taghandling.AttributeConversionException. This can be used + * to turn an enumerated type into a constant, for example turn + * "left","center","right" into 1,2,3 + * @param s The string to convert + * @param names{String []} Array of enumeration names + * @param values{Object[] } Array of enumeration values + * @return Object from values matching parallel name + * @throws xap.taghandling.AttributeConversionException + * + * @public + * @return {Object} + * @throws xap.taghandling.AttributeConversionException **/ xap.taghandling.AttributeConverter.toObjectFromEnum = function (s, names, values) { for (var i = 0; i < values.length; ++i) { - if (names[i].equals(s)) { + if (names[i] == s) { return values[i]; } - } - - //if there was an error produce a string like: + } + + //if there was an error produce a string like: //could not convert to datatype: enumeration of{ true false } /*StringBuffer*/ var stringBuffer = new StringBuffer("enumeration of{ "); @@ -518,18 +518,18 @@ stringBuffer.append("}"); throw new xap.taghandling.AttributeConversionException(s, stringBuffer.toString(), null); }; -/** - * Converts the string s to an array of number length of colors. - * @param s The String to convert. "transparent" will return null. - * @param number The length of the array to return. - * @return A Color[] of length number. - * @throws xap.taghandling.AttributeConversionException - * - * @public - * @return {Color[]} - * - * @param s, int number{String} - * @throws xap.taghandling.AttributeConversionException +/** + * Converts the string s to an array of number length of colors. + * @param s The String to convert. "transparent" will return null. + * @param number The length of the array to return. + * @return A Color[] of length number. + * @throws xap.taghandling.AttributeConversionException + * + * @public + * @return {Color[]} + * + * @param s, int number{String} + * @throws xap.taghandling.AttributeConversionException **/ xap.taghandling.AttributeConverter.toColors = function (s, number) { if (xap.taghandling.isEmptyOrNull(s)) { @@ -556,16 +556,16 @@ } return colors; }; -/** - * Converts an element reference in the form of #ID to an Element. - * @param s{String} The element reference. - * @param d{Document } The document to look the element up in. - * @return An Element. - * @throws xap.taghandling.AttributeConversionException - * - * @public - * @return {Element} - * @throws xap.taghandling.AttributeConversionException +/** + * Converts an element reference in the form of #ID to an Element. + * @param s{String} The element reference. + * @param d{Document } The document to look the element up in. + * @return An Element. + * @throws xap.taghandling.AttributeConversionException + * + * @public + * @return {Element} + * @throws xap.taghandling.AttributeConversionException **/ xap.taghandling.AttributeConverter.toElement = function (s, d) { /*String*/ @@ -589,12 +589,12 @@ } throw new xap.taghandling.AttributeConversionException(s, errorString, null); }; -/** - * @public - * @return {Component} - *(String s, ClientSession session, Class componentClass, - * String logicalClassName) - * @throws xap.taghandling.AttributeConversionException +/** + * @public + * @return {Component} + *(String s, ClientSession session, Class componentClass, + * String logicalClassName) + * @throws xap.taghandling.AttributeConversionException **/ xap.taghandling.AttributeConverter.toComponent = function (s, session, componentClass, logicalClassName) { /*String*/ @@ -627,25 +627,25 @@ } throw new xap.taghandling.AttributeConversionException(s, errorString, null); }; -/** - * Returns either a Color, Style.TRANSPARENT_COLOR, or a gradient - * This must take a session so it can look up a gradient reference - * @param s The String to convert. - * @param session{ClientSession} The current ClientSession. - * @return A Color, gradient on Style.TRANSPARENT_COLOR. - * - * @public - * @return {Object} - * - * @throws xap.taghandling.AttributeConversionException +/** + * Returns either a Color, Style.TRANSPARENT_COLOR, or a gradient + * This must take a session so it can look up a gradient reference + * @param s The String to convert. + * @param session{ClientSession} The current ClientSession. + * @return A Color, gradient on Style.TRANSPARENT_COLOR. + * + * @public + * @return {Object} + * + * @throws xap.taghandling.AttributeConversionException **/ xap.taghandling.AttributeConverter.toPattern = function (s, session) { if (xap.taghandling.isEmptyOrNull(s)) { throw new xap.taghandling.AttributeConversionException(s, "pattern", null); - } - + } + //do this because toCOlor(transparent) returns null - if (s.equals("transparent")) { + if (s == "transparent") { return Style.TRANSPARENT_COLOR; } try { @@ -669,19 +669,19 @@ } throw new xap.taghandling.AttributeConversionException(s, "pattern", null); }; -/** - * Converts a comma-separated string into an array of string. - * @param s The String to convert. - * @param number The length of the array to return. - * @param validValues An array of acceptable strings, or null for all strings - * @return A String[] of length number. - * @throws xap.taghandling.AttributeConversionException - * - * @public - * @return {String[]} - * - * @param s, int number, String[] validValues{String} - * @throws xap.taghandling.AttributeConversionException +/** + * Converts a comma-separated string into an array of string. + * @param s The String to convert. + * @param number The length of the array to return. + * @param validValues An array of acceptable strings, or null for all strings + * @return A String[] of length number. + * @throws xap.taghandling.AttributeConversionException + * + * @public + * @return {String[]} + * + * @param s, int number, String[] validValues{String} + * @throws xap.taghandling.AttributeConversionException **/ xap.taghandling.AttributeConverter.toStrings = function (s, number, validValues) { if (xap.taghandling.isEmptyOrNull(s)) { @@ -711,7 +711,7 @@ /*boolean*/ var wasValid = false; for (var j = 0; j < validValues.length && !wasValid; j++) { - if (strings[i].equals(validValues[j])) { + if (strings[i] == validValues[j]) { wasValid = true; } } @@ -722,16 +722,16 @@ } return strings; }; -/** - * Returns true if the string is an empty string - * or is null, does not perform a trim first. - * @param s The string to check. - * @return True if the string is null or equals "". - * - * @public - * @return {boolean} - * - * @param s{String} +/** + * Returns true if the string is an empty string + * or is null, does not perform a trim first. + * @param s The string to check. + * @return True if the string is null or equals "". + * + * @public + * @return {boolean} + * + * @param s{String} **/ xap.taghandling.AttributeConverter.isEmptyOrNull = function (s) { if (s == null || s == "" ) { Modified: incubator/xap/trunk/src/xap/taghandling/plugin.xml URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/taghandling/plugin.xml?view=diff&rev=451723&r1=451722&r2=451723 ============================================================================== --- incubator/xap/trunk/src/xap/taghandling/plugin.xml (original) +++ incubator/xap/trunk/src/xap/taghandling/plugin.xml Sun Oct 1 00:23:49 2006 @@ -16,6 +16,12 @@ + + + + + Added: incubator/xap/trunk/src/xap/xml/XmlTokens.js URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/xml/XmlTokens.js?view=auto&rev=451723 ============================================================================== --- incubator/xap/trunk/src/xap/xml/XmlTokens.js (added) +++ incubator/xap/trunk/src/xap/xml/XmlTokens.js Sun Oct 1 00:23:49 2006 @@ -0,0 +1,1098 @@ +/* + * Copyright 2006 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + + +/** + * + * Interface containing all the possible XML token + * names and some of the XML token values that Nexaweb supports. + * This is provided to support plug-in writers who should + * re-use Nexaweb XML tokens whenever possible. + * + * TODO this is incomplete + * + * @author James Margaris + * + */ +xap.xml.XmlTokens = function () { +}; +Xap.setupClassAsSubclassOf("xap.xml.XmlTokens", "Object"); +/*public static final String*/ +xap.xml.XmlTokens.START = "start", xap.xml.XmlTokens.END = "end", xap.xml.XmlTokens.CENTER = "center"; +/** + * @public + **/ +xap.xml.XmlTokens.IMAGE_SELECTED = "imgSelected"; +/** + * @public + **/ +xap.xml.XmlTokens.IMAGE_ROLLOVER_SELECTED = "imgOverSelected"; +/** + * @public + **/ +xap.xml.XmlTokens.IMAGE_PRESSED_SELECTED = "imgPressedSelected"; +/** + * @public + **/ +xap.xml.XmlTokens.IMAGE_DISABLED_SELECTED = "imgDisabledSelected"; +/*public static String*/ +xap.xml.XmlTokens.QUICK_EDIT = "quickEdit"; +/*public static String*/ +xap.xml.XmlTokens.ON_FIRST_EXPAND = "onFirstExpand"; +/*public static String*/ +xap.xml.XmlTokens.ON_EXPAND = "onExpand"; +/*public static String*/ +xap.xml.XmlTokens.ON_COLLAPSE = "onCollapse"; +/*public static String*/ +xap.xml.XmlTokens.ON_EDIT = "onEdit"; +/*public static String*/ +xap.xml.XmlTokens.SELECTION_MODE = "selectionMode"; +/*public static String*/ +xap.xml.XmlTokens.SINGLE_ROW = "singleRow"; +/*public static String*/ +xap.xml.XmlTokens.SINGLE_CELL = "singleCell"; +/*public static String*/ +xap.xml.XmlTokens.MULTI_CELL = "multiCell"; +/*public static String*/ +xap.xml.XmlTokens.MULTI_ROW = "multiRow"; +/*public static String*/ +xap.xml.XmlTokens.SINGLE_COLUMN = "singleColumn"; +/*public static String*/ +xap.xml.XmlTokens.MULTI_COLUMN = "multiColumn"; +/*public static String*/ +xap.xml.XmlTokens.NONE = "none"; +/*public static String*/ +xap.xml.XmlTokens.MENU_BAR_ITEM = "menuBarItem"; +/*public static String*/ +xap.xml.XmlTokens.TOOLBAR_BUTTON = "toolBarButton"; +/** + * @public + **/ +xap.xml.XmlTokens.ON_DRAG_START = "onDragStart"; +/** + * @public + **/ +xap.xml.XmlTokens.ON_DRAG_END = "onDragEnd"; +/** + * @public + **/ +xap.xml.XmlTokens.ON_DRAG_DROP = "onDragDrop"; +/** + * @public + **/ +xap.xml.XmlTokens.ON_NATIVE_DROP = "onNativeDrop"; +/** + * @public + **/ +xap.xml.XmlTokens.ON_NATIVE_DRAG_ENTER = "onNativeDragEnter"; +/** + * @public + **/ +xap.xml.XmlTokens.ON_MOUSE_OVER = "onMouseOver"; +/** + * @public + **/ +xap.xml.XmlTokens.ON_MOUSE_OUT = "onMouseOut"; +/** + * @public + **/ +xap.xml.XmlTokens.ON_MOUSE_DOWN = "onMouseDown"; +/** + * @public + **/ +xap.xml.XmlTokens.ON_MOUSE_UP = "onMouseUp"; +/** + * @public + **/ +xap.xml.XmlTokens.ON_MOUSE_DB_CLICK = "onDoubleClick"; +/** + * @public + **/ +xap.xml.XmlTokens.ON_MOUSE_MOVE = "onMouseMove"; +/** + * @public + **/ +xap.xml.XmlTokens.ON_MOUSE_DRAG = "onMouseDrag"; +/** + * @public + **/ +xap.xml.XmlTokens.ON_ACTIVE_LOST = "onActiveLost"; +/** + * @public + **/ +xap.xml.XmlTokens.ON_ACTIVE_GAINED = "onActiveGained"; +/** + * @public + **/ +xap.xml.XmlTokens.ON_BEFORE_ACTIVE_LOST = "onBeforeActiveLost"; +/** + * @public + **/ +xap.xml.XmlTokens.ON_KEY_DOWN = "onKeyDown"; +/** + * @public + **/ +xap.xml.XmlTokens.ON_KEY_UP = "onKeyUp"; +/** + * @public + **/ +xap.xml.XmlTokens.ON_KEY_PRESS = "onKeyChar"; +/** + * @public + **/ +xap.xml.XmlTokens.ON_CONTEXT_MENU = "onContextMenu"; +/*public static final String*/ +xap.xml.XmlTokens.ON_WINDOW_CLOSE = "onClose"; +/*public static final String*/ +xap.xml.XmlTokens.ON_WINDOW_CLOSING = "onClosing"; +/** + * @public + **/ +xap.xml.XmlTokens.ON_WINDOW_MINIMZE = "onMinimize"; +/*public static final String*/ +xap.xml.XmlTokens.ON_WINDOW_MINIMIZING = "onMinimizing"; +/*public static final String*/ +xap.xml.XmlTokens.ON_WINDOW_MAXIMIZE = "onMaximize"; +/** + * @public + **/ +xap.xml.XmlTokens.ON_WINDOW_MAXIMIZING = "onMaximizing"; +/** + * @public + **/ +xap.xml.XmlTokens.ON_WINDOW_RESTORE = "onRestore"; +/** + * @public + **/ +xap.xml.XmlTokens.ON_WINDOW_RESTORING = "onRestoring"; +/*public static final String*/ +xap.xml.XmlTokens.ON_TEXT_CHANGE = "onTextChange"; +/*public static final String*/ +xap.xml.XmlTokens.ON_SELECTION_CHANGE = "onSelectionChange"; +/** + * @public + **/ +xap.xml.XmlTokens.X = "x"; +/** + * @public + **/ +xap.xml.XmlTokens.Y = "y"; +/** + * @public + **/ +xap.xml.XmlTokens.WIDTH = "width"; +/** + * @public + **/ +xap.xml.XmlTokens.HEIGHT = "height"; +/** + * @public + **/ +xap.xml.XmlTokens.BACKGROUND = "bgColor"; +/** + * @public + **/ +xap.xml.XmlTokens.FOREGROUND = "fontColor"; +/** + * @public + **/ +xap.xml.XmlTokens.FOREGROUND_DISABLED = "fontColorDisabled"; +/** + * @public + **/ +xap.xml.XmlTokens.VISIBLE = "visible"; +/** + * @public + **/ +xap.xml.XmlTokens.FOCUSED = "focused"; +/** + * @public + **/ +xap.xml.XmlTokens.ENABLED = "enabled"; +/** + * @public + **/ +xap.xml.XmlTokens.CURSOR = "cursor"; +/*public static final String*/ +xap.xml.XmlTokens.TRANSPARENT = "transparent"; +/*public static final String[]*/ +xap.xml.XmlTokens.CURSOR_NAMES = ["hand", "crosshair", "eastResize", "westResize", "southResize", "northResize", "northeastResize", "northwestResize", "southeastResize", "southwestResize", "text", "move", "default", "wait"]; +/*public static final String[]*/ +xap.xml.XmlTokens.COLOR_NAMES = ["black", "blue", "cyan", "darkGray", "gray", "green", "lightGray", "magenta", "orange", "pink", "red", "white", "yellow", "activeBorder", "activeCaption", "buttonFace", "captionText", "inactiveBorder", "inactiveCaptionText", "buttonHighlight", "infoText", "infoBackground", "menu", "menuText", "threeDDarkShadow", "background", "scrollBar", "highlightText", "highlight", "window", "windowText", "buttonShadow", "inactiveCaption"]; +/*public static String*/ +xap.xml.XmlTokens.ALT_BACKGROUND = "altBgColor"; +/*public static String*/ +xap.xml.XmlTokens.ALT_FOREGROUND = "altFontColor"; +/*public static String*/ +xap.xml.XmlTokens.RESIZE_COLUMNS = "resizeColumns"; +/*public static String*/ +xap.xml.XmlTokens.SORT_TYPE = "sortType"; +/*public static String*/ +xap.xml.XmlTokens.SORT_STABLE = "stable"; +/*public static String*/ +xap.xml.XmlTokens.SORT_UNSTABLE = "unstable"; +/*public static String*/ +xap.xml.XmlTokens.KEY_MATCH_RESET = "keyMatchReset"; +/*public static String*/ +xap.xml.XmlTokens.HORIZONTAL_LINES = "horizontalLines"; +/*public static String*/ +xap.xml.XmlTokens.VERTICAL_LINES = "verticalLines"; +/*public static String*/ +xap.xml.XmlTokens.SWAP_COLUMNS = "swapColumns"; +/*public static String*/ +xap.xml.XmlTokens.ROW_HEIGHT = "rowHeight"; +/*public static final String*/ +xap.xml.XmlTokens.ASCENDING_CLASSNAME = ".sortAscending"; +/*public static final String*/ +xap.xml.XmlTokens.DESCENDING_CLASSNAME = ".sortDescending"; +/*public static final String*/ +xap.xml.XmlTokens.EDITOR = "editor"; +/** + * @public + **/ +xap.xml.XmlTokens.MODAL = "modal"; +/*public static final String*/ +xap.xml.XmlTokens.GRID_COLUMNS = "columns"; +/*public static final String*/ +xap.xml.XmlTokens.GRID_EVENLY_SPACE = "evenlySpace"; + +//accessKey: +/*public static final String*/ +xap.xml.XmlTokens.ACCESS_KEY = "accessKey"; + +//imgHint: +/*public static final String*/ +xap.xml.XmlTokens.IMG_HINT = "imgHint"; +/*public static final String*/ +xap.xml.XmlTokens.IMG_WIDTH = "imgWidth"; +/** + * @public + **/ +xap.xml.XmlTokens.IMG_HEIGHT = "imgHeight"; + +// tristate (NOT_SET means automatic) controls tag-parsing: +/*public static final String*/ +xap.xml.XmlTokens.RICHTEXT = "richText"; + +//tristate (NOT_SET means automatic) controls autowrap: +/*public static final String*/ +xap.xml.XmlTokens.AUTOWRAP = "autoWrap"; +/** + * @public + **/ +xap.xml.XmlTokens.SELECTED_FONT_COLOR = "selectedFontColor"; +/** + * @public + **/ +xap.xml.XmlTokens.SELECTED_BACKGROUND = "selectedBackgroundColor"; +/*public static final String*/ +xap.xml.XmlTokens.TEXT_SELECTION_POLICY = "textSelectionPolicy"; +/*public static final String*/ +xap.xml.XmlTokens.FOCUS_SELECTION_POLICY = "focusSelectionPolicy"; +/*public static final String*/ +xap.xml.XmlTokens.INPUT_CHARSETS = "inputCharsets"; +/*public static final String*/ +xap.xml.XmlTokens.INPUT_LOCALE = "inputLocale"; +/*public static final String*/ +xap.xml.XmlTokens.LIST_ITEM = "listItem"; +/*public static final String*/ +xap.xml.XmlTokens.MENU_PARENT = "menuParent"; +/*public static final String*/ +xap.xml.XmlTokens.LABEL = "label"; +/** + * @public + **/ +xap.xml.XmlTokens.TOOLTIP = "tooltip"; +/** + * @public + **/ +xap.xml.XmlTokens.POPUP = "popup"; +/*public static final String*/ +xap.xml.XmlTokens.BORDER_WIDTH = "borderWidth"; +/*public static final String*/ +xap.xml.XmlTokens.BORDER_STYLE = "borderStyle"; +/*public static final String*/ +xap.xml.XmlTokens.BORDER_COLOR = "borderColor"; +/*public static final String*/ +xap.xml.XmlTokens.BORDER_CORNER = "borderCorner"; +/*public static final String*/ +xap.xml.XmlTokens.MARGIN = "margin"; +/*public static final String*/ +xap.xml.XmlTokens.SPLIT_POSITION = "splitPosition"; +/*public static final String*/ +xap.xml.XmlTokens.SPLIT_BAR = "splitBar"; +/*public static final String*/ +xap.xml.XmlTokens.SPLIT_BAR_VERTICAL = ".splitBarVertical"; +/*public static final String*/ +xap.xml.XmlTokens.SPLIT_BAR_HORIZONTAL = ".splitBarHorizontal"; +/*public static final String*/ +xap.xml.XmlTokens.SPLIT_BAR_LOCK_TOP = ".splitBarLockTop"; +/*public static final String*/ +xap.xml.XmlTokens.SPLIT_BAR_LOCK_BOTTOM = ".splitBarLockBottom"; +/*public static final String*/ +xap.xml.XmlTokens.SPLIT_BAR_LOCK_LEFT = ".splitBarLockLeft"; +/*public static final String*/ +xap.xml.XmlTokens.SPLIT_BAR_LOCK_RIGHT = ".splitBarLockRight"; +/*public static final String*/ +xap.xml.XmlTokens.TAB_TOP = "tabTop"; +/*public static final String*/ +xap.xml.XmlTokens.TAB_BOTTOM = "tabBottom"; +/*public static final String*/ +xap.xml.XmlTokens.TAB_LEFT = "tabLeft"; +/*public static final String*/ +xap.xml.XmlTokens.TAB_RIGHT = "tabRight"; +/*public static final String*/ +xap.xml.XmlTokens.LEFT = "left"; +/*public static final String*/ +xap.xml.XmlTokens.RIGHT = "right"; +/*public static final String*/ +xap.xml.XmlTokens.TOP = "top"; +/*public static final String*/ +xap.xml.XmlTokens.BOTTOM = "bottom"; +/*public static final String*/ +xap.xml.XmlTokens.TAB_BOX_TOP = "tabBoxTop"; +/*public static final String*/ +xap.xml.XmlTokens.TAB_BOX_BOTTOM = "tabBoxBottom"; +/*public static final String*/ +xap.xml.XmlTokens.TAB_BOX_LEFT = "tabBoxLeft"; +/*public static final String*/ +xap.xml.XmlTokens.TAB_BOX_RIGHT = "tabBoxRight"; +/*public static final String*/ +xap.xml.XmlTokens.TAB_GROWTH = "tabGrowth"; +/*public static final String*/ +xap.xml.XmlTokens.TAB_OVERLAP = "tabOverlap"; +/*public static final String*/ +xap.xml.XmlTokens.TAB_PLACEMENT = "tabPlacement"; +/** + * @public + **/ +xap.xml.XmlTokens.TAB_ALIGNMENT = "tabAlignment"; +/*public static final String[]*/ +with (xap.xml.XmlTokens) { + xap.xml.XmlTokens.TAB_PLACEMENT_NAMES = [TOP, RIGHT, BOTTOM, LEFT]; + /*public static final String[]*/ + xap.xml.XmlTokens.TAB_ALIGNMENT_NAMES = [START, END]; +} +/*public static final */ +xap.xml.XmlTokens.HORIZONTAL_SEPARATOR = "horizontalSeparator"; +/*public static final String*/ +xap.xml.XmlTokens.EXPANDED = "expanded"; +/*public static final String*/ +xap.xml.XmlTokens.ALIGN = "align"; +/*public static final String*/ +xap.xml.XmlTokens.VERTICAL_GAP = "gapVertical"; +/*public static final String*/ +xap.xml.XmlTokens.HORIZONTAL_GAP = "gapHorizontal"; +/*public static final String*/ +xap.xml.XmlTokens.LINE_COLOR = "lineColor"; +/** + * @public + **/ +xap.xml.XmlTokens.BACKGROUND_IMAGE = "imgBackground"; +/** + * @public + **/ +xap.xml.XmlTokens.TAB_ORDER = "tabOrder"; +/** + * @public + **/ +xap.xml.XmlTokens.IGNORE_EVENTS = "ignoreEvents"; +/** + * @public + **/ +xap.xml.XmlTokens.EXTERNALLY_DROPPABLE = "nativeDroppable"; +/** + * @public + **/ +xap.xml.XmlTokens.CAPTION = "caption"; +/** + * @public + **/ +xap.xml.XmlTokens.TITLE_POSITION = "captionPosition"; +/** + * @public + **/ +xap.xml.XmlTokens.TITLE_ALIGNMENT = "captionAlignment"; +/*public static final String*/ +xap.xml.XmlTokens.QUESTION_IMAGE_CLASS = ".questionImg"; +/*public static final String*/ +xap.xml.XmlTokens.WARNING_IMAGE_CLASS = ".warningImg"; +/*public static final String*/ +xap.xml.XmlTokens.ERROR_IMAGE_CLASS = ".errorImg"; +/*public static final String*/ +xap.xml.XmlTokens.INFO_IMAGE_CLASS = ".informationImg"; +/*public static final String*/ +xap.xml.XmlTokens.PLAIN_IMAGE_CLASS = ".plainImg"; +/** + * @public + **/ +xap.xml.XmlTokens.MESSAGE = "message"; +/*public static final String*/ +xap.xml.XmlTokens.TYPE = "type"; + +//boolean, default false, but editable forces true: +/*public static final String*/ +xap.xml.XmlTokens.SELECTABLE = "selectable"; + +//text placement relative to icon: +/*public static final String*/ +xap.xml.XmlTokens.TEXT_PLACEMENT_HORIZONTAL = "textPlacementHorizontal"; +/*public static final String*/ +xap.xml.XmlTokens.TEXT_PLACEMENT_VERTICAL = "textPlacementVertical"; + +//initial alignment of rich text (& alignment of icon): +/*public static final String*/ +xap.xml.XmlTokens.ALIGN_HORIZONTAL = "alignHorizontal"; +/*public static final String*/ +xap.xml.XmlTokens.ALIGN_VERTICAL = "alignVertical"; + +//shortcut: +/*public static final String*/ +xap.xml.XmlTokens.SHORTCUT = "shortcut"; +/*public static final String*/ +xap.xml.XmlTokens.SHORTCUT_TEXT = "shortcutText"; + +//cursor & text selection: +/*public static final String*/ +xap.xml.XmlTokens.CURSOR_INDEX = "cursorIndex"; // sets cursor index +/*public static final String*/ +xap.xml.XmlTokens.END_SELECT_INDEX = "endSelectIndex"; // completes selection +/*public static final String*/ +xap.xml.XmlTokens.MAX_LENGTH = "maxLength"; +/*public static final String*/ +xap.xml.XmlTokens.SELECTED_TEXT = "selectedText"; +/*public static final String*/ +xap.xml.XmlTokens.SELECTED_STYLE = "selectedStyle"; +/*public static final String*/ +xap.xml.XmlTokens.START_TEXT_POSITION = "startTextPosition"; +/*public static final String*/ +xap.xml.XmlTokens.END_TEXT_POSITION = "endSelectTextPosition"; +/*public static final String[]*/ +with (xap.xml.XmlTokens) { + xap.xml.XmlTokens.GRID_ALIGN_NAMES = [START, CENTER, END, "fill"]; +} + +//TODO all these names are retarded +/*public static final String*/ +xap.xml.XmlTokens.COLUMN_SPAN = "columnSpan"; +/*public static final String*/ +xap.xml.XmlTokens.ROW_SPAN = "rowSpan"; +/*public static final String*/ +xap.xml.XmlTokens.VALIGN = "vAlign"; +/** + * @public + **/ +xap.xml.XmlTokens.HALIGN = "hAlign"; +/*public static final String*/ +xap.xml.XmlTokens.V_GRAB_SPACE = "vGrabSpace"; +/*public static final String*/ +xap.xml.XmlTokens.H_GRAB_SPACE = "hGrabSpace"; +/*public static final String*/ +xap.xml.XmlTokens.H_INDENT = "hIndent"; +/*public static final String*/ +xap.xml.XmlTokens.STOP = "stop"; +/*public static final String*/ +xap.xml.XmlTokens.STOP_OFFSET = "offset"; +/*public static final String*/ +xap.xml.XmlTokens.STOP_COLOR = "stop-color"; +/*public static final String*/ +xap.xml.XmlTokens.X1 = "x1"; +/*public static final String*/ +xap.xml.XmlTokens.X2 = "x2"; +/*public static final String*/ +xap.xml.XmlTokens.Y1 = "y1"; +/*public static final String*/ +xap.xml.XmlTokens.Y2 = "y2"; +/** + * @public + **/ +xap.xml.XmlTokens.IMAGE_MAX = "imgMax"; +/** + * @public + **/ +xap.xml.XmlTokens.IMAGE_MIN = "imgMin"; +/** + * @public + **/ +xap.xml.XmlTokens.IMAGE_CLOSE = "imgClose"; +/** + * @public + **/ +xap.xml.XmlTokens.IMAGE_RESTORE = "imgRestore"; +/** + * @public + **/ +xap.xml.XmlTokens.IMAGE_ICON = "imgIcon"; +/** + * @public + **/ +xap.xml.XmlTokens.TITLE = "title"; +/** + * @public + **/ +xap.xml.XmlTokens.MINIMIZABLE = "minimizable"; +/** + * @public + **/ +xap.xml.XmlTokens.MAXIMIZABLE = "maximizable"; +/** + * @public + **/ +xap.xml.XmlTokens.CLOSABLE = "closable"; +/** + * @public + **/ +xap.xml.XmlTokens.MINIMIZED = "minimized"; +/** + * @public + **/ +xap.xml.XmlTokens.MAXIMIZED = "maximized"; +/** + * @public + **/ +xap.xml.XmlTokens.RESIZABLE = "resizable"; +/** + * @public + **/ +xap.xml.XmlTokens.CENTERED = "centered"; +/** + * @public + **/ +xap.xml.XmlTokens.SHOW_TITLE_BAR = "showTitleBar"; +/*public static final String*/ +xap.xml.XmlTokens.BORDER_POSITION = "borderPosition"; +/*public static final String*/ +xap.xml.XmlTokens.BORDER_POSITION_WEST = "west"; +/*public static final String*/ +xap.xml.XmlTokens.BORDER_POSITION_EAST = "east"; +/*public static final String*/ +xap.xml.XmlTokens.BORDER_POSITION_CENTER = CENTER; +/*public static final String*/ +xap.xml.XmlTokens.BORDER_POSITION_NORTH = "north"; +/*public static final String*/ +xap.xml.XmlTokens.BORDER_POSITION_SOUTH = "south"; +/*public static final String*/ +xap.xml.XmlTokens.FLEX = "flex"; +/*public static final String*/ +xap.xml.XmlTokens.PACK = "pack"; +/*public static final String[]*/ +with (xap.xml.XmlTokens) { + xap.xml.XmlTokens.PACK_NAMES = [START, CENTER, END]; +} +/*public static final String[]*/ +with (xap.xml.XmlTokens) { + xap.xml.XmlTokens.BOX_ALIGN_NAMES = [START, CENTER, END, "stretch"]; +} +/*public static final String*/ +xap.xml.XmlTokens.SHOW = "show"; +/*public static final String*/ +xap.xml.XmlTokens.HEADER = "header"; +/*public static final String*/ +xap.xml.XmlTokens.TITLE_BACKGROUND = "titleBgColor"; +/*public static final String*/ +xap.xml.XmlTokens.TITLE_FOREGROUND = "titleFontColor"; +/*public static final String*/ +xap.xml.XmlTokens.CLASS_CLOSE_BUTTON = ".closeButton"; +/*public static final String*/ +xap.xml.XmlTokens.CLASS_MIN_BUTTON = ".minButton"; +/*public static final String*/ +xap.xml.XmlTokens.CLASS_MAX_BUTTON = ".maxButton"; +/*public static final String*/ +xap.xml.XmlTokens.CLASS_TITLE_BAR = ".titleBar"; +/** + * "orientation" * + * @public + **/ +xap.xml.XmlTokens.ORIENTATION = "orientation"; +/** + * "horizontal" + * + * @public + **/ +xap.xml.XmlTokens.HORIZONTAL = "horizontal"; +/** + * "vertical" + * + * @public + **/ +xap.xml.XmlTokens.VERTICAL = "vertical"; +/** + * An array of "horizontal" and "vertical" + * + */ +with (xap.xml.XmlTokens) { + xap.xml.XmlTokens.ORIENTATION_NAMES = [HORIZONTAL, VERTICAL]; +} +/** + * "id" + * + * @public + **/ +xap.xml.XmlTokens.ID = "id"; +/** + * "class" + * + * @public + **/ +xap.xml.XmlTokens.CLASSNAME = "class"; +/** + * "name" + * + * @public + **/ +xap.xml.XmlTokens.NAME = "name"; +/** + * "true" + * + * @public + **/ +xap.xml.XmlTokens.TRUE = "true"; +/** + * "false" + * + * @public + **/ +xap.xml.XmlTokens.FALSE = "false"; +/** + * "selected" + * + * @public + +**/ +xap.xml.XmlTokens.SELECTED = "selected"; +/** + * "editing" + *public static String*/ +xap.xml.XmlTokens.EDITING = "editing"; +/** + * "group" + +**/ +xap.xml.XmlTokens.GROUP = "group"; +/** + * "text" + * + * @public + +**/ +xap.xml.XmlTokens.TEXT = "text"; +/** + * "value" + * + * @public + +**/ +xap.xml.XmlTokens.VALUE = "value"; +/** + * "sortValue" + +**/ +xap.xml.XmlTokens.SORT_VALUE = "sortValue"; +/** + * "draggable" + +**/ +xap.xml.XmlTokens.DRAGGABLE = "draggable"; +/** + * "droppable" + +**/ +xap.xml.XmlTokens.DROPPABLE = "droppable"; +/** + * @public + +**/ +xap.xml.XmlTokens.SCROLL_SCROLLBUTTON = "scrollButton"; +/** + * @public + +**/ +xap.xml.XmlTokens.SCROLL_THUMBBUTTON = "thumbButton"; +/** + * "fontName" + * + * @public + +**/ +xap.xml.XmlTokens.FONT_NAME = "fontName"; +/** + * "fontBold" + * + * @public + +**/ +xap.xml.XmlTokens.FONT_BOLD = "fontBold"; +/** + * "fontItalic" + * + * @public + +**/ +xap.xml.XmlTokens.FONT_ITALIC = "fontItalic"; +/** + * "fontUnderline" + * + * @public + +**/ +xap.xml.XmlTokens.FONT_UNDERLINE = "fontUnderline"; +/** + * "fontSize" + * + * @public + +**/ +xap.xml.XmlTokens.FONT_SIZE = "fontSize"; +/** + * "fontSize" + * + * @public + +**/ +xap.xml.XmlTokens.FONT_ANTI_ALIAS = "fontAntiAlias"; +/** + * "editable" + * + * @public + +**/ +xap.xml.XmlTokens.EDITABLE = "editable"; +/** + * "resizeable" + * + * @public + +**/ +xap.xml.XmlTokens.RESIZEABLE = "resizeable"; +/** + * "sortable" + * + * @public + +**/ +xap.xml.XmlTokens.SORTABLE = "sortable"; +/** + * "ascending" + * + * @public + +**/ +xap.xml.XmlTokens.ASCENDING = "ascending"; +/** + * "descending" + * + * @public + +**/ +xap.xml.XmlTokens.DESCENDING = "descending"; +/** + * "sort" + * + * @public + +**/ +xap.xml.XmlTokens.SORT = "sort"; +/** + * "sortPriority" + * + * @public + +**/ +xap.xml.XmlTokens.SORT_PRIORITY = "sortPriority"; +/** + * "dataType" + * + * @public + +**/ +xap.xml.XmlTokens.DATA_TYPE = "dataType"; +/** + * "number" + * + * @public + +**/ +xap.xml.XmlTokens.NUMBER = "number"; +/** + * "string" + * + * @public + +**/ +xap.xml.XmlTokens.STRING = "string"; +/** + * "treeLineColor" + * + * @public + +**/ +xap.xml.XmlTokens.TREE_LINE_COLOR = "treeLines"; +/** + * "highlightFontColor" + * + * @public + +**/ +xap.xml.XmlTokens.HIGHLIGHT_FOREGROUND = "highlightFontColor"; +/** + * "highlightBgColor" + * + * @public + +**/ +xap.xml.XmlTokens.HIGHLIGHT_BACKGROUND = "highlightBgColor"; + + + + + + + +//it's bad we have to have these here, kind of breaks the plug-in arch +//to some degree +/** + * "menuItem" + * + * @public + +**/ +xap.xml.XmlTokens.MENUITEM = "menuItem"; +/** + * "popupMenu" + * + * @public + +**/ +xap.xml.XmlTokens.POPUPMENU = "popupMenu"; +/** + * "cell" + * + * @public + +**/ +xap.xml.XmlTokens.TABLE_CELL = "cell"; +/** + * "scrollBar" + * + * @public + +**/ +xap.xml.XmlTokens.SCROLLBAR = "scrollBar"; +/** + * "menuBar" + * + * @public + +**/ +xap.xml.XmlTokens.MENUBAR = "menuBar"; +/** + * "toolBar" + * + * @public + +**/ +xap.xml.XmlTokens.TOOLBAR = "toolBar"; +/** + * "button" + * + * @public + +**/ +xap.xml.XmlTokens.BUTTON = "button"; +/** + * "panel" + * + * @public + +**/ +xap.xml.XmlTokens.PANEL = "panel"; +/** + * "default" + * + * @public + +**/ +xap.xml.XmlTokens.DEFAULT = "default"; +/** + * "imgOver" + * + * @public + +**/ +xap.xml.XmlTokens.IMAGE_ROLLOVER = "imgOver"; +/** + * "imgPressed" + * + * @public + +**/ +xap.xml.XmlTokens.IMAGE_PRESSED = "imgPressed"; +/** + * "img" + * + * @public + +**/ +xap.xml.XmlTokens.IMAGE = "img"; +/** + * "imgDisabled" + * + * @public + +**/ +xap.xml.XmlTokens.IMAGE_DISABLED = "imgDisabled"; +/** + * "imgHint" + * + * @public + +**/ +xap.xml.XmlTokens.IMAGE_HINT = "imgHint"; +/** + * "imgOpen" + * + * @public + +**/ +xap.xml.XmlTokens.TABLE_OPEN_IMAGE = "imgOpen"; +/** + * "imgClosed" + * + * @public + +**/ +xap.xml.XmlTokens.TABLE_CLOSED_IMAGE = "imgClosed"; +/** + * "imgLeaf" + * + * @public + +**/ +xap.xml.XmlTokens.TABLE_LEAF_IMAGE = "imgLeaf"; +/** + * old don't use, deprecated in favor of posVertical + * "verticalPos" + * + * @public + +**/ +xap.xml.XmlTokens.VERTICAL_POS = "verticalPos"; +/** + * old don't use, deprecated in favor of posHorizontal + * "horizontalPos" + * + * @public + +**/ +xap.xml.XmlTokens.HORIZONTAL_POS = "horizontalPos"; +/** + * "scrollPosVertical" + * + * @public + +**/ +xap.xml.XmlTokens.POS_VERTICAL = "scrollPosVertical"; +/** + * "posHorizontal" + * + * @public + +**/ +xap.xml.XmlTokens.POS_HORIZONTAL = "scrollPosHorizontal"; + + + +// label including rich text: +/** + * "posMin" + * + * @public + +**/ +xap.xml.XmlTokens.SLIDER_MIN = "posMin"; +/** + * "posMax" + * + * @public + +**/ +xap.xml.XmlTokens.SLIDER_MAX = "posMax"; +/** + * "pos" + * + * @public + +**/ +xap.xml.XmlTokens.SLIDER_POS = "pos"; +/** + * "increment" + * + * @public + +**/ +xap.xml.XmlTokens.SLIDER_INCREMENT = "increment"; +/** + * "pageIncrement" + * + * @public + +**/ +xap.xml.XmlTokens.SLIDER_PAGE_INCREMENT = "pageIncrement"; +/** + * "onStateChange" + * + * @public + +**/ +xap.xml.XmlTokens.ON_STATE_CHANGE = "onStateChange"; +/** + * "onPositionChange" + * + * @public + +**/ +xap.xml.XmlTokens.ON_POSITION_CHANGE = "onPositionChange"; +/** + * "onSelect" + * + * @public + +**/ +xap.xml.XmlTokens.ON_SELECT = "onSelect"; +/** + * "onCommand" + **/ +xap.xml.XmlTokens.ON_COMMAND = "onCommand"; +/*public static final String[]*/ +with (xap.xml.XmlTokens) { + // onCreate is from UiCOntentHandler + // onLoad is from McoNamespaceHandler + xap.xml.XmlTokens.ON_EVENT_NAMES = + [ + ON_BEFORE_ACTIVE_LOST, ON_COLLAPSE, ON_COMMAND, + ON_CONTEXT_MENU, "onCreate", ON_DRAG_DROP, + ON_DRAG_END, ON_DRAG_START, ON_EXPAND, ON_EDIT, + ON_FIRST_EXPAND, ON_ACTIVE_LOST, ON_ACTIVE_GAINED, + ON_KEY_PRESS, ON_KEY_DOWN, ON_KEY_UP, "onLoad", + ON_MOUSE_DOWN, ON_MOUSE_DB_CLICK, ON_MOUSE_DRAG, + ON_MOUSE_MOVE, ON_MOUSE_OUT, ON_MOUSE_OVER, + ON_MOUSE_UP, ON_NATIVE_DRAG_ENTER, ON_NATIVE_DROP, + ON_SELECT, ON_POSITION_CHANGE, ON_STATE_CHANGE, + ON_TEXT_CHANGE, ON_WINDOW_CLOSE, ON_WINDOW_CLOSING + ] ; +} +