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 [8/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/rendering/CaptionTag.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/CaptionTag.java?rev=326581&view=auto
==============================================================================
--- beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/CaptionTag.java (added)
+++ beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/CaptionTag.java Wed Oct 19 08:29:22 2005
@@ -0,0 +1,72 @@
+/*
+ * 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.rendering;
+
+import org.apache.beehive.netui.simpletags.html.HtmlConstants;
+import org.apache.beehive.netui.simpletags.appender.Appender;
+
+import java.util.HashMap;
+
+/**
+ * Render the HTML <caption> element. In HTML 4.01 both the start and end tags are required.
+ * There are no required attributes.
+ */
+public abstract class CaptionTag extends TagHtmlBase
+{
+ public static void add(HashMap html, HashMap htmlQuirks, HashMap xhtml)
+ {
+ html.put(CAPTION_TAG, new Rendering());
+ htmlQuirks.put(CAPTION_TAG, new Rendering());
+ xhtml.put(CAPTION_TAG, new Rendering());
+ }
+
+ public static class State extends AbstractHtmlState
+ {
+ public void clear()
+ {
+ super.clear();
+ }
+ }
+
+ private static class Rendering extends CaptionTag implements HtmlConstants
+ {
+ public void doStartTag(Appender sb, AbstractTagState renderState)
+ {
+ assert(sb != null) : "Parameter 'sb' must not be null";
+ assert(renderState != null) : "Parameter 'renderState' must not be null";
+ assert(renderState instanceof State) : "Paramater 'renderState' must be an instance of CaptionTag.State";
+
+ State state = (State) renderState;
+
+ renderTag(sb, CAPTION);
+
+ renderAttribute(sb, ID, state.id);
+ renderAttribute(sb, CLASS, state.styleClass);
+
+ renderAttributes(AbstractHtmlState.ATTR_GENERAL, sb, state);
+ renderAttribute(sb, STYLE, state.style);
+ renderAttributes(AbstractHtmlState.ATTR_JAVASCRIPT, sb, state);
+ sb.append(">");
+ }
+
+ public void doEndTag(Appender sb)
+ {
+ renderEndTag(sb, CAPTION);
+ }
+ }
+}
Propchange: beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/CaptionTag.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/ConstantRendering.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/ConstantRendering.java?rev=326581&view=auto
==============================================================================
--- beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/ConstantRendering.java (added)
+++ beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/ConstantRendering.java Wed Oct 19 08:29:22 2005
@@ -0,0 +1,80 @@
+/*
+ * 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.rendering;
+
+import org.apache.beehive.netui.simpletags.appender.Appender;
+
+/**
+ * This class will render the constant HTML used by the tags
+ */
+abstract public class ConstantRendering
+{
+ abstract public void BR(Appender sb);
+
+ public void TR_TD(Appender sb)
+ {
+ sb.append("<tr><td>");
+ }
+
+ public void end_TD_TR(Appender sb)
+ {
+ sb.append("</td></tr>");
+ }
+
+ public void TABLE(Appender sb)
+ {
+ sb.append("<table>");
+ }
+
+ public void end_TABLE(Appender sb)
+ {
+ sb.append("</table>");
+ }
+
+ public void NBSP(Appender sb)
+ {
+ sb.append(" ");
+ }
+
+ private static class HtmlConstants extends ConstantRendering
+ {
+ public void BR(Appender sb)
+ {
+ sb.append("<br>");
+ }
+ }
+
+ private static class XhtmlConstants extends ConstantRendering
+ {
+ public void BR(Appender sb)
+ {
+ sb.append("<br />");
+ }
+ }
+
+ public static ConstantRendering getRendering(int type)
+ {
+
+ if (type == TagRenderingBase.HTML_RENDERING)
+ return new HtmlConstants();
+ if (type == TagRenderingBase.XHTML_RENDERING)
+ return new XhtmlConstants();
+ assert (false) : "Didn't find the requested contant renderer:" + type;
+ return null;
+ }
+}
Propchange: beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/ConstantRendering.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/DivTag.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/DivTag.java?rev=326581&view=auto
==============================================================================
--- beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/DivTag.java (added)
+++ beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/DivTag.java Wed Oct 19 08:29:22 2005
@@ -0,0 +1,70 @@
+/*
+ * 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.rendering;
+
+import org.apache.beehive.netui.simpletags.html.HtmlConstants;
+import org.apache.beehive.netui.simpletags.appender.Appender;
+
+import java.util.HashMap;
+
+/**
+ * Div, Start Tag: optional, End tag: optional
+ */
+public abstract class DivTag extends TagHtmlBase
+{
+ public static void add(HashMap html, HashMap htmlQuirks, HashMap xhtml)
+ {
+ html.put(DIV_TAG, new Rendering());
+ htmlQuirks.put(DIV_TAG, new Rendering());
+ xhtml.put(DIV_TAG, new Rendering());
+ }
+
+ public static class State extends AbstractHtmlState
+ {
+ public void clear()
+ {
+ super.clear();
+ }
+ }
+
+ private static class Rendering extends DivTag implements HtmlConstants
+ {
+ public void doStartTag(Appender sb, AbstractTagState renderState)
+ {
+ assert(sb != null) : "Parameter 'sb' must not be null";
+ assert(renderState != null) : "Parameter 'renderState' must not be null";
+ assert(renderState instanceof State) : "Paramater 'renderState' must be an instance of SpanTag.State";
+
+ State state = (State) renderState;
+
+ renderTag(sb, DIV);
+ renderAttribute(sb, ID, state.id);
+ renderAttribute(sb, CLASS, state.styleClass);
+
+ renderAttributes(AbstractHtmlState.ATTR_GENERAL, sb, state);
+ renderAttribute(sb, STYLE, state.style);
+ renderAttributes(AbstractHtmlState.ATTR_JAVASCRIPT, sb, state);
+ sb.append(">");
+ }
+
+ public void doEndTag(Appender sb)
+ {
+ renderEndTag(sb, DIV);
+ }
+ }
+}
Propchange: beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/DivTag.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/FormTag.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/FormTag.java?rev=326581&view=auto
==============================================================================
--- beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/FormTag.java (added)
+++ beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/FormTag.java Wed Oct 19 08:29:22 2005
@@ -0,0 +1,94 @@
+/*
+ * 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.rendering;
+
+import org.apache.beehive.netui.simpletags.html.HtmlConstants;
+import org.apache.beehive.netui.simpletags.appender.Appender;
+
+import java.util.HashMap;
+
+/**
+ * Renderthe HTML <form> element. In HTML 4.01 both the start and end tag are rquired.
+ * The action is a required attribute.
+ */
+public abstract class FormTag extends TagHtmlBase implements HtmlConstants
+{
+ public static void add(HashMap html, HashMap htmlQuirks, HashMap xhtml)
+ {
+ html.put(FORM_TAG, new HtmlRendering());
+ htmlQuirks.put(FORM_TAG, new HtmlRendering());
+ xhtml.put(FORM_TAG, new XhtmlRendering());
+ }
+
+ public static class State extends AbstractHtmlState
+ {
+ public String name;
+ public String method;
+ public String action;
+
+ public void clear()
+ {
+ super.clear();
+
+ name = null;
+ method = null;
+ action = null;
+ }
+ }
+
+ public void doStartTag(Appender sb, AbstractTagState renderState)
+ {
+ State state = (State) renderState;
+
+ renderTag(sb, FORM);
+ renderNameAndId(sb, state);
+ renderAttribute(sb, ACTION, state.action);
+ renderAttribute(sb, CLASS, state.styleClass);
+ renderAttribute(sb, METHOD, state.method);
+
+ renderAttributes(AbstractHtmlState.ATTR_GENERAL, sb, state);
+ renderAttribute(sb, STYLE, state.style);
+ renderAttributes(AbstractHtmlState.ATTR_JAVASCRIPT, sb, state);
+
+ sb.append(">");
+ }
+
+ public void doEndTag(Appender sb)
+ {
+ renderEndTag(sb, FORM);
+ }
+
+ abstract void renderNameAndId(Appender sb, State renderState);
+
+ private static class HtmlRendering extends FormTag
+ {
+ public void renderNameAndId(Appender sb, State state)
+ {
+ renderAttribute(sb, NAME, state.name);
+ renderAttribute(sb, ID, state.id);
+ }
+ }
+
+ private static class XhtmlRendering extends FormTag
+ {
+ public void renderNameAndId(Appender sb, State state)
+ {
+ renderAttribute(sb, ID, state.name);
+ }
+ }
+}
Propchange: beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/FormTag.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/HtmlTag.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/HtmlTag.java?rev=326581&view=auto
==============================================================================
--- beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/HtmlTag.java (added)
+++ beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/HtmlTag.java Wed Oct 19 08:29:22 2005
@@ -0,0 +1,113 @@
+/*
+ * 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.rendering;
+
+import org.apache.beehive.netui.simpletags.html.HtmlConstants;
+import org.apache.beehive.netui.simpletags.appender.Appender;
+
+import java.util.HashMap;
+
+/**
+ * Renderthe HTML <form> element. In HTML 4.01 both the start and end tag are rquired.
+ * The action is a required attribute.
+ */
+abstract public class HtmlTag extends TagHtmlBase implements HtmlConstants
+{
+ public static void add(HashMap html, HashMap htmlQuirks, HashMap xhtml)
+ {
+ html.put(HTML_TAG, new HtmlTag.HtmlRendering());
+ htmlQuirks.put(HTML_TAG, new HtmlTag.HtmlQuirksRendering());
+ xhtml.put(HTML_TAG, new HtmlTag.XhtmlRendering());
+ }
+
+ public static class State extends AbstractAttributeState
+ {
+ public String lang;
+ public String dir;
+
+ public void clear()
+ {
+ super.clear();
+
+ lang = null;
+ dir = null;
+ }
+ }
+
+ public void doStartTag(Appender sb, AbstractTagState renderState)
+ {
+ State state = (State) renderState;
+
+ renderDocType(sb);
+ sb.append("\n");
+ renderTag(sb, HTML);
+ renderAttribute(sb, LANG, state.lang);
+ renderAttribute(sb, DIR, state.dir);
+ renderAdditionalAttributes(sb, state);
+ renderAttributes(AbstractHtmlState.ATTR_GENERAL, sb, state);
+
+ sb.append(">");
+ }
+
+ public void doEndTag(Appender sb)
+ {
+ renderEndTag(sb, HTML);
+ }
+
+ abstract protected void renderAdditionalAttributes(Appender sb, State renderState);
+
+ abstract protected void renderDocType(Appender sb);
+
+ private static class HtmlRendering extends HtmlTag
+ {
+ protected void renderDocType(Appender sb)
+ {
+ sb.append("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\n\t\"http://www.w3.org/TR/html4/loose.dtd\">");
+ }
+
+ protected void renderAdditionalAttributes(Appender sb, State renderState)
+ {
+ }
+ }
+
+ private static class HtmlQuirksRendering extends HtmlTag
+ {
+ protected void renderDocType(Appender sb)
+ {
+ sb.append("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\n>");
+ }
+
+ protected void renderAdditionalAttributes(Appender sb, State renderState)
+ {
+ }
+ }
+
+ private static class XhtmlRendering extends HtmlTag
+ {
+ protected void renderDocType(Appender sb)
+ {
+ sb.append("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n\t\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">");
+ }
+
+ protected void renderAdditionalAttributes(Appender sb, State renderState)
+ {
+ renderAttribute(sb, "xml:lang", renderState.lang);
+ renderAttribute(sb, "xmlns", "http://www.w3.org/1999/xhtml");
+ }
+ }
+}
Propchange: beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/HtmlTag.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/ImageTag.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/ImageTag.java?rev=326581&view=auto
==============================================================================
--- beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/ImageTag.java (added)
+++ beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/ImageTag.java Wed Oct 19 08:29:22 2005
@@ -0,0 +1,91 @@
+/*
+ * 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.rendering;
+
+import org.apache.beehive.netui.simpletags.html.HtmlConstants;
+import org.apache.beehive.netui.simpletags.appender.Appender;
+
+import java.util.HashMap;
+
+/**
+ * Render the HTML <img> element. In HTML 4.01, the start tag is required and end tag forbidden.
+ * The attributes src and alt are both required.
+ */
+abstract public class ImageTag extends TagHtmlBase implements HtmlConstants
+{
+ public static void add(HashMap html, HashMap htmlQuirks, HashMap xhtml)
+ {
+ html.put(IMAGE_TAG, new HtmlRendering());
+ htmlQuirks.put(IMAGE_TAG, new HtmlRendering());
+ xhtml.put(IMAGE_TAG, new XhtmlRendering());
+ }
+
+ public static class State extends AbstractHtmlState
+ {
+ public String src;
+
+ public void clear()
+ {
+ super.clear();
+
+ src = null;
+ }
+ }
+
+ public void doStartTag(Appender sb, AbstractTagState renderState)
+ {
+ assert(sb != null) : "Parameter 'sb' must not be null";
+ assert(renderState != null) : "Parameter 'renderState' must not be null";
+ assert(renderState instanceof State) : "Paramater 'renderState' must be an instance of ImageTag.State";
+
+ State state = (State) renderState;
+
+ renderTag(sb, IMAGE);
+ renderAttribute(sb, SRC, state.src);
+ renderAttribute(sb, ID, state.id);
+
+ renderAttribute(sb, STYLE, state.style);
+ renderAttribute(sb, CLASS, state.styleClass);
+ renderAttributes(AbstractHtmlState.ATTR_GENERAL, sb, state);
+ renderAttributes(AbstractHtmlState.ATTR_JAVASCRIPT, sb, state);
+
+ writeEnd(sb);
+ }
+
+ public void doEndTag(Appender sb)
+ {
+ }
+
+ abstract protected void writeEnd(Appender sb);
+
+ private static class HtmlRendering extends ImageTag
+ {
+ protected void writeEnd(Appender sb)
+ {
+ sb.append(">");
+ }
+ }
+
+ private static class XhtmlRendering extends ImageTag
+ {
+ protected void writeEnd(Appender sb)
+ {
+ sb.append(" />");
+ }
+ }
+}
Propchange: beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/ImageTag.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/InputBooleanTag.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/InputBooleanTag.java?rev=326581&view=auto
==============================================================================
--- beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/InputBooleanTag.java (added)
+++ beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/InputBooleanTag.java Wed Oct 19 08:29:22 2005
@@ -0,0 +1,132 @@
+/*
+ * 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.rendering;
+
+import org.apache.beehive.netui.simpletags.html.HtmlConstants;
+import org.apache.beehive.netui.simpletags.appender.Appender;
+
+import java.util.HashMap;
+
+/**
+ * Render and HTML <input> element of either type checkbox or radio. In HTML 4.01 the start
+ * tag is required and the end tag is forbidden. There are no required attributes.
+ */
+abstract public class InputBooleanTag extends TagHtmlBase implements HtmlConstants
+{
+ public static void add(HashMap html, HashMap htmlQuirks, HashMap xhtml)
+ {
+ html.put(INPUT_BOOLEAN_TAG, new HtmlRendering());
+ htmlQuirks.put(INPUT_BOOLEAN_TAG, new HtmlRendering());
+ xhtml.put(INPUT_BOOLEAN_TAG, new XhtmlRendering());
+ }
+
+ public static class State extends AbstractHtmlControlState
+ {
+ public String type;
+ public boolean disabled;
+ public boolean checked;
+ public String value;
+
+ public void clear()
+ {
+ super.clear();
+
+ type = null;
+ disabled = false;
+ checked = false;
+ value = null;
+ }
+ }
+
+ public void doStartTag(Appender sb, AbstractTagState renderState)
+ {
+ assert(sb != null) : "Parameter 'sb' must not be null";
+ assert(renderState != null) : "Parameter 'renderState' must not be null";
+ assert(renderState instanceof State) : "Paramater 'renderState' must be an instance of InputBooleanTag.State";
+
+ State state = (State) renderState;
+
+ // Generate an HTML input element
+ // Create an appropriate "input" element based on our parameters
+ renderTag(sb, INPUT);
+ renderAttribute(sb, TYPE, state.type);
+ renderAttribute(sb, NAME, state.name);
+ renderAttribute(sb, ID, state.id);
+ renderAttribute(sb, CLASS, state.styleClass);
+ renderAttribute(sb, VALUE, state.value);
+ renderDisabled(sb, state.disabled);
+ renderChecked(sb, state.checked);
+
+ renderAttributes(AbstractHtmlState.ATTR_GENERAL, sb, state);
+ renderAttribute(sb, STYLE, state.style);
+ renderAttributes(AbstractHtmlState.ATTR_JAVASCRIPT, sb, state);
+ writeEnd(sb);
+ }
+
+ public void doEndTag(Appender sb)
+ {
+ }
+
+ abstract protected void writeEnd(Appender sb);
+
+ abstract protected void renderDisabled(Appender sb, boolean disabled);
+
+ abstract protected void renderChecked(Appender sb, boolean checked);
+
+ private static class HtmlRendering extends InputBooleanTag
+ {
+ protected void writeEnd(Appender sb)
+ {
+ sb.append(">");
+ }
+
+ protected void renderDisabled(Appender sb, boolean disabled)
+ {
+ if (disabled)
+ sb.append(" " + DISABLED);
+
+ }
+
+ protected void renderChecked(Appender sb, boolean checked)
+ {
+ if (checked)
+ sb.append(" " + CHECKED);
+
+ }
+ }
+
+ private static class XhtmlRendering extends InputBooleanTag
+ {
+ protected void writeEnd(Appender sb)
+ {
+ sb.append(" />");
+ }
+
+ protected void renderDisabled(Appender sb, boolean disabled)
+ {
+ if (disabled)
+ renderAttribute(sb, DISABLED, DISABLED);
+ }
+
+ protected void renderChecked(Appender sb, boolean checked)
+ {
+ if (checked)
+ renderAttribute(sb, CHECKED, CHECKED);
+ }
+ }
+}
Propchange: beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/InputBooleanTag.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/InputFileTag.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/InputFileTag.java?rev=326581&view=auto
==============================================================================
--- beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/InputFileTag.java (added)
+++ beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/InputFileTag.java Wed Oct 19 08:29:22 2005
@@ -0,0 +1,110 @@
+/*
+ * 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.rendering;
+
+import org.apache.beehive.netui.simpletags.html.HtmlConstants;
+import org.apache.beehive.netui.simpletags.appender.Appender;
+
+import java.util.HashMap;
+
+/**
+ * Body, Start Tag: required, End tag: forbidden
+ * Required href
+ */
+abstract public class InputFileTag extends TagHtmlBase implements HtmlConstants
+{
+ public static void add(HashMap html, HashMap htmlQuirks, HashMap xhtml)
+ {
+ html.put(INPUT_FILE_TAG, new HtmlRendering());
+ htmlQuirks.put(INPUT_FILE_TAG, new HtmlRendering());
+ xhtml.put(INPUT_FILE_TAG, new XhtmlRendering());
+ }
+
+ public static class State extends AbstractHtmlControlState
+ {
+ public boolean readonly;
+
+ public void clear()
+ {
+ super.clear();
+
+ readonly = false;
+ }
+ }
+
+ public void doStartTag(Appender sb, AbstractTagState renderState)
+ {
+ assert(sb != null) : "Parameter 'sb' must not be null";
+ assert(renderState != null) : "Parameter 'renderState' must not be null";
+ assert(renderState instanceof State) : "Paramater 'renderState' must be an instance of InputFileTag.State";
+
+ State state = (State) renderState;
+
+ // Generate an HTML element
+ renderTag(sb, INPUT);
+ renderAttribute(sb, TYPE, INPUT_FILE);
+ renderAttribute(sb, NAME, state.name);
+ renderAttribute(sb, ID, state.id);
+ renderAttribute(sb, CLASS, state.styleClass);
+ renderReadOnly(sb, state.readonly);
+
+ renderAttributes(AbstractHtmlState.ATTR_GENERAL, sb, state);
+ renderAttribute(sb, STYLE, state.style);
+ renderAttributes(AbstractHtmlState.ATTR_JAVASCRIPT, sb, state);
+ writeEnd(sb);
+ }
+
+ public void doEndTag(Appender sb)
+ {
+ }
+
+ abstract protected void writeEnd(Appender sb);
+
+ abstract protected void renderReadOnly(Appender sb, boolean readonly);
+
+
+ private static class HtmlRendering extends InputFileTag
+ {
+ protected void writeEnd(Appender sb)
+ {
+ sb.append(">");
+ }
+
+ protected void renderReadOnly(Appender sb, boolean readonly)
+ {
+ if (readonly)
+ sb.append(" readonly");
+
+ }
+ }
+
+ private static class XhtmlRendering extends InputFileTag
+ {
+ protected void writeEnd(Appender sb)
+ {
+ sb.append(" />");
+ }
+
+ protected void renderReadOnly(Appender sb, boolean readonly)
+ {
+ if (readonly)
+ renderAttribute(sb, "readonly", "readonly");
+
+ }
+ }
+}
Propchange: beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/InputFileTag.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/InputHiddenTag.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/InputHiddenTag.java?rev=326581&view=auto
==============================================================================
--- beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/InputHiddenTag.java (added)
+++ beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/InputHiddenTag.java Wed Oct 19 08:29:22 2005
@@ -0,0 +1,92 @@
+/*
+ * 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.rendering;
+
+import org.apache.beehive.netui.simpletags.html.HtmlConstants;
+import org.apache.beehive.netui.simpletags.appender.Appender;
+
+import java.util.HashMap;
+
+/**
+ * Body, Start Tag: required, End tag: forbidden
+ * Required href
+ */
+abstract public class InputHiddenTag extends TagHtmlBase implements HtmlConstants
+{
+ public static void add(HashMap html, HashMap htmlQuirks, HashMap xhtml)
+ {
+ html.put(INPUT_HIDDEN_TAG, new HtmlRendering());
+ htmlQuirks.put(INPUT_HIDDEN_TAG, new HtmlRendering());
+ xhtml.put(INPUT_HIDDEN_TAG, new XhtmlRendering());
+ }
+
+ public static class State extends AbstractHtmlControlState
+ {
+ public String value;
+
+ public void clear()
+ {
+ super.clear();
+
+ value = null;
+ }
+ }
+
+ public void doStartTag(Appender sb, AbstractTagState renderState)
+ {
+ assert(sb != null) : "Parameter 'sb' must not be null";
+ assert(renderState != null) : "Parameter 'renderState' must not be null";
+ assert(renderState instanceof State) : "Paramater 'renderState' must be an instance of InputHiddenTag.State";
+
+ State state = (State) renderState;
+
+ // Generate an HTML element
+ renderTag(sb, INPUT);
+ renderAttribute(sb, TYPE, INPUT_HIDDEN);
+ renderAttribute(sb, ID, state.id);
+ renderAttribute(sb, NAME, state.name);
+ renderAttribute(sb, VALUE, state.value);
+
+ renderAttributes(AbstractHtmlState.ATTR_GENERAL, sb, state);
+ renderAttribute(sb, STYLE, state.style);
+ renderAttributes(AbstractHtmlState.ATTR_JAVASCRIPT, sb, state);
+ writeEnd(sb);
+ }
+
+ public void doEndTag(Appender sb)
+ {
+ }
+
+ abstract protected void writeEnd(Appender sb);
+
+ private static class HtmlRendering extends InputHiddenTag
+ {
+ protected void writeEnd(Appender sb)
+ {
+ sb.append(">");
+ }
+ }
+
+ private static class XhtmlRendering extends InputHiddenTag
+ {
+ protected void writeEnd(Appender sb)
+ {
+ sb.append(" />");
+ }
+ }
+}
Propchange: beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/InputHiddenTag.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/InputImageTag.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/InputImageTag.java?rev=326581&view=auto
==============================================================================
--- beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/InputImageTag.java (added)
+++ beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/InputImageTag.java Wed Oct 19 08:29:22 2005
@@ -0,0 +1,117 @@
+/*
+ * 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.rendering;
+
+import org.apache.beehive.netui.simpletags.html.HtmlConstants;
+import org.apache.beehive.netui.simpletags.appender.Appender;
+
+import java.util.HashMap;
+
+/**
+ * Body, Start Tag: required, End tag: forbidden
+ * Required href
+ */
+abstract public class InputImageTag extends TagHtmlBase implements HtmlConstants
+{
+ public static void add(HashMap html, HashMap htmlQuirks, HashMap xhtml)
+ {
+ html.put(INPUT_IMAGE_TAG, new HtmlRendering());
+ htmlQuirks.put(INPUT_IMAGE_TAG, new HtmlRendering());
+ xhtml.put(INPUT_IMAGE_TAG, new XhtmlRendering());
+ }
+
+ public static class State extends AbstractHtmlState
+ {
+ public String src;
+ public String value;
+ public boolean disabled;
+
+ public void clear()
+ {
+ super.clear();
+ src = null;
+ value = null;
+ disabled = false;
+ }
+ }
+
+ public void doStartTag(Appender sb, AbstractTagState renderState)
+ {
+ assert(sb != null) : "Parameter 'sb' must not be null";
+ assert(renderState != null) : "Parameter 'renderState' must not be null";
+ assert(renderState instanceof State) : "Paramater 'renderState' must be an instance of InputImageTag.State";
+
+ State state = (State) renderState;
+
+ // Generate an HTML element
+ renderTag(sb, INPUT);
+ renderAttribute(sb, TYPE, INPUT_IMAGE);
+ renderAttribute(sb, ID, state.id);
+ renderAttribute(sb, CLASS, state.styleClass);
+ renderAttribute(sb, SRC, state.src);
+ renderAttribute(sb, VALUE, state.value);
+
+ renderDisabled(sb, state.disabled);
+
+
+ renderAttributes(AbstractHtmlState.ATTR_GENERAL, sb, state);
+ renderAttribute(sb, STYLE, state.style);
+ renderAttributes(AbstractHtmlState.ATTR_JAVASCRIPT, sb, state);
+
+ writeEnd(sb);
+ }
+
+ public void doEndTag(Appender sb)
+ {
+ }
+
+ abstract protected void writeEnd(Appender sb);
+
+ abstract protected void renderDisabled(Appender sb, boolean disabled);
+
+
+ private static class HtmlRendering extends InputImageTag
+ {
+ protected void writeEnd(Appender sb)
+ {
+ sb.append(">");
+ }
+
+ protected void renderDisabled(Appender sb, boolean disabled)
+ {
+ if (disabled)
+ sb.append(" disabled");
+
+ }
+
+ }
+
+ private static class XhtmlRendering extends InputImageTag
+ {
+ protected void writeEnd(Appender sb)
+ {
+ sb.append(" />");
+ }
+
+ protected void renderDisabled(Appender sb, boolean disabled)
+ {
+ if (disabled)
+ renderAttribute(sb, "disabled", "disabled");
+ }
+ }
+}
Propchange: beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/InputImageTag.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/InputSubmitTag.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/InputSubmitTag.java?rev=326581&view=auto
==============================================================================
--- beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/InputSubmitTag.java (added)
+++ beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/InputSubmitTag.java Wed Oct 19 08:29:22 2005
@@ -0,0 +1,118 @@
+/*
+ * 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.rendering;
+
+import org.apache.beehive.netui.simpletags.html.HtmlConstants;
+import org.apache.beehive.netui.simpletags.appender.Appender;
+
+import java.util.HashMap;
+
+/**
+ * Body, Start Tag: required, End tag: forbidden
+ * Required href
+ */
+abstract public class InputSubmitTag extends TagHtmlBase implements HtmlConstants
+{
+ public static void add(HashMap html, HashMap htmlQuirks, HashMap xhtml)
+ {
+ html.put(INPUT_SUBMIT_TAG, new HtmlRendering());
+ htmlQuirks.put(INPUT_SUBMIT_TAG, new HtmlRendering());
+ xhtml.put(INPUT_SUBMIT_TAG, new XhtmlRendering());
+ }
+
+ public static class State extends AbstractHtmlControlState
+ {
+ public String type;
+ public boolean disabled;
+ public String value;
+
+ public void clear()
+ {
+ super.clear();
+
+ type = null;
+ disabled = false;
+ value = null;
+ }
+ }
+
+ public void doStartTag(Appender sb, AbstractTagState renderState)
+ {
+ assert(sb != null) : "Parameter 'sb' must not be null";
+ assert(renderState != null) : "Parameter 'renderState' must not be null";
+ assert(renderState instanceof State) : "Paramater 'renderState' must be an instance of InputSubmitTag.State";
+
+ State state = (State) renderState;
+
+ // Generate an HTML element
+ renderTag(sb, INPUT);
+ if (state.type == null)
+ state.type = INPUT_SUBMIT;
+ renderAttribute(sb, TYPE, state.type);
+ renderAttribute(sb, NAME, state.name);
+ renderAttribute(sb, ID, state.id);
+ renderAttribute(sb, CLASS, state.styleClass);
+ renderAttribute(sb, VALUE, state.value);
+
+ renderDisabled(sb, state.disabled);
+
+ renderAttributes(AbstractHtmlState.ATTR_GENERAL, sb, state);
+ renderAttribute(sb, STYLE, state.style);
+ renderAttributes(AbstractHtmlState.ATTR_JAVASCRIPT, sb, state);
+ writeEnd(sb);
+ }
+
+ public void doEndTag(Appender sb)
+ {
+ }
+
+ abstract protected void writeEnd(Appender sb);
+
+ abstract protected void renderDisabled(Appender sb, boolean disabled);
+
+
+ private static class HtmlRendering extends InputSubmitTag
+ {
+ protected void writeEnd(Appender sb)
+ {
+ sb.append(">");
+ }
+
+ protected void renderDisabled(Appender sb, boolean disabled)
+ {
+ if (disabled)
+ sb.append(" disabled");
+
+ }
+
+ }
+
+ private static class XhtmlRendering extends InputSubmitTag
+ {
+ protected void writeEnd(Appender sb)
+ {
+ sb.append(" />");
+ }
+
+ protected void renderDisabled(Appender sb, boolean disabled)
+ {
+ if (disabled)
+ renderAttribute(sb, "disabled", "disabled");
+ }
+ }
+}
Propchange: beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/InputSubmitTag.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/InputTextTag.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/InputTextTag.java?rev=326581&view=auto
==============================================================================
--- beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/InputTextTag.java (added)
+++ beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/InputTextTag.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.rendering;
+
+import org.apache.beehive.netui.simpletags.html.HtmlConstants;
+import org.apache.beehive.netui.simpletags.appender.Appender;
+
+import java.util.HashMap;
+
+/**
+ * Body, Start Tag: required, End tag: forbidden
+ * Required href
+ */
+abstract public class InputTextTag extends TagHtmlBase
+ implements HtmlConstants
+{
+ public static void add(HashMap html, HashMap htmlQuirks, HashMap xhtml)
+ {
+ html.put(INPUT_TEXT_TAG, new HtmlRendering());
+ htmlQuirks.put(INPUT_TEXT_TAG, new HtmlRendering());
+ xhtml.put(INPUT_TEXT_TAG, new XhtmlRendering());
+ }
+
+ public static class State extends AbstractHtmlControlState
+ {
+ public String type;
+ public boolean disabled;
+ public int maxlength;
+ public int size;
+ public String value;
+ public boolean readonly;
+
+ public void clear()
+ {
+ super.clear();
+
+ type = null;
+ disabled = false;
+ maxlength = 0;
+ size = 0;
+ value = null;
+ readonly = false;
+ }
+ }
+
+ public void doStartTag(Appender sb, AbstractTagState renderState)
+ {
+ assert(sb != null) : "Parameter 'sb' must not be null";
+ assert(renderState != null) : "Parameter 'renderState' must not be null";
+ assert(renderState instanceof State) : "Paramater 'renderState' must be an instance of AnchorTag.State";
+
+ State state = (State) renderState;
+
+ // Generate an HTML element
+ renderTag(sb, INPUT);
+ if (state.type == null)
+ state.type = INPUT_TEXT;
+
+ renderAttribute(sb, TYPE, state.type);
+ renderAttribute(sb, NAME, state.name);
+ renderAttribute(sb, ID, state.id);
+ renderAttribute(sb, CLASS, state.styleClass);
+ renderAttribute(sb, VALUE, state.value);
+
+ if (state.maxlength > 0)
+ renderAttribute(sb, MAXLENGTH, Integer.toString(state.maxlength));
+ if (state.size > 0)
+ renderAttribute(sb, SIZE, Integer.toString(state.size));
+ renderDisabled(sb, state.disabled);
+ renderReadonly(sb, state.readonly);
+
+ renderAttributes(AbstractHtmlState.ATTR_GENERAL, sb, state);
+ renderAttribute(sb, STYLE, state.style);
+ renderAttributes(AbstractHtmlState.ATTR_JAVASCRIPT, sb, state);
+ writeEnd(sb);
+ }
+
+ public void doEndTag(Appender sb)
+ {
+ }
+
+ abstract protected void writeEnd(Appender sb);
+
+ abstract protected void renderDisabled(Appender sb, boolean disabled);
+
+ abstract protected void renderReadonly(Appender sb, boolean readonly);
+
+ private static class HtmlRendering extends InputTextTag
+ {
+ protected void writeEnd(Appender sb)
+ {
+ sb.append(">");
+ }
+
+ protected void renderDisabled(Appender sb, boolean disabled)
+ {
+ if (disabled)
+ sb.append(" disabled");
+ }
+
+ protected void renderReadonly(Appender sb, boolean readonly)
+ {
+ if (readonly)
+ sb.append(" readonly");
+ }
+ }
+
+ private static class XhtmlRendering extends InputTextTag
+ {
+ protected void writeEnd(Appender sb)
+ {
+ sb.append(" />");
+ }
+
+ protected void renderDisabled(Appender sb, boolean disabled)
+ {
+ if (disabled)
+ renderAttribute(sb, "disabled", "disabled");
+ }
+
+ protected void renderReadonly(Appender sb, boolean readonly)
+ {
+ if (readonly)
+ renderAttribute(sb, "readonly", "readonly");
+ }
+
+ }
+}
Propchange: beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/InputTextTag.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/LabelTag.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/LabelTag.java?rev=326581&view=auto
==============================================================================
--- beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/LabelTag.java (added)
+++ beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/LabelTag.java Wed Oct 19 08:29:22 2005
@@ -0,0 +1,77 @@
+/*
+ * 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.rendering;
+
+import org.apache.beehive.netui.simpletags.html.HtmlConstants;
+import org.apache.beehive.netui.simpletags.appender.Appender;
+
+import java.util.HashMap;
+
+/**
+ * Render the HTML <label> element. In HTML 4.01 the start and end tags are required.
+ */
+public abstract class LabelTag extends TagHtmlBase
+{
+ public static void add(HashMap html, HashMap htmlQuirks, HashMap xhtml)
+ {
+ html.put(LABEL_TAG, new Rendering());
+ htmlQuirks.put(LABEL_TAG, new Rendering());
+ xhtml.put(LABEL_TAG, new Rendering());
+ }
+
+ public static class State extends AbstractHtmlState
+ {
+ public String forAttr;
+ public String richDataSource;
+
+ public void clear()
+ {
+ super.clear();
+ forAttr = null;
+ richDataSource = null;
+ }
+ }
+
+ private static class Rendering extends LabelTag implements HtmlConstants
+ {
+ public void doStartTag(Appender sb, AbstractTagState renderState)
+ {
+ assert(sb != null) : "Parameter 'sb' must not be null";
+ assert(renderState != null) : "Parameter 'renderState' must not be null";
+ assert(renderState instanceof State) : "Paramater 'renderState' must be an instance of LabelTag.State";
+
+ State state = (State) renderState;
+
+
+ renderTag(sb, LABEL);
+ renderAttribute(sb, ID, state.id);
+ renderAttribute(sb, FOR, state.forAttr);
+ renderAttribute(sb, CLASS, state.styleClass);
+
+ renderAttributes(AbstractHtmlState.ATTR_GENERAL, sb, state);
+ renderAttribute(sb, STYLE, state.style);
+ renderAttributes(AbstractHtmlState.ATTR_JAVASCRIPT, sb, state);
+ sb.append(">");
+ }
+
+ public void doEndTag(Appender sb)
+ {
+ renderEndTag(sb, LABEL);
+ }
+ }
+}
Propchange: beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/LabelTag.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/OptionTag.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/OptionTag.java?rev=326581&view=auto
==============================================================================
--- beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/OptionTag.java (added)
+++ beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/OptionTag.java Wed Oct 19 08:29:22 2005
@@ -0,0 +1,114 @@
+/*
+ * 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.rendering;
+
+import org.apache.beehive.netui.simpletags.html.HtmlConstants;
+import org.apache.beehive.netui.simpletags.appender.Appender;
+
+import java.util.HashMap;
+
+/**
+ * Body, Start Tag: optional, End tag: optional
+ * Required href
+ */
+public abstract class OptionTag extends TagHtmlBase implements HtmlConstants
+{
+ public static void add(HashMap html, HashMap htmlQuirks, HashMap xhtml)
+ {
+ html.put(OPTION_TAG, new HtmlRendering());
+ htmlQuirks.put(OPTION_TAG, new HtmlRendering());
+ xhtml.put(OPTION_TAG, new XhtmlRendering());
+ }
+
+ public static class State extends AbstractHtmlState
+ {
+ public String value;
+ public boolean disabled;
+ public boolean selected;
+
+ public void clear()
+ {
+ super.clear();
+
+ value = null;
+ disabled = false;
+ selected = false;
+ }
+ }
+
+ public void doStartTag(Appender sb, AbstractTagState renderState)
+ {
+ assert(sb != null) : "Parameter 'sb' must not be null";
+ assert(renderState != null) : "Parameter 'renderState' must not be null";
+ assert(renderState instanceof State) : "Paramater 'renderState' must be an instance of OptionTag.State";
+
+ State state = (State) renderState;
+
+ renderTag(sb, OPTION);
+ renderAttribute(sb, ID, state.id);
+ renderAttribute(sb, CLASS, state.styleClass);
+ renderAttribute(sb, VALUE, state.value);
+ renderDisabled(sb, state.disabled);
+ renderSelected(sb, state.selected);
+
+
+ renderAttributes(AbstractHtmlState.ATTR_GENERAL, sb, state);
+ renderAttribute(sb, STYLE, state.style);
+ renderAttributes(AbstractHtmlState.ATTR_JAVASCRIPT, sb, state);
+ sb.append(">");
+ }
+
+ public void doEndTag(Appender sb)
+ {
+ renderEndTag(sb, OPTION);
+ }
+
+ abstract protected void renderDisabled(Appender sb, boolean disabled);
+
+ abstract protected void renderSelected(Appender sb, boolean selected);
+
+ private static class HtmlRendering extends OptionTag
+ {
+ protected void renderDisabled(Appender sb, boolean disabled)
+ {
+ if (disabled)
+ sb.append(" disabled");
+ }
+
+ protected void renderSelected(Appender sb, boolean selected)
+ {
+ if (selected)
+ sb.append(" selected");
+ }
+ }
+
+ private static class XhtmlRendering extends OptionTag
+ {
+ protected void renderDisabled(Appender sb, boolean disabled)
+ {
+ if (disabled)
+ renderAttribute(sb, "disabled", "disabled");
+ }
+
+ protected void renderSelected(Appender sb, boolean selected)
+ {
+ if (selected)
+ renderAttribute(sb, "selected", "selected");
+ }
+ }
+}
Propchange: beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/OptionTag.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/ScriptTag.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/ScriptTag.java?rev=326581&view=auto
==============================================================================
--- beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/ScriptTag.java (added)
+++ beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/ScriptTag.java Wed Oct 19 08:29:22 2005
@@ -0,0 +1,98 @@
+/*
+ * 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.rendering;
+
+import org.apache.beehive.netui.simpletags.html.HtmlConstants;
+import org.apache.beehive.netui.simpletags.appender.Appender;
+
+import java.util.HashMap;
+
+public abstract class ScriptTag extends TagHtmlBase
+{
+ public static void add(HashMap html, HashMap htmlQuirks, HashMap xhtml)
+ {
+ html.put(SCRIPT_TAG, new ScriptTag.Rendering());
+ htmlQuirks.put(SCRIPT_TAG, new ScriptTag.Rendering());
+ xhtml.put(SCRIPT_TAG, new ScriptTag.Rendering());
+ }
+
+ public static class State extends AbstractAttributeState
+ {
+ public String type;
+ public String src;
+ public String language;
+ public boolean suppressComments = true;
+
+ public void clear()
+ {
+ super.clear();
+ type = null;
+ src = null;
+ language = null;
+ suppressComments = true;
+ }
+ }
+
+ public abstract void doEndTag(Appender sb, boolean supressComments);
+
+ private static class Rendering extends ScriptTag implements HtmlConstants
+ {
+ public void doStartTag(Appender sb, AbstractTagState renderState)
+ {
+ assert(sb != null) : "Parameter 'sb' must not be null";
+ assert(renderState != null) : "Parameter 'renderState' must not be null";
+ assert(renderState instanceof State) : "Paramater 'renderState' must be an instance of SpanTag.State";
+
+ State state = (State) renderState;
+
+ renderTag(sb, SCRIPT);
+
+ if (state.language == null) {
+ // @todo: this should be all lower case!
+ state.language = "JavaScript";
+ }
+ if (state.type == null) {
+ // @todo: this should be all lower case!
+ state.type = "text/JavaScript";
+ }
+
+ renderAttribute(sb, LANGUAGE, state.language);
+ renderAttribute(sb, TYPE, state.type);
+ renderAttribute(sb, SRC, state.src);
+
+ renderAttributes(AbstractHtmlState.ATTR_GENERAL, sb, state);
+ sb.append(">");
+
+ // for javascript will will continue put the script itself into html comments
+ if (!state.suppressComments)
+ sb.append("\n<!--\n");
+ }
+
+ public void doEndTag(Appender sb, boolean supressComments)
+ {
+ if (!supressComments)
+ sb.append("-->\n");
+ doEndTag(sb);
+ }
+
+ public void doEndTag(Appender sb)
+ {
+ renderEndTag(sb, SCRIPT);
+ }
+ }
+}
Propchange: beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/ScriptTag.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/SelectTag.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/SelectTag.java?rev=326581&view=auto
==============================================================================
--- beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/SelectTag.java (added)
+++ beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/SelectTag.java Wed Oct 19 08:29:22 2005
@@ -0,0 +1,118 @@
+/*
+ * 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.rendering;
+
+import org.apache.beehive.netui.simpletags.html.HtmlConstants;
+import org.apache.beehive.netui.simpletags.appender.Appender;
+
+import java.util.HashMap;
+
+/**
+ * Body, Start Tag: optional, End tag: optional
+ * Required href
+ */
+public abstract class SelectTag extends TagHtmlBase implements HtmlConstants
+{
+ public static void add(HashMap html, HashMap htmlQuirks, HashMap xhtml)
+ {
+ html.put(SELECT_TAG, new HtmlRendering());
+ htmlQuirks.put(SELECT_TAG, new HtmlRendering());
+ xhtml.put(SELECT_TAG, new XhtmlRendering());
+ }
+
+ public static class State extends AbstractHtmlControlState
+ {
+ public boolean disabled;
+ public boolean multiple;
+ public int size;
+
+ public void clear()
+ {
+ super.clear();
+ disabled = false;
+ multiple = false;
+ size = 0;
+ }
+ }
+
+ public void doStartTag(Appender sb, AbstractTagState renderState)
+ {
+ assert(sb != null) : "Parameter 'sb' must not be null";
+ assert(renderState != null) : "Parameter 'renderState' must not be null";
+ assert(renderState instanceof State) : "Paramater 'renderState' must be an instance of SelectTag.State";
+
+ State state = (State) renderState;
+
+ renderTag(sb, SELECT);
+ renderAttribute(sb, NAME, state.name);
+ renderAttribute(sb, ID, state.id);
+ renderAttribute(sb, CLASS, state.styleClass);
+ renderMultiple(sb, state.multiple);
+ renderDisabled(sb, state.disabled);
+ if (state.size > 0)
+ renderAttribute(sb, SIZE, Integer.toString(state.size));
+
+ renderAttributes(AbstractHtmlState.ATTR_GENERAL, sb, state);
+ renderAttribute(sb, STYLE, state.style);
+ renderAttributes(AbstractHtmlState.ATTR_JAVASCRIPT, sb, state);
+ sb.append(">");
+ }
+
+ public void doEndTag(Appender sb)
+ {
+ renderEndTag(sb, SELECT);
+ }
+
+ abstract protected void renderDisabled(Appender sb, boolean disabled);
+
+ abstract protected void renderMultiple(Appender sb, boolean readonly);
+
+ private static class HtmlRendering extends SelectTag
+ {
+ protected void renderDisabled(Appender sb, boolean disabled)
+ {
+ if (disabled)
+ sb.append(" disabled");
+
+ }
+
+ protected void renderMultiple(Appender sb, boolean multiple)
+ {
+ if (multiple)
+ sb.append(" multiple");
+
+ }
+ }
+
+ private static class XhtmlRendering extends SelectTag
+ {
+ protected void renderDisabled(Appender sb, boolean disabled)
+ {
+ if (disabled)
+ renderAttribute(sb, "disabled", "disabled");
+
+ }
+
+ protected void renderMultiple(Appender sb, boolean multiple)
+ {
+ if (multiple)
+ renderAttribute(sb, "multiple", "multiple");
+
+ }
+ }
+}
Propchange: beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/SelectTag.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/SpanTag.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/SpanTag.java?rev=326581&view=auto
==============================================================================
--- beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/SpanTag.java (added)
+++ beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/SpanTag.java Wed Oct 19 08:29:22 2005
@@ -0,0 +1,71 @@
+/*
+ * 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.rendering;
+
+import org.apache.beehive.netui.simpletags.html.HtmlConstants;
+import org.apache.beehive.netui.simpletags.appender.Appender;
+
+import java.util.HashMap;
+
+/**
+ * Body, Start Tag: optional, End tag: optional
+ * Required href
+ */
+public abstract class SpanTag extends TagHtmlBase
+{
+ public static void add(HashMap html, HashMap htmlQuirks, HashMap xhtml)
+ {
+ html.put(SPAN_TAG, new Rendering());
+ htmlQuirks.put(SPAN_TAG, new Rendering());
+ xhtml.put(SPAN_TAG, new Rendering());
+ }
+
+ public static class State extends AbstractHtmlState
+ {
+ public void clear()
+ {
+ super.clear();
+ }
+ }
+
+ private static class Rendering extends SpanTag implements HtmlConstants
+ {
+ public void doStartTag(Appender sb, AbstractTagState renderState)
+ {
+ assert(sb != null) : "Parameter 'sb' must not be null";
+ assert(renderState != null) : "Parameter 'renderState' must not be null";
+ assert(renderState instanceof State) : "Paramater 'renderState' must be an instance of SpanTag.State";
+
+ State state = (State) renderState;
+
+ renderTag(sb, SPAN);
+ renderAttribute(sb, ID, state.id);
+ renderAttribute(sb, CLASS, state.styleClass);
+
+ renderAttributes(AbstractHtmlState.ATTR_GENERAL, sb, state);
+ renderAttribute(sb, STYLE, state.style);
+ renderAttributes(AbstractHtmlState.ATTR_JAVASCRIPT, sb, state);
+ sb.append(">");
+ }
+
+ public void doEndTag(Appender sb)
+ {
+ renderEndTag(sb, SPAN);
+ }
+ }
+}
Propchange: beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/SpanTag.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/TBodyTag.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/TBodyTag.java?rev=326581&view=auto
==============================================================================
--- beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/TBodyTag.java (added)
+++ beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/TBodyTag.java Wed Oct 19 08:29:22 2005
@@ -0,0 +1,76 @@
+/*
+ * 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.rendering;
+
+import org.apache.beehive.netui.simpletags.html.HtmlConstants;
+import org.apache.beehive.netui.simpletags.appender.Appender;
+
+import java.util.HashMap;
+
+/**
+ *
+ */
+public abstract class TBodyTag
+ extends TagHtmlBase
+{
+
+ public static void add(HashMap html, HashMap htmlQuirks, HashMap xhtml)
+ {
+ html.put(TBODY_TAG, new TBodyTag.Rendering());
+ htmlQuirks.put(TBODY_TAG, new TBodyTag.Rendering());
+ xhtml.put(TBODY_TAG, new TBodyTag.Rendering());
+ }
+
+ public static class State
+ extends AbstractHtmlState
+ {
+ public void clear()
+ {
+ super.clear();
+ }
+ }
+
+ private static class Rendering
+ extends TBodyTag
+ implements HtmlConstants
+ {
+ public void doStartTag(Appender sb, AbstractTagState renderState)
+ {
+ assert(sb != null) : "Parameter 'sb' must not be null";
+ assert(renderState != null) : "Parameter 'renderState' must not be null";
+ assert(renderState instanceof State) : "Paramater 'renderState' must be an instance of TBodyTag.State";
+
+ State state = (State) renderState;
+
+ renderTag(sb, TBODY);
+
+ renderAttribute(sb, ID, state.id);
+ renderAttribute(sb, CLASS, state.styleClass);
+
+ renderAttributes(AbstractHtmlState.ATTR_GENERAL, sb, state);
+ renderAttribute(sb, STYLE, state.style);
+ renderAttributes(AbstractHtmlState.ATTR_JAVASCRIPT, sb, state);
+ sb.append(">");
+ }
+
+ public void doEndTag(Appender sb)
+ {
+ renderEndTag(sb, TBODY);
+ }
+ }
+}
Propchange: beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/TBodyTag.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/TFootTag.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/TFootTag.java?rev=326581&view=auto
==============================================================================
--- beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/TFootTag.java (added)
+++ beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/TFootTag.java Wed Oct 19 08:29:22 2005
@@ -0,0 +1,77 @@
+/*
+ * 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.rendering;
+
+import org.apache.beehive.netui.simpletags.html.HtmlConstants;
+import org.apache.beehive.netui.simpletags.appender.Appender;
+
+import java.util.HashMap;
+
+/**
+ *
+ */
+public abstract class TFootTag
+ extends TagHtmlBase
+{
+
+ public static void add(HashMap html, HashMap htmlQuirks, HashMap xhtml)
+ {
+ html.put(TFOOT_TAG, new TFootTag.Rendering());
+ htmlQuirks.put(TFOOT_TAG, new TFootTag.Rendering());
+ xhtml.put(TFOOT_TAG, new TFootTag.Rendering());
+ }
+
+ public static class State
+ extends AbstractHtmlState
+ {
+
+ public void clear()
+ {
+ super.clear();
+ }
+ }
+
+ private static class Rendering
+ extends TFootTag
+ implements HtmlConstants
+ {
+ public void doStartTag(Appender sb, AbstractTagState renderState)
+ {
+ assert(sb != null) : "Parameter 'sb' must not be null";
+ assert(renderState != null) : "Parameter 'renderState' must not be null";
+ assert(renderState instanceof State) : "Paramater 'renderState' must be an instance of TFootTag.State";
+
+ State state = (State) renderState;
+
+ renderTag(sb, TFOOT);
+
+ renderAttribute(sb, ID, state.id);
+ renderAttribute(sb, CLASS, state.styleClass);
+
+ renderAttributes(AbstractHtmlState.ATTR_GENERAL, sb, state);
+ renderAttribute(sb, STYLE, state.style);
+ renderAttributes(AbstractHtmlState.ATTR_JAVASCRIPT, sb, state);
+ sb.append(">");
+ }
+
+ public void doEndTag(Appender sb)
+ {
+ renderEndTag(sb, TFOOT);
+ }
+ }
+}
Propchange: beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/TFootTag.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/THeadTag.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/THeadTag.java?rev=326581&view=auto
==============================================================================
--- beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/THeadTag.java (added)
+++ beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/THeadTag.java Wed Oct 19 08:29:22 2005
@@ -0,0 +1,74 @@
+/*
+ * 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.rendering;
+
+import org.apache.beehive.netui.simpletags.html.HtmlConstants;
+import org.apache.beehive.netui.simpletags.appender.Appender;
+
+import java.util.HashMap;
+
+/**
+ * Body, Start Tag: optional, End tag: optional
+ * Required href
+ */
+public abstract class THeadTag
+ extends TagHtmlBase
+{
+ public static void add(HashMap html, HashMap htmlQuirks, HashMap xhtml)
+ {
+ html.put(THEAD_TAG, new THeadTag.Rendering());
+ htmlQuirks.put(THEAD_TAG, new THeadTag.Rendering());
+ xhtml.put(THEAD_TAG, new THeadTag.Rendering());
+ }
+
+ public static class State extends AbstractHtmlState
+ {
+ public void clear()
+ {
+ super.clear();
+ }
+ }
+
+ private static class Rendering
+ extends THeadTag implements HtmlConstants
+ {
+ public void doStartTag(Appender sb, AbstractTagState renderState)
+ {
+ assert(sb != null) : "Parameter 'sb' must not be null";
+ assert(renderState != null) : "Parameter 'renderState' must not be null";
+ assert(renderState instanceof State) : "Paramater 'renderState' must be an instance of THeadTag.State";
+
+ State state = (State) renderState;
+
+ renderTag(sb, THEAD);
+
+ renderAttribute(sb, ID, state.id);
+ renderAttribute(sb, CLASS, state.styleClass);
+
+ renderAttributes(AbstractHtmlState.ATTR_GENERAL, sb, state);
+ renderAttribute(sb, STYLE, state.style);
+ renderAttributes(AbstractHtmlState.ATTR_JAVASCRIPT, sb, state);
+ sb.append(">");
+ }
+
+ public void doEndTag(Appender sb)
+ {
+ renderEndTag(sb, THEAD);
+ }
+ }
+}
Propchange: beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/THeadTag.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/TableTag.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/TableTag.java?rev=326581&view=auto
==============================================================================
--- beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/TableTag.java (added)
+++ beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/TableTag.java Wed Oct 19 08:29:22 2005
@@ -0,0 +1,72 @@
+/*
+ * 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.rendering;
+
+import org.apache.beehive.netui.simpletags.html.HtmlConstants;
+import org.apache.beehive.netui.simpletags.appender.Appender;
+
+import java.util.HashMap;
+
+/**
+ * Body, Start Tag: optional, End tag: optional
+ * Required href
+ */
+public abstract class TableTag extends TagHtmlBase
+{
+ public static void add(HashMap html, HashMap htmlQuirks, HashMap xhtml)
+ {
+ html.put(TABLE_TAG, new Rendering());
+ htmlQuirks.put(TABLE_TAG, new Rendering());
+ xhtml.put(TABLE_TAG, new Rendering());
+ }
+
+ public static class State extends AbstractHtmlState
+ {
+ public void clear()
+ {
+ super.clear();
+ }
+ }
+
+ private static class Rendering extends TableTag implements HtmlConstants
+ {
+ public void doStartTag(Appender sb, AbstractTagState renderState)
+ {
+ assert(sb != null) : "Parameter 'sb' must not be null";
+ assert(renderState != null) : "Parameter 'renderState' must not be null";
+ assert(renderState instanceof State) : "Paramater 'renderState' must be an instance of TableTag.State";
+
+ State state = (State) renderState;
+
+ renderTag(sb, TABLE);
+
+ renderAttribute(sb, ID, state.id);
+ renderAttribute(sb, CLASS, state.styleClass);
+
+ renderAttributes(AbstractHtmlState.ATTR_GENERAL, sb, state);
+ renderAttribute(sb, STYLE, state.style);
+ renderAttributes(AbstractHtmlState.ATTR_JAVASCRIPT, sb, state);
+ sb.append(">");
+ }
+
+ public void doEndTag(Appender sb)
+ {
+ renderEndTag(sb, TABLE);
+ }
+ }
+}
Propchange: beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/TableTag.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/TagHtmlBase.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/TagHtmlBase.java?rev=326581&view=auto
==============================================================================
--- beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/TagHtmlBase.java (added)
+++ beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/TagHtmlBase.java Wed Oct 19 08:29:22 2005
@@ -0,0 +1,46 @@
+/*
+ * 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.rendering;
+
+import org.apache.beehive.netui.simpletags.appender.Appender;
+
+import java.util.HashMap;
+
+abstract public class TagHtmlBase extends TagRenderingBase
+{
+ /**
+ * Render all of the attributes defined in a map and return the string value. The attributes
+ * are rendered with in a name="value" style supported by XML.
+ * @param type an integer key indentifying the map
+ */
+ protected void renderAttributes(int type, Appender sb, AbstractAttributeState state, boolean doubleQuote)
+ {
+ HashMap map = null;
+ switch (type) {
+ case AbstractHtmlState.ATTR_JAVASCRIPT:
+ assert(state instanceof AbstractHtmlState) : "ATTR_JAVASCRIPT requires a AbstractHtmlState instance";
+ AbstractHtmlState htmlState = (AbstractHtmlState) state;
+ map = htmlState.getEventMap();
+ break;
+ default:
+ super.renderAttributes(type, sb, state, doubleQuote);
+ return;
+ }
+ renderGeneral(map, sb, doubleQuote);
+ }
+}
Propchange: beehive/trunk/netui/src/simple-tags/org/apache/beehive/netui/simpletags/rendering/TagHtmlBase.java
------------------------------------------------------------------------------
svn:eol-style = native