You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beehive.apache.org by do...@apache.org on 2005/10/19 17:31:56 UTC

svn commit: r326581 [5/9] - in /beehive/trunk/netui: ant/ src/bootstrap/org/apache/beehive/netui/tools/tld/xdoclet/ src/jar-assembly/ src/pageflow/org/apache/beehive/netui/pageflow/ src/simple-tags/ src/simple-tags/org/ src/simple-tags/org/apache/ src/...

Added: beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/html/HtmlConstants.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/html/HtmlConstants.java?rev=326581&view=auto
==============================================================================
--- beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/html/HtmlConstants.java (added)
+++ beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/html/HtmlConstants.java Wed Oct 19 08:29:22 2005
@@ -0,0 +1,619 @@
+/*
+ * Copyright 2004 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.
+ *
+ * $Header:$
+ */
+package org.apache.beehive.netui.simpletags.html;
+
+public interface HtmlConstants
+{
+    //************************ The IHtmlCore properties  *********************************
+    /**
+     * The name of the <code>style</code> attribute.
+     */
+    static final String STYLE = "style";
+
+    /**
+     * The name of the <code>class</code> attribute.
+     */
+    static final String CLASS = "class";
+
+    /**
+     * The name of the <code>id</code> attribute.
+     */
+    static final String ID = "id";
+
+    /**
+     * The name of the <code>title</code> attribute.
+     */
+    static final String TITLE = "title";
+
+    //************************ The IHtmlI18n properties  *********************************
+    /**
+     * The name of the <code>dir</code> attribute.
+     */
+    static final String DIR = "dir";
+
+    /**
+     * The name of the <code>lang</code> attribute.
+     */
+    static final String LANG = "lang";
+
+    //************************  The IHtmlEvent properties  *******************************
+    /**
+     * The name of the <code>onchange</code> attribute.
+     */
+    static final String ONCHANGE = "onchange";
+
+    /**
+     * The name of the <code>onclick</code> attribute.
+     */
+    static final String ONCLICK = "onclick";
+
+    /**
+     * The name of the <code>ondblclick</code> attribute.
+     */
+    static final String ONDBLCLICK = "ondblclick";
+
+    /**
+     * The name of the <code>onkeydown</code> attribute.
+     */
+    static final String ONKEYDOWN = "onkeydown";
+
+    /**
+     * The name of the <code>onkeypress</code> attribute.
+     */
+    static final String ONKEYPRESS = "onkeypress";
+
+    /**
+     * The name of the <code>onkeyup</code> attribute.
+     */
+    static final String ONKEYUP = "onkeyup";
+
+    /**
+     * The name of the <code>onload</code> attribute.
+     */
+    static final String ONLOAD = "onload";
+
+    /**
+     * The name of the <code>onmousedown</code> attribute.
+     */
+    static final String ONMOUSEDOWN = "onmousedown";
+
+    /**
+     * The name of the <code>onmouseup</code> attribute.
+     */
+    static final String ONMOUSEUP = "onmouseup";
+
+    /**
+     * The name of the <code>onmousemove</code> attribute.
+     */
+    static final String ONMOUSEMOVE = "onmousemove";
+
+    /**
+     * The name of the <code>onmouseover</code> attribute.
+     */
+    static final String ONMOUSEOVER = "onmouseover";
+
+    /**
+     * The name of the <code>onmouseout</code> attribute.
+     */
+    static final String ONMOUSEOUT = "onmouseout";
+
+    /**
+     * The name of the <code>onreset</code> attribute.
+     */
+    static final String ONRESET = "onreset";
+
+    /**
+     * The name of the <code>onselect</code> attribute.
+     */
+    static final String ONSELECT = "onselect";
+
+    /**
+     * The name of the <code>onsubmit</code> attribute.
+     */
+    static final String ONSUBMIT = "onsubmit";
+
+    /**
+     * The name of the <code>onunload</code> attribute.
+     */
+    static final String ONUNLOAD = "onunload";
+
+    //****************************** cellhalign  ************************************************
+    /**
+     * The name of the <code>align</code> attribute.
+     */
+    static final String ALIGN = "align";
+
+    /**
+     * The name of the <code>char</code> attribute.
+     */
+    static final String CHAR = "char";
+
+    //****************************** cellvalign  ************************************************
+    /**
+     * The name of the <code>char</code> attribute.
+     */
+    static final String VALIGN = "valign";
+
+    /**
+     * The name of the <code>charoff</code> attribute.
+     */
+    static final String CHAROFF = "charoff";
+
+    //****************************** Other attribute constants  *********************************
+
+    /**
+     * The name of the <code>abbr</code> attribute.
+     */
+    static final String ABBR = "abbr";
+
+    /**
+     * The name of the <code>accesskey</code> attribute.
+     */
+    static final String ACCESSKEY = "accesskey";
+
+    /**
+     * The name of the <code>accept</code> attribute.
+     */
+    static final String ACCEPT = "accept";
+
+    /**
+     * The name of the <code>action</code> attribute.
+     */
+    static final String ACTION = "action";
+
+    /**
+     * The name of the <code>alt</code> attribute.
+     */
+    static final String ALT = "alt";
+
+    /**
+     * The name of the <code>axis</code> attribute.
+     */
+    static final String AXIS = "axis";
+
+    /**
+     * The name of the <code>background</code> attribute.
+     */
+    static final String BACKGROUND = "background";
+
+    /**
+     * The name of the <code>bgcolor</code> attribute.
+     */
+    static final String BGCOLOR = "bgcolor";
+
+    /**
+     * The name of the <code>border</code> attribute.
+     */
+    static final String BORDER = "border";
+
+    /**
+     * The name of the <code>cellspacing</code> attribute.
+     */
+    static final String CELLSPACING = "cellspacing";
+
+    /**
+     * The name of the <code>cellpadding</code> attribute.
+     */
+    static final String CELLPADDING = "cellpadding";
+
+    /**
+     * The name of the <code>charset</code> attribute.
+     */
+    static final String CHARSET = "charset";
+
+    /**
+     * The name of the <code>checked</code> attribute.
+     */
+    static final String CHECKED = "checked";
+
+    /**
+     * The name of the <code>cols</code> attribute.
+     */
+    static final String COLS = "cols";
+
+    /**
+     * The name of the <code>colspan</code> attribute.
+     */
+    static final String COLSPAN = "colspan";
+
+    /**
+     * The name of the <code>coords</code> attribute.
+     */
+    static final String COORDS = "coords";
+
+    /**
+     * The name of the <code>disabled</code> attribute.
+     */
+    static final String DISABLED = "disabled";
+
+    /**
+     * The name of the <code>enctype</code> attribute.
+     */
+    static final String ENCTYPE = "enctype";
+
+    /**
+     * The name of the <code>for</code> attribute.
+     */
+    static final String FOR = "for";
+
+    /**
+     * The name of the <code>frame</code> attribute.
+     */
+    static final String FRAME = "frame";
+
+    /**
+     * The name of the <code>headers</code> attribute.
+     */
+    static final String HEADERS = "headers";
+
+    /**
+     * The name of the <code>height</code> attribute.
+     */
+    static final String HEIGHT = "height";
+
+    /**
+     * The name of the <code>href</code> attribute.
+     */
+    static final String HREF = "href";
+
+    /**
+     * The name of the <code>hreflang</code> attribute.
+     */
+    static final String HREFLANG = "hreflang";
+
+    /**
+     * The name of the <code>hspace</code> attribute.
+     */
+    static final String HSPACE = "hspace";
+
+    /**
+     * The name of the <code>ismap</code> attribute.
+     */
+    static final String ISMAP = "ismap";
+
+    /**
+     * The name of the <code>language</code> attribute.
+     */
+    static final String LANGUAGE = "language";
+
+    /**
+     * The name of the <code>longdesc</code> attribute.
+     */
+    static final String LONGDESC = "longdesc";
+
+    /**
+     * The name of the <code>link</code> attribute.
+     */
+    static final String LINK = "link";
+
+    /**
+     * The name of the <code>alink</code> attribute.
+     */
+    static final String ALINK = "alink";
+
+    /**
+     * The name of the <code>vlink</code> attribute.
+     */
+    static final String VLINK = "vlink";
+
+    /**
+     * The name of the <code>method</code> attribute.
+     */
+    static final String METHOD = "method";
+
+    /**
+     * The name of the <code>maxlength</code> attribute.
+     */
+    static final String MAXLENGTH = "maxlength";
+
+    /**
+     * The name of the <code>name</code> attribute.
+     */
+    static final String NAME = "name";
+
+    /**
+     * The name of the <code>onblur</code> attribute.
+     */
+    static final String ONBLUR = "onblur";
+
+    /**
+     * The name of the <code>onfocus</code> attribute.
+     */
+    static final String ONFOCUS = "onfocus";
+
+    /**
+     * The name of the <code>readonly</code> attribute.
+     */
+    static final String READONLY = "readonly";
+
+    /**
+     * The name of the <code>rel</code> attribute.
+     */
+    static final String REL = "rel";
+
+    /**
+     * The name of the <code>rev</code> attribute.
+     */
+    static final String REV = "rev";
+
+    /**
+     * The name of the <code>rows</code> attribute.
+     */
+    static final String ROWS = "rows";
+
+    /**
+     * The name of the <rows>rowspan</code> attribute.
+     */
+    static final String ROWSPAN = "rowspan";
+
+    /**
+     * The name of the <code>rules</code> attribute.
+     */
+    static final String RULES = "rules";
+
+    /**
+     * The name of the <code>scope</code> attribute.
+     */
+    static final String SCOPE = "scope";
+
+    /**
+     * The name of the <code>shape</code> attribute.
+     */
+    static final String SHAPE = "shape";
+
+    /**
+     * The name of the <code>shape</code> attribute.
+     */
+    static final String SIZE = "size";
+
+    /**
+     * The name of the <code>src</code> attribute.
+     */
+    static final String SRC = "src";
+
+    /**
+     * The name of the <code>summary</code> attribute.
+     */
+    static final String SUMMARY = "summary";
+
+    /**
+     * The name of the <code>tabindex</code> attribute.
+     */
+    static final String TABINDEX = "tabindex";
+
+    /**
+     * The name of the <code>target</code> attribute.
+     */
+    static final String TARGET = "target";
+
+    /**
+     * The name of the <code>text</code> attribute.
+     */
+    static final String TEXT = "text";
+
+    /**
+     * The name of the <code>type</code> attribute.
+     */
+    static final String TYPE = "type";
+
+    /**
+     * The name of the <code>usemap</code> attribute.
+     */
+    static final String USEMAP = "usemap";
+
+    /**
+     * The name of the <code>value</code> attribute.
+     */
+    static final String VALUE = "value";
+
+    /**
+     * The name of the <code>vspace</code> attribute.
+     */
+    static final String VSPACE = "vspace";
+
+    /**
+     * The name of the <code>width</code> attribute.
+     */
+    static final String WIDTH = "width";
+
+    //************************ The input type names  *********************************
+
+    /**
+     * The InputType for the <code>button</code>
+     */
+    static final String INPUT_BUTTON = "button";
+
+    /**
+     * The InputType for the <code>checkbox</code>
+     */
+    static final String INPUT_CHECKBOX = "checkbox";
+
+    /**
+     * The InputType for the <code>file</code>
+     */
+    static final String INPUT_FILE = "file";
+
+    /**
+     * The InputType for the <code>hidden</code>
+     */
+    static final String INPUT_HIDDEN = "hidden";
+
+    /**
+     * The InputType for the <code>image</code>
+     */
+    static final String INPUT_IMAGE = "image";
+
+    /**
+     * The InputType for the <code>password</code>
+     */
+    static final String INPUT_PASSWORD = "password";
+
+    /**
+     * The InputType for the <code>radio</code>
+     */
+    static final String INPUT_RADIO = "radio";
+
+    /**
+     * The InputType for the <code>reset</code>
+     */
+    static final String INPUT_RESET = "reset";
+
+    /**
+     * The InputType for the <code>submit</code>
+     */
+    static final String INPUT_SUBMIT = "submit";
+
+    /**
+     * The InputType for the <code>text</code>
+     */
+    static final String INPUT_TEXT = "text";
+
+    /**
+     * Form <code>post</code> constant
+     */
+    static final String FORM_POST = "post";
+
+    /**
+     * Form <code>get</code> constant
+     */
+    static final String FORM_GET = "get";
+
+    //*************************** Element Names ************************
+
+    /**
+     * The name of the <code>a</code> element.
+     */
+    static final String ANCHOR = "a";
+
+    /**
+     * The name of the <code>area</code> element.
+     */
+    static final String AREA = "area";
+
+    /**
+     * The name of the <code>base</code> element.
+     */
+    static final String BASE = "base";
+
+    /**
+     * The name of the <code>body</code> element.
+     */
+    static final String BODY = "body";
+
+    /**
+     * The name of the <code>br</code> element.
+     */
+    static final String BR = "br";
+
+    /**
+     * The name of the <code>caption</code> element.
+     */
+    static final String CAPTION = "caption";
+
+    /**
+     * The name of the <code>div</code> element.
+     */
+    static final String DIV = "div";
+
+    /**
+     * The name of the <code>form</code> element.
+     */
+    static final String FORM = "form";
+
+    /**
+     * The name of the <code>html</code> element.
+     */
+    static final String HTML = "html";
+
+    /**
+     * The name of the <code>image</code> element.
+     */
+    static final String IMAGE = "img";
+
+    /**
+     * The name of the <code>input</code> element.
+     */
+    static final String INPUT = "input";
+
+    /**
+     * The name of the <code>label</code> element.
+     */
+    static final String LABEL = "label";
+
+    /**
+     * The name of the <code>option</code> element.
+     */
+    static final String OPTION = "option";
+
+    /**
+     * The name of the <code>script</code> element.
+     */
+    static final String SCRIPT = "script";
+
+    /**
+     * The name of the <code>select</code> element.
+     */
+    static final String SELECT = "select";
+
+    /**
+     * The name of the <code>span</code> element.
+     */
+    static final String SPAN = "span";
+
+    /**
+     * The name of the <code>table</code> element.
+     */
+    static final String TABLE = "table";
+
+    /**
+     * The name of the <code>tbody</code> element.
+     */
+    static final String TBODY = "tbody";
+
+    /**
+     * The name of the <code>td</code> element.
+     */
+    static final String TD = "td";
+
+    /**
+     * The name of the <code>textarea</code> element.
+     */
+    static final String TEXTAREA = "textarea";
+
+    /**
+     * The name of the <code>th</code> element.
+     */
+    static final String TH = "th";
+
+    /**
+     * The name of the <code>thead</code> element.
+     */
+    static final String THEAD = "thead";
+
+    /**
+     * The name of the <code>tfoot</code> element.
+     */
+    static final String TFOOT = "tfoot";
+
+    /**
+     * The name of the <code>tr</code> element.
+     */
+    static final String TR = "tr";
+}
+
+

Propchange: beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/html/HtmlConstants.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/html/HtmlUtils.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/html/HtmlUtils.java?rev=326581&view=auto
==============================================================================
--- beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/html/HtmlUtils.java (added)
+++ beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/html/HtmlUtils.java Wed Oct 19 08:29:22 2005
@@ -0,0 +1,295 @@
+/*
+ * Copyright 2004 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.
+ *
+ * $Header:$
+ */
+package org.apache.beehive.netui.simpletags.html;
+
+import org.apache.beehive.netui.util.internal.InternalStringBuilder;
+
+import org.apache.beehive.netui.core.URLCodec;
+import org.apache.beehive.netui.simpletags.appender.Appender;
+import org.apache.beehive.netui.simpletags.util.ContextUtils;
+import org.apache.beehive.netui.pageflow.PageFlowContext;
+
+//import javax.servlet.jsp.JspException;
+import java.io.UnsupportedEncodingException;
+import java.util.Iterator;
+import java.util.Map;
+
+/**
+ * This class provides a set of static methods that provide HTML utility code.
+ */
+public class HtmlUtils
+{
+    public static boolean containsHtml(String value)
+    {
+        int numChars = value.length();
+        char c;
+
+        for (int i = 0; i < numChars; i++) {
+            c = value.charAt(i);
+            switch (c) {
+                case '<':
+                    return true;
+                case '&':
+                    return true;
+                case '"':
+                    return true;
+            }
+        }
+        return false;
+
+    }
+
+    /**
+     * Filter the specified value for characters that are sensitive to
+     * HTML interpreters.  It will return a string with these characters replaced
+     * with HTML entities.  This method calls the overloaded method with <code>markupHTMLSpaceReturn</code>
+     * set to <code>false</code>.
+     * @param value The <code>String</code> value to be filtered and returned.
+     */
+    public static void filter(String value, Appender results)
+    {
+        filter(value, results, false);
+    }
+
+    /**
+     * Filter the specified string for characters that are sensitive to
+     * HTML interpreters, returning the string with these characters replaced
+     * by the corresponding character entities.
+     * @param value                 The <code>String</code> value to be filtered and returned.
+     * @param markupHTMLSpaceReturn convert space characters and return characters
+     *                              to &amp;nbsp; and &lt;br /&gt; marketup for html.
+     */
+    public static void filter(String value, Appender result, boolean markupHTMLSpaceReturn)
+    {
+        // if the value is null, return
+        if (value == null)
+            return;
+
+        // convert the string
+        int numChars = value.length();
+        char c;
+        char prev = 0;
+
+        for (int i = 0; i < numChars; i++) {
+            c = value.charAt(i);
+            switch (c) {
+                case '<':
+                    result.append("&lt;");
+                    break;
+                case '>':
+                    result.append("&gt;");
+                    break;
+                case '&':
+                    result.append("&amp;");
+                    break;
+                case '"':
+                    result.append("&quot;");
+                    break;
+                case '\'':
+                    result.append("&#39;");
+                    break;
+                case ' ':
+                    if (markupHTMLSpaceReturn) {
+                        if (prev == ' ') {
+                            result.append("&nbsp;");
+                        }
+                        else
+                            result.append(c);
+                    }
+                    else
+                        result.append(c);
+                    break;
+                case '\n':
+                    if (markupHTMLSpaceReturn) {
+                        result.append("<br />");
+                    }
+                    else
+                        result.append(c);
+                    break;
+                default:
+                    result.append(c);
+            }
+            prev = c;
+        }
+    }
+
+    public static String escapeEscapes(String val)
+    {
+        assert(val != null);
+        InternalStringBuilder sb = new InternalStringBuilder(val.length());
+        for (int i = 0; i < val.length(); i++) {
+            char c = val.charAt(i);
+            if (c == '"') {
+                sb.append("&quot;");
+                continue;
+            }
+            if (c == '\\') {
+                sb.append("\\\\");
+                continue;
+            }
+            sb.append(c);
+        }
+        return sb.toString();
+    }
+
+    public static String legacyEscapeEscapes(String val)
+    {
+        assert(val != null);
+        InternalStringBuilder sb = new InternalStringBuilder(val.length());
+        for (int i = 0; i < val.length(); i++) {
+            char c = val.charAt(i);
+            if (c == '"') {
+                sb.append("\\\"");
+                continue;
+            }
+            if (c == '\\') {
+                sb.append("\\\\");
+                continue;
+            }
+            sb.append(c);
+        }
+        return sb.toString();
+    }
+
+    /**
+     * @param url
+     * @param params
+     * @return String
+     */
+    public static String addParams(String url, Map params)
+    {
+        InternalStringBuilder urlBuffer = new InternalStringBuilder(url);
+
+        PageFlowContext pfCtxt = ContextUtils.getPageFlowContext();
+        String encoding = pfCtxt.getResponse().getCharacterEncoding();
+
+        try {
+            // Add dynamic parameters if requested
+            if ((params != null) && (params.size() > 0)) {
+
+                // Add the required request parameters
+                boolean question = url.indexOf('?') >= 0;
+                Iterator keys = params.keySet().iterator();
+                while (keys.hasNext()) {
+                    String key = (String) keys.next();
+                    Object value = params.get(key);
+                    if (value == null) {
+                        if (!question) {
+                            urlBuffer.append('?');
+                            question = true;
+                        }
+                        else {
+                            urlBuffer.append("&");
+                        }
+                        urlBuffer.append(URLCodec.encode(key, encoding));
+                        urlBuffer.append('='); // Interpret null as "no value"
+                    }
+                    else if (value instanceof String) {
+                        if (!question) {
+                            urlBuffer.append('?');
+                            question = true;
+                        }
+                        else {
+                            urlBuffer.append("&");
+                        }
+                        urlBuffer.append(URLCodec.encode(key, encoding));
+                        urlBuffer.append('=');
+                        urlBuffer.append(URLCodec.encode((String) value, encoding));
+                    }
+                    else if (value instanceof String[]) {
+                        String values[] = (String[]) value;
+                        for (int i = 0; i < values.length; i++) {
+                            if (!question) {
+                                urlBuffer.append('?');
+                                question = true;
+                            }
+                            else {
+                                urlBuffer.append("&");
+                            }
+                            urlBuffer.append(URLCodec.encode(key, encoding));
+                            urlBuffer.append('=');
+                            urlBuffer.append(URLCodec.encode(values[i], encoding));
+                        }
+                    }
+                    else /* Convert other objects to a string */ {
+                        if (!question) {
+                            urlBuffer.append('?');
+                            question = true;
+                        }
+                        else {
+                            urlBuffer.append("&");
+                        }
+                        urlBuffer.append(URLCodec.encode(key, encoding));
+                        urlBuffer.append('=');
+                        urlBuffer.append(URLCodec.encode(value.toString(), encoding));
+                    }
+                }
+            }
+        }
+        catch (UnsupportedEncodingException uee) {
+            uee.printStackTrace();
+            // @todo: what to throw here?
+            throw new RuntimeException("Unsupported Encoding" + encoding, uee);
+        }
+
+        return urlBuffer.toString();
+    }
+
+    /**
+     * This method will determine if the value passed in contains an entity.
+     * @return boolean
+     */
+    public static boolean containsEntity(String value)
+    {
+        assert (value != null) : "Parameter 'value' must not be null";
+
+        int pos = value.indexOf('&');
+        if (pos == -1)
+            return false;
+
+        int end = value.indexOf(';');
+        if (end != -1 && pos < end) {
+            // extract the entity and then verify it is
+            // a valid unicode identifier.
+            String entity = value.substring(pos + 1, end);
+            if (entity.length() == 0)
+                return false;
+            char[] chars = entity.toCharArray();
+
+            // verify the start is an indentifier start
+            // and the rest is a part.
+            if (!Character.isUnicodeIdentifierStart(chars[0])) {
+                if (chars[0] == '#' && chars.length > 1) {
+                    for (int i = 1; i < chars.length; i++) {
+                        if (!Character.isDigit(chars[i]))
+                            return false;
+                    }
+                    return true;
+                }
+                return false;
+            }
+            for (int i = 1; i < chars.length; i++) {
+                if (!Character.isUnicodeIdentifierPart(chars[i]))
+                    return false;
+            }
+            // good indentifier
+            return true;
+        }
+        return false;
+    }
+}

Propchange: beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/html/HtmlUtils.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/html/IHtmlAccessable.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/html/IHtmlAccessable.java?rev=326581&view=auto
==============================================================================
--- beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/html/IHtmlAccessable.java (added)
+++ beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/html/IHtmlAccessable.java Wed Oct 19 08:29:22 2005
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2004 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.
+ *
+ * $Header:$
+ */
+package org.apache.beehive.netui.simpletags.html;
+
+/**
+ * This is an interface that defines the accessability properties defined by HTML accessability. All tags
+ * producing HTML elements that require accessability properties should implement this interface.
+ * The interface defines two primary properties that will be output with the HTML.  The AccessKey
+ * usually results in an <code>accesskey</code> attribute.  This allows for keyboard navigation to an element
+ * on an HTML page.  The Alt property usually results in an <code>alt</code. attribute.  This is a text description
+ * of the HTML element.
+ */
+public interface IHtmlAccessable extends IHtmlCore
+{
+    /**
+     * Gets the accessKey attribute value.
+     * @return the accessKey value.
+     */
+    //String getAccessKey();
+
+    /**
+     * Sets the accessKey attribute value.  This should key value of the
+     * keyboard navigation key.  It is recommended not to use the following
+     * values because there are often used by browsers <code>A, C, E, F, G,
+     * H, V, left arrow, and right arrow</code>.
+     * @param accessKey - the accessKey value.
+     */
+    void setAccessKey(char accessKey);
+
+    /**
+     * Gets the alt attribute on the generate &lt;input tag.
+     * @return the alt value.
+     */
+    //String getAlt();
+
+    /**
+     * Sets the alt attribute value.
+     * @param alt - the alt value.
+     */
+    void setAlt(String alt);
+}

Propchange: beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/html/IHtmlAccessable.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/html/IHtmlAttrs.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/html/IHtmlAttrs.java?rev=326581&view=auto
==============================================================================
--- beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/html/IHtmlAttrs.java (added)
+++ beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/html/IHtmlAttrs.java Wed Oct 19 08:29:22 2005
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2004 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.
+ *
+ * $Header:$
+ */
+package org.apache.beehive.netui.simpletags.html;
+
+
+public interface IHtmlAttrs extends IHtmlCore, IHtmlI18n, IHtmlEvents
+{
+}

Propchange: beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/html/IHtmlAttrs.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/html/IHtmlCore.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/html/IHtmlCore.java?rev=326581&view=auto
==============================================================================
--- beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/html/IHtmlCore.java (added)
+++ beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/html/IHtmlCore.java Wed Oct 19 08:29:22 2005
@@ -0,0 +1,82 @@
+/*
+ * Copyright 2004 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.
+ *
+ * $Header:$
+ */
+package org.apache.beehive.netui.simpletags.html;
+
+import javax.servlet.jsp.JspException;
+
+
+/**
+ * This interface defines the HTML 4.0 core attributes.  The following properties represent the core attributes:
+ * id = tagId, class = styleClass, style = style, title = title.  This is a marker interface on the tags
+ * ensuring that tags representing core HTML elements have the defined property set.
+ */
+public interface IHtmlCore
+{
+
+    /**
+     * Return the ID of the tag.  The id may be rewritten by the container (such
+     * as a portal) to make sure it is unique.  JavaScript my lookup the actual id
+     * of the element by looking it up in the <code>netui_names</code> table written
+     * into the HTML.
+     * @return the tagId.
+     */
+    //String getTagId();
+
+    /**
+     * Set the ID of the tag.
+     * @param tagId - the tagId.
+     */
+    void setTagId(String tagId)
+            throws JspException;
+
+    /**
+     * Returns the Nodes title.
+     * @return
+     */
+    //String getTitle();
+
+    /**
+     * Sets the Nodes title.
+     * @param title
+     */
+    void setTitle(String title);
+
+    /**
+     * Sets the style of the rendered html tag.
+     * @param style - the html style.
+     */
+    void setStyle(String style);
+
+    /**
+     * Gets the style of the rendered html tag.
+     * @return the style.
+     */
+    //String getStyle();
+
+    /**
+     * Sets the style class of the rendered html tag.
+     * @param styleClass - the html style class.
+     */
+    void setStyleClass(String styleClass);
+
+    /**
+     * Gets the style class of the rendered html tag.
+     * @return the style class.
+     */
+    //String getStyleClass();
+}

Propchange: beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/html/IHtmlCore.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/html/IHtmlEvents.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/html/IHtmlEvents.java?rev=326581&view=auto
==============================================================================
--- beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/html/IHtmlEvents.java (added)
+++ beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/html/IHtmlEvents.java Wed Oct 19 08:29:22 2005
@@ -0,0 +1,143 @@
+/*
+ * Copyright 2004 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.
+ *
+ * $Header:$
+ */
+package org.apache.beehive.netui.simpletags.html;
+
+public interface IHtmlEvents
+{
+
+    /**
+     * Gets the onClick javascript event.
+     * @return the onClick event.
+     */
+    //String getOnClick();
+
+
+    /**
+     * Sets the onClick javascript event.
+     * @param onclick - the onClick event.
+     */
+    void setOnClick(String onclick);
+
+    /**
+     * Gets the onDblClick javascript event.
+     * @return the onDblClick event.
+     */
+    //String getOnDblClick();
+
+    /**
+     * Sets the onDblClick javascript event.
+     * @param ondblclick - the onDblClick event.
+     */
+    void setOnDblClick(String ondblclick);
+
+    /**
+     * Gets the onKeyDown javascript event.
+     * @return the onKeyDown event.
+     */
+    //String getOnKeyDown();
+
+    /**
+     * Sets the onKeyDown javascript event.
+     * @param onkeydown - the onKeyDown event.
+     */
+    void setOnKeyDown(String onkeydown);
+
+    /**
+     * Gets the onKeyPress javascript event.
+     * @return the onKeyPress event.
+     */
+    //String getOnKeyPress();
+
+    /**
+     * Sets the onKeyPress javascript event.
+     * @param onkeypress - the onKeyPress event.
+     */
+    void setOnKeyPress(String onkeypress);
+
+    /**
+     * Gets the onKeyUp javascript event.
+     * @return the onKeyUp event.
+     */
+    //String getOnKeyUp();
+
+    /**
+     * Sets the onKeyUp javascript event.
+     * @param onkeyup - the onKeyUp event.
+     */
+    void setOnKeyUp(String onkeyup);
+
+    /**
+     * Gets the onMouseDown javascript event.
+     * @return the onMouseDown event.
+     */
+    //String getOnMouseDown();
+
+    /**
+     * Sets the onMouseDown javascript event.
+     * @param onmousedown - the onMouseDown event.
+     */
+    void setOnMouseDown(String onmousedown);
+
+    /**
+     * Gets the onMouseMove javascript event.
+     * @return the onMouseMove event.
+     */
+    //String getOnMouseMove();
+
+    /**
+     * Sets the onMouseMove javascript event.
+     * @param onmousemove - the onMouseMove event.
+     */
+    void setOnMouseMove(String onmousemove);
+
+    /**
+     * Gets the onMouseOut javascript event.
+     * @return the onMouseOut event.
+     */
+    //String getOnMouseOut();
+
+    /**
+     * Sets the onMouseOut javascript event.
+     * @param onmouseout - the onMouseOut event.
+     */
+    void setOnMouseOut(String onmouseout);
+
+    /**
+     * Gets the onMouseOver javascript event.
+     * @return the onMouseOver event.
+     */
+    //String getOnMouseOver();
+
+    /**
+     * Sets the onMouseOver javascript event.
+     * @param onmouseover - the onMouseOver event.
+     */
+    void setOnMouseOver(String onmouseover);
+
+    /**
+     * Gets the onMouseUp javascript event.
+     * @return the onMouseUp event.
+     */
+    //String getOnMouseUp();
+
+    /**
+     * Sets the onMouseUp javascript event.
+     * @param onmouseup - the onMouseUp event.
+     */
+    void setOnMouseUp(String onmouseup);
+}

Propchange: beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/html/IHtmlEvents.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/html/IHtmlI18n.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/html/IHtmlI18n.java?rev=326581&view=auto
==============================================================================
--- beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/html/IHtmlI18n.java (added)
+++ beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/html/IHtmlI18n.java Wed Oct 19 08:29:22 2005
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2004 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.
+ *
+ * $Header:$
+ */
+package org.apache.beehive.netui.simpletags.html;
+
+/**
+ * Interface which inforces that the HTML i18n attributes are found on an HTML element as defined by
+ * the HTML 4.0 specification.
+ */
+public interface IHtmlI18n
+{
+    /**
+     * Gets the dir value of the html.
+     * @return "LTR" or "RTL"
+     */
+    //public String getDir();
+
+    /**
+     * Sets the dir value of the html.
+     * @param dir - "LTR" or "RTL"
+     * @netui:attribute required="false"
+     */
+    public void setDir(String dir);
+
+    /**
+     * Return the language Code of the HTML element.
+     * @return a language code.
+     */
+    //public String getLang();
+
+    /**
+     * Set the language code of an HTML element.
+     * @param lang
+     */
+    public void setLang(String lang);
+}

Propchange: beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/html/IHtmlI18n.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/javascript/CoreScriptFeature.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/javascript/CoreScriptFeature.java?rev=326581&view=auto
==============================================================================
--- beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/javascript/CoreScriptFeature.java (added)
+++ beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/javascript/CoreScriptFeature.java Wed Oct 19 08:29:22 2005
@@ -0,0 +1,120 @@
+/*
+ * Copyright 2004 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.
+ *
+ * $Header:$
+ */
+package org.apache.beehive.netui.simpletags.javascript;
+
+/**
+ *
+ */
+public class CoreScriptFeature
+{
+    public static final int INT_LEGACY_LOOKUP = 0x00001;
+    public static final int INT_ID_LOOKUP = 0x00002;
+    public static final int INT_NAME_LOOKUP = 0x00004;
+    public static final int INT_SCOPE_LOOKUP = 0x00008;
+    public static final int INT_ROLLOVER = 0x00010;
+    public static final int INT_ANCHOR_SUBMIT = 0x00020;
+    public static final int INT_POPUP_OPEN = 0x00040;
+    public static final int INT_POPUP_DONE = 0x00080;
+    public static final int INT_POPUP_UPDATE_FORM = 0x00100;
+    public static final int INT_ALLOCATE_LEGACY = 0x00200;
+    public static final int INT_ALLOCATE_ID = 0x00400;
+    public static final int INT_ALLOCATE_NAME = 0x00800;
+    public static final int INT_LEGACY_SCOPE_LOOKUP = 0x01000;
+    public static final int INT_TREE_INIT = 0x02000;
+    public static final int INT_DIVPANEL_INIT = 0x04000;
+    public static final int INT_DYNAMIC_INIT = 0x08000;
+    public static final int INT_BUTTON_DISABLE_AND_SUBMIT = 0x10000;
+    public static final int INT_BUTTON_DISABLE = 0x20000;
+
+    // These features are not written out once.  They are identified by setting the top bit
+    public static final int INT_SET_FOCUS = 0x10000001;
+
+    public int value;
+
+    CoreScriptFeature(int val)
+    {
+        value = val;
+    }
+    
+    public static final CoreScriptFeature LEGACY_LOOKUP = new CoreScriptFeature(INT_LEGACY_LOOKUP);
+    public static final CoreScriptFeature ID_LOOKUP = new CoreScriptFeature(INT_ID_LOOKUP);
+    public static final CoreScriptFeature NAME_LOOKUP = new CoreScriptFeature(INT_NAME_LOOKUP);
+    public static final CoreScriptFeature SCOPE_LOOKUP = new CoreScriptFeature(INT_SCOPE_LOOKUP);
+    public static final CoreScriptFeature ROLLOVER = new CoreScriptFeature(INT_ROLLOVER);
+    public static final CoreScriptFeature ANCHOR_SUBMIT = new CoreScriptFeature(INT_ANCHOR_SUBMIT);
+    public static final CoreScriptFeature POPUP_OPEN = new CoreScriptFeature(INT_POPUP_OPEN);
+    public static final CoreScriptFeature POPUP_DONE = new CoreScriptFeature(INT_POPUP_DONE);
+    public static final CoreScriptFeature POPUP_UPDATE_FORM = new CoreScriptFeature(INT_POPUP_UPDATE_FORM);
+    public static final CoreScriptFeature ALLOCATE_LEGACY = new CoreScriptFeature(INT_ALLOCATE_LEGACY);
+    public static final CoreScriptFeature ALLOCATE_ID = new CoreScriptFeature(INT_ALLOCATE_ID);
+    public static final CoreScriptFeature ALLOCATE_NAME = new CoreScriptFeature(INT_ALLOCATE_NAME);
+    public static final CoreScriptFeature LEGACY_SCOPE_LOOKUP = new CoreScriptFeature(INT_LEGACY_SCOPE_LOOKUP);
+    public static final CoreScriptFeature TREE_INIT = new CoreScriptFeature(INT_TREE_INIT);
+    public static final CoreScriptFeature DIVPANEL_INIT = new CoreScriptFeature(INT_DIVPANEL_INIT);
+    public static final CoreScriptFeature DYNAMIC_INIT = new CoreScriptFeature(INT_DYNAMIC_INIT);
+    public static final CoreScriptFeature BUTTON_DISABLE_AND_SUBMIT = new CoreScriptFeature(INT_BUTTON_DISABLE_AND_SUBMIT);
+    public static final CoreScriptFeature BUTTON_DISABLE = new CoreScriptFeature(INT_BUTTON_DISABLE);
+    public static final CoreScriptFeature SET_FOCUS = new CoreScriptFeature(INT_SET_FOCUS);
+
+    public String toString()
+    {
+        switch ( value )
+        {
+            case INT_LEGACY_LOOKUP: return "LEGACY_LOOKUP";
+            case INT_ID_LOOKUP: return "ID_LOOKUP";
+            case INT_NAME_LOOKUP: return "NAME_LOOKUP";
+            case INT_SCOPE_LOOKUP: return "SCOPE_LOOKUP";
+            case INT_ROLLOVER: return "ROLLOVER";
+            case INT_ANCHOR_SUBMIT: return "ANCHOR_SUBMIT";
+            case INT_POPUP_OPEN: return "POPUP_OPEN";
+            case INT_POPUP_DONE: return "POPUP_DONE";
+            case INT_POPUP_UPDATE_FORM: return "POPUP_UPDATE_FORM";
+            case INT_ALLOCATE_LEGACY: return "ALLOCATE_LEGACY";
+            case INT_ALLOCATE_ID: return "ALLOCATE_ID";
+            case INT_ALLOCATE_NAME: return "ALLOCATE_NAME";
+            case INT_LEGACY_SCOPE_LOOKUP: return "LEGACY_SCOPE_LOOKUP";
+            case INT_TREE_INIT: return "TREE_INIT";
+            case INT_DIVPANEL_INIT: return "DIVPANEL_INIT";
+            case INT_DYNAMIC_INIT: return "DYNAMIC_INIT";
+            case INT_BUTTON_DISABLE_AND_SUBMIT: return "BUTTON_DISABLE_AND_SUBMIT";
+            case INT_BUTTON_DISABLE: return "BUTTON_DISABLE";
+            case INT_SET_FOCUS: return "SET_FOCUS";
+        }
+        
+        assert false : value;
+        return "<unknown CoreScriptFeature>";
+    }
+    
+    public boolean equals( Object o )
+    {
+        if (o == null) return false;
+        if (o == this ) return true;
+        if (!(o instanceof CoreScriptFeature)) return false;
+        return ((CoreScriptFeature)o).value == value;
+    }
+    
+    public int hashCode()
+    {
+        return value;
+    }
+    
+    public int getIntValue()
+    {
+        return value;
+    }
+}

Propchange: beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/javascript/CoreScriptFeature.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/javascript/ScriptPlacement.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/javascript/ScriptPlacement.java?rev=326581&view=auto
==============================================================================
--- beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/javascript/ScriptPlacement.java (added)
+++ beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/javascript/ScriptPlacement.java Wed Oct 19 08:29:22 2005
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2005 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.
+ *
+ * $Header:$
+ */
+package org.apache.beehive.netui.simpletags.javascript;
+
+/**
+ *
+ */
+public class ScriptPlacement
+{
+    protected static final int INT_PLACE_BEFORE = 0;
+    protected static final int INT_PLACE_AFTER = 1;
+    protected static final int INT_PLACE_INLINE = 2;
+    protected static final int INT_PLACE_INFRAMEWORK = 3;
+    
+    public static final ScriptPlacement PLACE_BEFORE = new ScriptPlacement(INT_PLACE_BEFORE);
+    public static final ScriptPlacement PLACE_AFTER = new ScriptPlacement(INT_PLACE_AFTER);
+    public static final ScriptPlacement PLACE_INLINE = new ScriptPlacement(INT_PLACE_INLINE);
+    public static final ScriptPlacement PLACE_INFRAMEWORK = new ScriptPlacement(INT_PLACE_INFRAMEWORK);
+    
+    private int _val;
+    
+    private ScriptPlacement(int val)
+    {
+        _val = val;
+    }
+    
+    public String toString()
+    {
+        switch (_val)
+        {
+            case INT_PLACE_BEFORE : return "PLACE_BEFORE";
+            case INT_PLACE_AFTER: return "PLACE_AFTER";
+            case INT_PLACE_INLINE: return "PLACE_INLINE";
+            case INT_PLACE_INFRAMEWORK: return "PLACE_INFRAMEWORK";
+        }
+        
+        assert false : _val;
+        return "<unknown ScriptPlacement>";
+    }
+    
+    public boolean equals( Object o )
+    {
+        if (o == null) return false;
+        if (o == this) return true;
+        if (!(o instanceof ScriptPlacement)) return false;
+        return ((ScriptPlacement )o)._val == _val;
+    }
+    
+    public int hashCode()
+    {
+        return _val;
+    }
+}

Propchange: beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/javascript/ScriptPlacement.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/jsptags/AbstractSimpleTag.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/jsptags/AbstractSimpleTag.java?rev=326581&view=auto
==============================================================================
--- beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/jsptags/AbstractSimpleTag.java (added)
+++ beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/jsptags/AbstractSimpleTag.java Wed Oct 19 08:29:22 2005
@@ -0,0 +1,171 @@
+package org.apache.beehive.netui.simpletags.jsptags;
+
+import org.apache.beehive.netui.simpletags.core.Behavior;
+import org.apache.beehive.netui.simpletags.naming.FormDataNameInterceptor;
+import org.apache.beehive.netui.simpletags.naming.IndexedNameInterceptor;
+import org.apache.beehive.netui.util.Bundle;
+import org.apache.beehive.netui.util.logging.Logger;
+
+import javax.servlet.jsp.JspContext;
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.PageContext;
+import javax.servlet.jsp.tagext.JspFragment;
+import javax.servlet.jsp.tagext.SimpleTagSupport;
+import java.io.IOException;
+import java.io.StringWriter;
+import java.io.Writer;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * @netui:tag
+ */
+public abstract class AbstractSimpleTag extends SimpleTagSupport
+{
+    private static final Logger logger = Logger.getInstance(Behavior.class);
+    protected Behavior _behavior;
+
+    /**
+     * This List represents the default naming chain for handling <code>dataSource</code> attributes.  The list
+     * is a read-only list which may be used by any <code>dataSource</code> implementation.
+     */
+    public static final List DefaultNamingChain;
+
+    static
+    {
+        List l = new ArrayList(2);
+        l.add(new FormDataNameInterceptor());
+        l.add(new IndexedNameInterceptor());
+        DefaultNamingChain = Collections.unmodifiableList(l);
+    }
+
+    /**
+     * @param trim
+     * @return String
+     * @throws JspException
+     * @throws IOException
+     */
+    protected String getBufferBody(boolean trim)
+            throws JspException, IOException
+    {
+        Writer body = new StringWriter(32);
+        JspFragment frag = getJspBody();
+        if (frag == null)
+            return null;
+        frag.invoke(body);
+        String text = body.toString();
+        if (trim && text != null)
+            text = text.trim();
+        return (text.length() == 0) ? null : text;
+    }
+
+    /**
+     * Filter out the empty string value and return either the value or null.  When the value of
+     * <code>attrValue</code> is equal to the empty string this will return null, otherwise it will
+     * return the value of <code>attrValue</code>.
+     * @param attrValue This is the value we will check for the empty string.
+     * @return either the value of attrValue or null
+     */
+    protected final String setNonEmptyValueAttribute(String attrValue)
+    {
+        return ("".equals(attrValue)) ? null : attrValue;
+    }
+
+    /**
+     * Report an error if the value of <code>attrValue</code> is equal to the empty string, otherwise return
+     * that value.  If <code>attrValue</code> is equal to the empty string, an error is registered and
+     * null is returned.
+     * @param attrValue The value to be checked for the empty string
+     * @param attrName  The name of the attribute
+     * @return either the attrValue if it is not the empty string or null
+     */
+    protected final String setRequiredValueAttribute(String attrValue, String attrName)
+    {
+        assert(attrValue != null) : "parameter '" + attrValue + "' must not be null";
+        assert(attrName != null) : "parameter '" + attrName + "' must not be null";
+
+        if ("".equals(attrValue)) {
+            String s = Bundle.getString("Tags_AttrValueRequired", new Object[]{attrName});
+            _behavior.registerTagError(s, null);
+            return null;
+        }
+        return attrValue;
+    }
+
+    /**
+     * This method will attempt to cast the JspContext into a PageContext.  If this fails,
+     * it will log an exception.
+     * @return PageContext
+     */
+    protected PageContext getPageContext()
+    {
+        JspContext ctxt = getJspContext();
+        if (ctxt instanceof PageContext)
+            return (PageContext) ctxt;
+
+        // assert the page context and log an error in production
+        assert(false) : "The JspContext was not a PageContext";
+        logger.error("The JspContext was not a PageContext");
+        return null;
+    }
+
+    /**
+     * Return the closest <code>ScriptReporter</code> in the parental chain.  Searching starts
+     * at this node an moves upward through the parental chain.
+     * @return a <code>ScriptReporter</code> or null if there is not one found.
+     */
+    //protected IScriptReporter getScriptReporter()
+    //{
+    //    IScriptReporter sr = (IScriptReporter) SimpleTagSupport.findAncestorWithClass(this, IScriptReporter.class);
+    //    return sr;
+    //}
+
+    /**
+     * This method will return the scriptReporter that is represented by the HTML tag.
+     * @return IScriptReporter
+     */
+    //protected IScriptReporter getHtmlTag(ServletRequest req)
+    //{
+    //    Html html = (Html) req.getAttribute(Html.HTML_TAG_ID);
+    //    if (html != null && html instanceof IScriptReporter)
+     //       return (IScriptReporter) html;
+     //   return null;
+    //}
+
+    /**
+     * This method will rewrite the name (id) by passing it to the
+     * URL Rewritter and getting back a value.
+     * @param name the name that will be rewritten
+     * @return a name that has been rewritten by the URLRewriterService.
+     */
+    //final protected String rewriteName(String name)
+    //{
+    //    PageContext pageContext = getPageContext();
+    //    return URLRewriterService.getNamePrefix(pageContext.getServletContext(), pageContext.getRequest(), name) + name;
+    //}
+
+    /**
+     * This method will generate a real id based upon the passed in tagId.  The generated
+     * id will be constucted by searching upward for all the script containers that have a
+     * scope id set.  These will form a fully qualified id.
+     * @param tagId The base tagId set on a tag
+     * @return an id value formed by considering all of the scope id's found in the tag hierarchy.
+     */
+    //final protected String getIdForTagId(String tagId)
+    //{
+    //    HttpServletRequest req = (HttpServletRequest) getPageContext().getRequest();
+    //    ArrayList/*<String>*/ list = (ArrayList/*<String>*/)
+    //            org.apache.beehive.netui.tags.RequestUtils.getOuterAttribute(req,
+    //                    ScriptContainer.SCOPE_ID);
+    //    if (list == null)
+    //        return tagId;
+    //    InternalStringBuilder sb = new InternalStringBuilder();
+    //    for (int i=0;i<list.size();i++) {
+    //        sb.append((String) list.get(i));
+   //         sb.append('.');
+   //     }
+   //     sb.append(tagId);
+   //     return sb.toString();
+    //}
+}

Propchange: beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/jsptags/AbstractSimpleTag.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/jsptags/Anchor.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/jsptags/Anchor.java?rev=326581&view=auto
==============================================================================
--- beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/jsptags/Anchor.java (added)
+++ beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/jsptags/Anchor.java Wed Oct 19 08:29:22 2005
@@ -0,0 +1,287 @@
+/*
+ * Copyright 2004 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.
+ *
+ * $Header:$
+ */
+package org.apache.beehive.netui.simpletags.jsptags;
+
+import org.apache.beehive.netui.simpletags.appender.Appender;
+import org.apache.beehive.netui.simpletags.appender.ResponseAppender;
+import org.apache.beehive.netui.simpletags.behaviors.AnchorBehavior;
+
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.tagext.DynamicAttributes;
+import java.io.IOException;
+
+/**
+ * <p>
+ * Generates a URL-encoded hyperlink to a specified URI.
+ * Also adds support for URL re-writing and JavaScript-based form submission.
+ * An anchor must have one of the following attributes to correctly create the hyperlink:
+ * <ul>
+ * <li>action - an action invoked by clicking the hyperlink.</li>
+ * <li>href - a URL to go to</li>
+ * <li>linkName - an internal place in the page to move to</li>
+ * <li>clientAction - the action to run on the client</li>
+ * <li>tagId - the ID of the tag</li>
+ * <li>formSubmit - indicates whether or not the enclosing Form should be submitted</li>
+ * </ul>
+ * </p>
+ * @jsptagref.tagdescription <p>
+ * Generates an anchor that can link to another document or invoke an action method in the Controller file.
+ * The &lt;netui:anchor> tag also supports JavaScript-based form submission and URL re-writing.
+ * <p>
+ * An anchor must have one of the following attributes to correctly create the hyperlink:
+ * <blockquote>
+ * <ul>
+ * <li><code>action</code> - the action method invoked by clicking the hyperlink</li>
+ * <li><code>href</code> - the URL to go to</li>
+ * <li><code>linkName</code> - an internal place in the page to move to</li>
+ * <li><code>clientAction</code> - the action to run on the client</li>
+ * <li><code>tagId</code> - the ID of the tag</li>
+ * <li><code>formSubmit</code> - indicates whether or not the enclosing Form should be submitted</li>
+ * </ul>
+ * </blockquote>
+ * </p>
+ * @example <b>Submitting Form Data</b>
+ * <p>In this sample, clicking on this anchor submits the form data and invokes the method
+ * <code>submitForm</code>.
+ * <pre>
+ *      &lt;netui:form action="formSubmit">
+ *          Firstname:
+ *          &lt;netui:textBox dataSource="actionForm.firstname"/>
+ *          Lastname:
+ *          &lt;netui:textBox dataSource="actionForm.lastname"/>
+ *          &lt;netui:anchor formSubmit="true">Submit&lt;/netui:anchor>
+ *      &lt;/netui:form></pre>
+ * <p>If the <code>formSubmit</code> attribute is set to <code>true</code> and no
+ * <code>onClick</code> attribute is set, the following JavaScript function will be written to the HTML page.
+ * This JavaScript function will be referenced by the <code>onclick</code> attribute of the generated anchor tag.</p>
+ * <pre>
+ *  function anchor_submit_form(netuiName, newAction)
+ *  {
+ *    for (var i=0; i&lt;document.forms.length; i++) {
+ *       if (document.forms[i].id == netuiName) {
+ *          document.forms[i].method = "POST";
+ *          document.forms[i].action = newAction;
+ *          document.forms[i].submit();
+ *       }
+ *     }
+ *  }</pre>
+ * <p> The JavaScript function will be invoked by the generated HTML anchor tag as follows:
+ * <pre>
+ * &lt;a href="/WebApp/tagSamples/anchor/formSubmit.do"
+ *       onClick='anchor_submit_form("Netui_Form_0","/WebApp/tagSamples/anchor/formSubmit.do");return false;'>Submit&lt;/a></pre>
+ * <p>
+ * <b>Custom JavaScript Functions</b>
+ * </p>
+ * <p>It is possible to write a custom <code>onClick</code> JavaScript event handler that would
+ * do additional work, for example form validation, and still POST the form correctly.  To
+ * accomplish this, add the custom JavaScript method to the page:
+ * <pre>
+ * function SubmitFromAnchor()
+ * {
+ *   // implement custom logic here
+ *
+ *   for(var i=0; i&lt;document.forms.length; i++)
+ *   {
+ *     // submit to the action /aWebapp/formPost.do
+ *     if (document.forms[i].action == "/aWebapp/formPost.do")
+ *     {
+ *       document.forms[i].method="POST";
+ *       document.forms[i].action="/aWebapp/formPost.do";
+ *       document.forms[i].submit();
+ *     }
+ *   }
+ * }</pre>
+ * Then reference the JavaScript method from the &lt;netui:anchor> tag:
+ * <pre>
+ * &lt;netui:anchor formSubmit="true" onClick="SubmitFromAnchor(); return false;"&gt;Submit&lt;/netui:anchor&gt;</pre>
+ * @netui:tag name="anchor" body-content="scriptless" dynamic-attributes="true" description="Generates a URL-encoded hyperlink to a specified URI."
+ * @see java.lang.String
+ */
+public class Anchor extends AnchorBase implements DynamicAttributes
+{
+    public Anchor() {
+        _behavior = new AnchorBehavior();
+    }
+    /**
+     * Sets the onClick javascript event.
+     * @param onclick the onClick event.
+     * @jsptagref.attributedescription The onClick JavaScript event.
+     * @jsptagref.databindable false
+     * @jsptagref.attributesyntaxvalue <i>string_onClick</i>
+     * @netui:attribute required="false" rtexprvalue="true"
+     * description="The onClick JavaScript event."
+     */
+    public void setOnClick(String onclick)
+    {
+        ((AnchorBehavior) _behavior).setOnClick(setNonEmptyValueAttribute(onclick));
+    }
+
+    /**
+     * Set a client action to run on the client.  When set on an anchor, a NetUI JavaScript action
+     * will be run.  This attribute may not be set if <code>href</code> or <code>action</code> is set.
+     * @param action an action to run on the client.
+     * @jsptagref.attributedescription The action (NetUI JavaScript) to run on the client.
+     * @jsptagref.databindable false
+     * @jsptagref.attributesyntaxvalue <i>string_clientAction</i>
+     * @netui:attribute required="false" rtexprvalue="true" description="The client action."
+     * description="The action (NetUI JavaScript) to run on the client."
+     */
+    public void setClientAction(String action)
+            throws JspException
+    {
+        ((AnchorBehavior) _behavior).setClientAction(setRequiredValueAttribute(action, "clientAction"));
+    }
+
+    /**
+     * Sets the link name of the Anchor.  The link name is treated as a fragment
+     * identifier and may or may not contain the "#" character.  If it does, the
+     * link name will not be qualified into a ScriptContainer.  If the link name
+     * does not contain the "#" the normal tagId qualification will take place
+     * to produce the actual fragment identifier.
+     * @param linkName the link name for the Anchor.
+     * @jsptagref.attributedescription An internal place on the page to go to.
+     * @jsptagref.databindable false
+     * @jsptagref.attributesyntaxvalue <i>string_linkName</i>
+     * @netui:attribute required="false"  rtexprvalue="true"
+     * description="An internal place on the page to go to."
+     */
+    public void setLinkName(String linkName)
+            throws JspException
+    {
+        ((AnchorBehavior) _behavior).setLinkName(setRequiredValueAttribute(linkName, "linkName"));
+    }
+
+    /**
+     * Sets <code>charset</code> attribute for the anchor.
+     * @param charSet the window target.
+     * @jsptagref.attributedescription The character set.
+     * @jsptagref.databindable false
+     * @jsptagref.attributesyntaxvalue <i>string_charset</i>
+     * @netui:attribute required="false"  rtexprvalue="true"
+     * description="The character set."
+     */
+    public void setCharSet(String charSet)
+    {
+        ((AnchorBehavior) _behavior).setCharSet(charSet);
+    }
+
+    /**
+     * Sets <code>type</code> attribute for the anchor.
+     * @param type the window target.
+     * @jsptagref.attributedescription The type.
+     * @jsptagref.databindable false
+     * @jsptagref.attributesyntaxvalue <i>string_type</i>
+     * @netui:attribute required="false"  rtexprvalue="true"
+     * description="The type."
+     */
+    public void setType(String type)
+    {
+        ((AnchorBehavior) _behavior).setType(type);
+    }
+
+    /**
+     * Sets <code>hreflang</code> attribute for the anchor.
+     * @param hreflang the window target.
+     * @jsptagref.attributedescription The HREF lang.
+     * @jsptagref.databindable false
+     * @jsptagref.attributesyntaxvalue <i>string_hreflang</i>
+     * @netui:attribute required="false"  rtexprvalue="true"
+     * description="The HREF lang."
+     */
+    public void setHrefLang(String hreflang)
+    {
+        ((AnchorBehavior) _behavior).setHrefLang(hreflang);
+    }
+
+    /**
+     * Sets <code>rel</code> attribute for the anchor.
+     * @param rel the window target.
+     * @jsptagref.attributedescription The relationship between the current document and the target Url.
+     * @jsptagref.databindable false
+     * @jsptagref.attributesyntaxvalue <i>string_rel</i>
+     * @netui:attribute required="false"  rtexprvalue="true"
+     * description="The rel."
+     */
+    public void setRel(String rel)
+    {
+        ((AnchorBehavior) _behavior).setRel(rel);
+    }
+
+    /**
+     * Sets <code>rev</code> attribute for the anchor.
+     * @param rev the window target.
+     * @jsptagref.attributedescription Describes a reverse link from the anchor specified to the current document.
+     * @jsptagref.databindable false
+     * @jsptagref.attributesyntaxvalue <i>string_rev</i>
+     * @netui:attribute required="false" rtexprvalue="true"
+     * description="The rev."
+     */
+    public void setRev(String rev)
+    {
+        ((AnchorBehavior) _behavior).setRev(rev);
+    }
+
+
+    /**
+     * Sets the window target.
+     * @param target the window target.
+     * @jsptagref.attributedescription The window target.
+     * @jsptagref.databindable false
+     * @jsptagref.attributesyntaxvalue <i>string_action</i>
+     * @netui:attribute required="false"  rtexprvalue="true"
+     * description="The window target."
+     */
+    public void setTarget(String target)
+    {
+        ((AnchorBehavior) _behavior).setTarget(target);
+    }
+
+    /**
+     * This will set the text of the anchor.  If there is body content, this
+     * will override that value.
+     * @param value the text of the anchor.
+     * @jsptagref.attributedescription Set the text of the anchor, overriding the body content.
+     * @jsptagref.databindable false
+     * @jsptagref.attributesyntaxvalue <i>string_value</i>
+     * @netui:attribute required="false"  rtexprvalue="true"
+     * description="Set the text of the anchor overriding the body content"
+     */
+    public void setValue(String value)
+    {
+        ((AnchorBehavior) _behavior).setValue(value);
+    }
+
+    /**
+     * Prepare the hyperlink for rendering
+     * @throws JspException if a JSP exception has occurred
+     */
+    public void doTag() throws JspException, IOException
+    {
+        _behavior.start();
+        String value = getBufferBody(true);
+        ((AnchorBehavior) _behavior).setValue(value);
+
+        Appender appender = new ResponseAppender(getPageContext().getResponse());
+        ((AnchorBehavior) _behavior).setText(value);
+        _behavior.preRender();
+        _behavior.renderStart(appender);
+        _behavior.renderEnd(appender);
+        _behavior.postRender();
+        _behavior.terminate();
+    }
+}

Propchange: beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/jsptags/Anchor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/jsptags/AnchorBase.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/jsptags/AnchorBase.java?rev=326581&view=auto
==============================================================================
--- beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/jsptags/AnchorBase.java (added)
+++ beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/jsptags/AnchorBase.java Wed Oct 19 08:29:22 2005
@@ -0,0 +1,223 @@
+package org.apache.beehive.netui.simpletags.jsptags;
+
+import org.apache.beehive.netui.simpletags.behaviors.AnchorBaseBehavior;
+
+import javax.servlet.jsp.JspException;
+
+/**
+ * This is the base class that provides most of the features necessary to create an anchor and an area. The Anchor
+ * and Area tags are created as subclasses of this tag.  The Area tag is really a subset of the features, so certain
+ * attributes are not defined here, even though the backing fields are defined here and the utility code knows them.
+ * This may not be the best OO design, but the design is optimized for performance of rendering anchor elements.
+ */
+abstract public class AnchorBase extends HtmlBaseTag
+{
+    /**
+     * Sets <code>shape</code> attribute for the area.
+     * @param shape the window target.
+     * @jsptagref.attributedescription The shape.
+     * @jsptagref.databindable false
+     * @jsptagref.attributesyntaxvalue <i>string_shape</i>
+     * @netui:attribute required="false"  rtexprvalue="true"
+     * description="The shape."
+     */
+    public void setShape(String shape)
+    {
+        ((AnchorBaseBehavior) _behavior).setShape(shape);
+    }
+
+    /**
+     * Sets <code>coords</code> attribute for the area.
+     * @param coords the window target.
+     * @jsptagref.attributedescription The coordinates.
+     * @jsptagref.databindable false
+     * @jsptagref.attributesyntaxvalue <i>string_coordinates</i>
+     * @netui:attribute required="false"  rtexprvalue="true"
+     * description="The coordinates."
+     */
+    public void setCoords(String coords)
+    {
+        ((AnchorBaseBehavior) _behavior).setCoords(coords);
+    }
+
+    /**
+     * Set the name of the action for the Area.
+     * @param action the name of the action to set for the Area.
+     * @jsptagref.attributedescription The action method to invoke.  The action method must be in the Controller file
+     * of the Page Flow directory.
+     * @jsptagref.databindable false
+     * @jsptagref.attributesyntaxvalue <i>string_action</i>
+     * @netui:attribute required="false" rtexprvalue="true"
+     * description="The action method to invoke.  The action method must be in the Controller file of the Page Flow directory."
+     */
+    public void setAction(String action)
+            throws JspException
+    {
+        ((AnchorBaseBehavior) _behavior).setAction(action);
+    }
+
+    /**
+     * Sets the href of the Anchor. This attribute will accept the empty String as a legal value.
+     * @param href the hyperlink URI for the Area.
+     * @jsptagref.attributedescription The URL to go to.
+     * @jsptagref.databindable false
+     * @jsptagref.attributesyntaxvalue <i>string_href</i>
+     * @netui:attribute required="false" rtexprvalue="true"
+     * description="The URL to go to."
+     * reftype="url"
+     */
+    public void setHref(String href)
+            throws JspException
+    {
+        ((AnchorBaseBehavior) _behavior).setHref(href);
+    }
+
+    /**
+     * Sets the anchor to be added to the end of the generated hyperlink.
+     * @param location the name of the location anchor.
+     * @jsptagref.attributedescription Location within the URI to visit.
+     * @jsptagref.databindable false
+     * @jsptagref.attributesyntaxvalue <i>string_location</i>
+     * @netui:attribute required="false"  rtexprvalue="true"
+     * description="Location within the URI to visit."
+     */
+    public void setLocation(String location)
+    {
+        ((AnchorBaseBehavior) _behavior).setLocation(setNonEmptyValueAttribute(location));
+    }
+
+    /**
+     * Set the target "scope" for the anchor's action.  Multiple active page flows may exist concurrently within named
+     * scopes.  This attribute selects which named scope to use.  If omitted, the default scope is assumed.
+     * @param targetScope the name of the target scope in which the associated action's page flow resides.
+     * @jsptagref.attributedescription The target scope in which the associated action's page flow resides.
+     * @jsptagref.databindable true
+     * @jsptagref.attributesyntaxvalue <i>string_targetScope</i>
+     * @netui:attribute required="false" rtexprvalue="true"
+     * description="The target scope in which the associated action's page flow resides"
+     */
+    public void setTargetScope(String targetScope)
+    {
+        ((AnchorBaseBehavior) _behavior).setTargetScope(targetScope);
+    }
+
+    /**
+     * Sets the formSubmit indicator.
+     * @param formSubmit whether or not the enclosing Form should be submitted.
+     * @jsptagref.attributedescription Boolean.  If <code>formSubmit</code> is set to true, and the &lt;netui:anchor> tag
+     * is within a &lt;netui:form> tag,
+     * then the form data will be submitted to the method named in the
+     * &lt;netui:form> tag's <code>action</code> attribute.
+     * @jsptagref.databindable false
+     * @jsptagref.attributesyntaxvalue <i>boolean_formSubmit</i>
+     * @netui:attribute required="false" rtexprvalue="true" type="boolean"
+     * description="If formSubmit is set to true, and the <netui:anchor> tag
+     * is within a <netui:form> tag,
+     * then the form data will be submitted to the method named in the
+     * <netui:form> tag's action attribute."
+     */
+    public void setFormSubmit(boolean formSubmit)
+    {
+        ((AnchorBaseBehavior) _behavior).setFormSubmit(formSubmit);
+    }
+
+    /**
+     * Sets the popup indicator.
+     * @param popup whether or not the anchor should open a popup window.
+     * @jsptagref.attributedescription Boolean.  If <code>popup</code> is set to true,
+     * the anchor will open a popup window.
+     * @jsptagref.databindable true
+     * @jsptagref.attributesyntaxvalue <i>boolean_popup</i>
+     * @netui:attribute required="false" rtexprvalue="true" type="boolean"
+     * description="If popup is set to true, the anchor will open a popup window.
+     */
+    public void setPopup(boolean popup)
+    {
+        ((AnchorBaseBehavior) _behavior).setPopup(popup);
+    }
+
+
+    /**
+     * When true, this anchor will disable itself after being clicked.
+     * @param disableSecondClick when true, this anchor will disable itself after being clicked.
+     * @jsptagref.attributedescription Boolean.  If <code>disableSecondClick</code> is set to true,
+     * the anchor will disable itself after being clicked.
+     * @jsptagref.databindable true
+     * @jsptagref.attributesyntaxvalue <i>boolean_disableSecondClick</i>
+     * @netui:attribute required="false" rtexprvalue="true" type="boolean"
+     * description="When true, this anchor will disable itself after being clicked."
+     */
+    public void setDisableSecondClick(boolean disableSecondClick)
+    {
+        ((AnchorBaseBehavior) _behavior).setDisableSecondClick(disableSecondClick);
+    }
+
+
+    /**
+     * Sets the tabIndex of the rendered html tag.
+     * @param tabindex the tab index.
+     * @jsptagref.attributedescription The tabIndex of the rendered HTML tag.  This attribute determines the position of the
+     * rendered HTML tag in the sequence of tags that the user may advance through by pressing the TAB key.
+     * @jsptagref.databindable false
+     * @jsptagref.attributesyntaxvalue <i>string_tabIndex</i>
+     * @netui:attribute required="false"  rtexprvalue="true" type="int"
+     * description="The tabIndex of the rendered HTML tag.  This attribute determines the position of the
+     * rendered HTML tag in the sequence of tags that the user may advance through by pressing the TAB key."
+     */
+    public void setTabindex(int tabindex)
+    {
+        ((AnchorBaseBehavior) _behavior).setTabindex(tabindex);
+    }
+
+
+    /**
+     * Sets the accessKey attribute value.  This should key value of the
+     * keyboard navigation key.  It is recommended not to use the following
+     * values because there are often used by browsers <code>A, C, E, F, G,
+     * H, V, left arrow, and right arrow</code>.
+     * @param accessKey the accessKey value.
+     * @jsptagref.attributedescription The keyboard navigation key for the element.
+     * The following values are not recommended because they
+     * are often used by browsers: <code>A, C, E, F, G,
+     * H, V, left arrow, and right arrow</code>
+     * @jsptagref.databindable false
+     * @jsptagref.attributesyntaxvalue <i>string_accessKey</i>
+     * @netui:attribute required="false" rtexprvalue="true"  type="char"
+     * description=" The keyboard navigation key for the element.
+     * The following values are not recommended because they
+     * are often used by browsers: A, C, E, F, G,
+     * H, V, left arrow, and right arrow."
+     */
+    public void setAccessKey(char accessKey)
+    {
+        ((AnchorBaseBehavior) _behavior).setAccessKey(accessKey);
+    }
+
+    /**
+     * Sets the onBlur javascript event.
+     * @param onblur the onBlur event.
+     * @jsptagref.attributedescription The onBlur JavaScript event.
+     * @jsptagref.databindable false
+     * @jsptagref.attributesyntaxvalue <i>string_onBlur</i>
+     * @netui:attribute required="false" rtexprvalue="true"
+     * description="The onBlur JavaScript event."
+     */
+    public void setOnBlur(String onblur)
+    {
+        ((AnchorBaseBehavior) _behavior).setOnBlur(onblur);
+    }
+
+    /**
+     * Sets the onFocus javascript event.
+     * @param onfocus the onFocus event.
+     * @jsptagref.attributedescription The onFocus JavaScript event.
+     * @jsptagref.databindable false
+     * @jsptagref.attributesyntaxvalue <i>string_onFocus</i>
+     * @netui:attribute required="false" rtexprvalue="true"
+     * description="The onFocus JavaScript event."
+     */
+    public void setOnFocus(String onfocus)
+    {
+        ((AnchorBaseBehavior) _behavior).setOnFocus(onfocus);
+    }
+}

Propchange: beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/jsptags/AnchorBase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/jsptags/Base.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/jsptags/Base.java?rev=326581&view=auto
==============================================================================
--- beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/jsptags/Base.java (added)
+++ beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/jsptags/Base.java Wed Oct 19 08:29:22 2005
@@ -0,0 +1,88 @@
+/*
+ * Copyright 2004 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.
+ *
+ * $Header:$
+ */
+package org.apache.beehive.netui.simpletags.jsptags;
+
+import org.apache.beehive.netui.simpletags.appender.Appender;
+import org.apache.beehive.netui.simpletags.appender.ResponseAppender;
+import org.apache.beehive.netui.simpletags.behaviors.BaseBehavior;
+import org.apache.beehive.netui.simpletags.html.HtmlConstants;
+
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.tagext.DynamicAttributes;
+import java.io.IOException;
+
+/**
+ * Provides the base for every URL on this page.
+ * @jsptagref.tagdescription Provides the base for every URL on the page.
+ * @example In this sample, the Base tag is simply dropped in and then automatically determines
+ * the base for each URL on this page.
+ * <pre>
+ * &lt;head>
+ *      &lt;netui:base />
+ * &lt;/head>
+ * </pre>
+ * @netui:tag name="base" body-content="scriptless" dynamic-attributes="true" description="Provides the base for every URL on this page."
+ */
+public class Base extends AbstractSimpleTag
+        implements HtmlConstants, DynamicAttributes
+{
+    public Base() {
+        _behavior = new BaseBehavior();
+    }
+
+    /**
+     * Set the default window target.
+     * @param target the window target.
+     * @jsptagref.attributedescription The default window target.
+     * @jsptagref.databindable false
+     * @jsptagref.attributesyntaxvalue <i>string_windowTarget</i>
+     * @netui:attribute required="false" rtexprvalue="true"
+     * description="The default window target."
+     */
+    public void setTarget(String target)
+    {
+        ((BaseBehavior) _behavior).setTarget(setNonEmptyValueAttribute(target));
+    }
+
+    /**
+     * Render the hyperlink.
+     * @throws JspException if a JSP exception has occurred
+     */
+    public void doTag()
+            throws JspException, IOException
+    {
+        _behavior.start();
+        // evaluate the body, this is called basically so any attributes my be applied.
+        getBufferBody(false);
+        
+        Appender appender = new ResponseAppender(getPageContext().getResponse());
+        _behavior.preRender();
+        _behavior.renderStart(appender);
+        _behavior.renderEnd(appender);
+        _behavior.postRender();
+        _behavior.terminate();
+    }
+
+    public void setDynamicAttribute(String uri, String localName, Object value) throws JspException
+    {
+        ((BaseBehavior) _behavior).setAttribute(localName, value.toString(), uri);
+    }
+}
+
+
+

Propchange: beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/jsptags/Base.java
------------------------------------------------------------------------------
    svn:eol-style = native