Author: dolander
Date: Sat Aug 7 20:20:20 2004
New Revision: 36076
Modified:
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/AbstractClassicTag.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/AbstractSimpleTag.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Anchor.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Attribute.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Base.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/BindingUpdateErrors.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Body.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/HtmlConstants.java
Log:
Converted the Attribute, Base and BindingUpdateErrors tags to SimpleTags
Added the missing HTML attributes to the Body tag
Bit of cleanup in the Anchor
Modified:
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/AbstractClassicTag.java
==============================================================================
---
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/AbstractClassicTag.java
(original)
+++
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/AbstractClassicTag.java
Sat Aug 7 20:20:20 2004
@@ -172,21 +172,6 @@
buf.append("\"");
}
- // @TODO: should this be combined above. It would require a virtual call
on the base tag.
- protected final void renderAttributeSingleQuotes(StringBuilder buf, String
name,
- String value)
- {
- assert (name != null);
- if (value == null)
- return;
-
- buf.append(" ");
- buf.append(name);
- buf.append("='");
- buf.append(value);
- buf.append("'");
- }
-
protected final String escapeEscapes(String val)
{
assert(val != null);
@@ -351,6 +336,14 @@
/////////////////////////// Generic Error Reporting Support
////////////////////////////
+ /**
+ * This is a simple routine which will call the error reporter if there is
an
+ * error and then call local release before returning the
<code>returnValue</code>.
+ * This is a very common code sequence in the Classic Tags so we provide
this routine.
+ * @param returnValue The value that will be returned.
+ * @return <code>returnValue</code> is always returned.
+ * @throws JspException
+ */
protected int reportAndExit(int returnValue)
throws JspException
{
@@ -377,6 +370,13 @@
eh.registerTagError(message,getTagName(),this,e);
}
+ /**
+ * This will report an error from a tag. The error must
+ * be be an AbstractPageError.
+ * @param error The <code>AbstractPageError</code> to add to the error
list.
+ * @throws JspException - if in-page error reporting is turned off this
method will always
+ * throw a JspException.
+ */
public void registerTagError(AbstractPageError error)
throws JspException
{
Modified:
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/AbstractSimpleTag.java
==============================================================================
---
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/AbstractSimpleTag.java
(original)
+++
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/AbstractSimpleTag.java
Sat Aug 7 20:20:20 2004
@@ -1,17 +1,23 @@
package org.apache.beehive.netui.tags;
-import org.apache.struts.util.RequestUtils;
import org.apache.beehive.netui.util.Bundle;
import org.apache.beehive.netui.util.logging.Logger;
+import org.apache.struts.util.RequestUtils;
-import javax.servlet.jsp.tagext.SimpleTagSupport;
-import javax.servlet.jsp.tagext.JspTag;
+import javax.servlet.jsp.JspContext;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
-import javax.servlet.jsp.JspContext;
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;
+/**
+ *
+ * @netui:tag
+ */
public abstract class AbstractSimpleTag extends SimpleTagSupport implements
INetuiTag
{
private static final Logger logger =
Logger.getInstance(AbstractSimpleTag.class);
@@ -22,6 +28,55 @@
* @return the name of the tag.
*/
public abstract String getTagName();
+
+ 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;
+ }
+
+ /**
+ * 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
+ * @throws JspException A JspException will be thrown if inline error
reporting is turned off.
+ */
+ protected final String setRequiredValueAttribute(String attrValue,String
attrName)
+ throws JspException
+ {
+ 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});
+ registerTagError(s, null);
+ return null;
+ }
+ return attrValue;
+ }
+
+ /**
+ * 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;
+ }
/**
* This method will attempt to cast the JspContext into a PageContext. If
this fails,
Modified:
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Anchor.java
==============================================================================
---
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Anchor.java
(original)
+++
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Anchor.java
Sat Aug 7 20:20:20 2004
@@ -541,6 +541,8 @@
*/
public int doStartTag() throws JspException
{
+ if (hasErrors())
+ return SKIP_BODY;
return EVAL_BODY_BUFFERED;
}
@@ -550,7 +552,6 @@
*/
public int doAfterBody() throws JspException
{
-
if (bodyContent != null) {
String value = bodyContent.getString().trim();
bodyContent.clearBody();
@@ -567,11 +568,8 @@
public int doEndTag() throws JspException
{
// report errors that may have occurred when the required attributes
are being set
- if (hasErrors()) {
- reportErrors();
- localRelease();
- return EVAL_PAGE;
- }
+ if (hasErrors())
+ return reportAndExit(EVAL_PAGE);
// build the anchor into the results
StringBuilder results = new StringBuilder(128);
@@ -581,11 +579,9 @@
TagRenderingBase trb =
TagRenderingBase.Factory.getRendering(TagRenderingBase.ANCHOR_TAG, request);
if (!createAnchorBeginTag(results, script, trb)) {
- reportErrors();
if (script.length() > 0)
ResponseUtils.write(pageContext, script.toString());
- localRelease();
- return EVAL_PAGE;
+ return reportAndExit(EVAL_PAGE);
}
if (_text != null)
Modified:
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Attribute.java
==============================================================================
---
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Attribute.java
(original)
+++
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Attribute.java
Sat Aug 7 20:20:20 2004
@@ -18,12 +18,12 @@
*/
package org.apache.beehive.netui.tags.html;
-import org.apache.beehive.netui.tags.AbstractClassicTag;
+import org.apache.beehive.netui.tags.AbstractSimpleTag;
import org.apache.beehive.netui.tags.IAttributeConsumer;
import org.apache.beehive.netui.util.Bundle;
import javax.servlet.jsp.JspException;
-import javax.servlet.jsp.tagext.Tag;
+import javax.servlet.jsp.tagext.JspTag;
/**
* @jsptagref.tagdescription
@@ -46,11 +46,11 @@
*
* <pre> <netui:attribute name="a" value="{pageFlow.aAttributeValue}"
/></pre>
*
- * @netui:tag name="attribute" description="Add an attribute to the parent tag
which be rendered."
+ * @netui:tag name="attribute" body-content="empty" description="Add an
attribute to the parent tag which be rendered."
* @netui.tldx:tag renderer="workshop.netui.jspdesigner.tldx.AttributeRenderer"
* bodycontentpref="empty" whitespace="indent"
*/
-public class Attribute extends AbstractClassicTag
+public class Attribute extends AbstractSimpleTag
{
private String _name = null;
private String _value = null;
@@ -117,41 +117,24 @@
* Add the URL parameter to the Parameter's parent.
* @throws JspException if a JSP exception has occurred
*/
- public int doStartTag() throws JspException
+ public void doTag()
+ throws JspException
{
if (hasErrors()) {
reportErrors();
- return SKIP_BODY;
+ return;
}
- Tag tag = getParent();
+ JspTag tag = getParent();
if (!(tag instanceof IAttributeConsumer)) {
String s = Bundle.getString("Tags_AttributeInvalidParent");
registerTagError(s, null);
reportErrors();
- return SKIP_BODY;
+ return;
}
IAttributeConsumer ac = (IAttributeConsumer) tag;
ac.setAttribute(_name, _value, _facet);
- return SKIP_BODY;
- }
-
- /**
- * Does nothing but call the localRelease() method.
- * @throws JspException if a JSP exception has occurred
- */
- public int doEndTag() throws JspException
- {
- localRelease();
- return EVAL_PAGE;
- }
-
- protected void localRelease()
- {
- super.localRelease();
- _name = null;
- _value = null;
- _facet = null;
+ return;
}
}
Modified:
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Base.java
==============================================================================
---
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Base.java
(original)
+++
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Base.java
Sat Aug 7 20:20:20 2004
@@ -20,7 +20,7 @@
//java imports
-import org.apache.beehive.netui.tags.AbstractClassicTag;
+import org.apache.beehive.netui.tags.AbstractSimpleTag;
import org.apache.beehive.netui.tags.IAttributeConsumer;
import org.apache.beehive.netui.tags.rendering.AbstractAttributeState;
import org.apache.beehive.netui.tags.rendering.BaseTag;
@@ -29,6 +29,8 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.PageContext;
+import java.io.IOException;
/**
* Provides the base for every URL on this page.
@@ -44,10 +46,10 @@
* </head>
* </pre>
*
- * @netui:tag name="base" description="Provides the base for every URL on this
page."
+ * @netui:tag name="base" body-content="scriptless" description="Provides the
base for every URL on this page."
* @netui.tldx:tag requiredchild="attribute"
renderer="workshop.netui.jspdesigner.tldx.BaseRenderer" bodycontentpref="empty"
whitespace="indent"
*/
-public class Base extends AbstractClassicTag
+public class Base extends AbstractSimpleTag
implements IAttributeConsumer, HtmlConstants
{
private BaseTag.State _state = new BaseTag.State();
@@ -123,36 +125,19 @@
}
/**
- * Render the base tag
- * @throws JspException if a JSP exception has occurred
- */
- public int doStartTag() throws JspException
- {
- return EVAL_BODY_BUFFERED;
- }
-
- /**
- * Save the body content of the Anchor.
- * @throws JspException if a JSP exception has occurred
- */
- public int doAfterBody() throws JspException
- {
-
- if (bodyContent != null) {
- bodyContent.clearBody();
- }
- return SKIP_BODY;
- }
-
- /**
* Render the hyperlink.
* @throws JspException if a JSP exception has occurred
*/
- public int doEndTag() throws JspException
+ public void doTag()
+ throws JspException, IOException
{
+ PageContext pageContext = getPageContext();
HttpServletRequest request = (HttpServletRequest)
pageContext.getRequest();
TagRenderingBase br =
TagRenderingBase.Factory.getRendering(TagRenderingBase.BASE_TAG, request);
+ // evaluate the body, this is called basically so any attributes my be
applied.
+ getBufferBody(false);
+
StringBuilder buf = new StringBuilder(64);
// calculate the href
@@ -182,22 +167,9 @@
// This will produce invalid HTML/XHTML if there are errors
// because we are going to put markup out into the head.
- if (hasErrors()) {
+ if (hasErrors())
reportErrors();
- }
-
- localRelease();
- return SKIP_BODY;
}
-
- // this doesn currently extend our AbstractBaseTag so this is the end.
- protected void localRelease()
- {
- super.localRelease();
-
- _state.clear();
- }
-
}
Modified:
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/BindingUpdateErrors.java
==============================================================================
---
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/BindingUpdateErrors.java
(original)
+++
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/BindingUpdateErrors.java
Sat Aug 7 20:20:20 2004
@@ -21,11 +21,12 @@
import org.apache.beehive.netui.pageflow.ServerAdapter;
import org.apache.beehive.netui.pageflow.internal.BindingUpdateError;
import org.apache.beehive.netui.pageflow.internal.InternalUtils;
-import org.apache.beehive.netui.tags.AbstractClassicTag;
+import org.apache.beehive.netui.tags.AbstractSimpleTag;
import org.apache.beehive.netui.util.Bundle;
import javax.servlet.ServletRequest;
import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.PageContext;
import java.util.Iterator;
import java.util.LinkedHashMap;
@@ -35,13 +36,10 @@
* warnings. By default, this tag is only on in Iterative Dev mode and
* the warning are not displayed in production mode. The tag is intended
* for development use.
- *
- * @jsptagref.tagdescription
- * Renders the set of error messages found during the process of resolving
+ * @jsptagref.tagdescription Renders the set of error messages found during
the process of resolving
* data binding expressions ({pageFlow.firstname}, {request.firstname}, etc.).
* The tag is intended
* for development use, not for error reporting in deployed applications.
- *
* @example In this first sample, because the <netui:bindingUpdateErrors/>
tag is unqualified,
* messages will be displayed if <b>any</b> data binding errors occurred when
a form was
* posted. The messages are displayed on the page and the command window.
@@ -49,11 +47,10 @@
* <p>In this next sample, only binding errors for the expression
<code>{actionForm.firstName}</code>
* will be displayed on the page and the command window. </p>
* <pre><netui:bindingUpdateErrors
expression="{actionForm.firstName}"/></pre>
- *
- * @netui:tag name="bindingUpdateErrors" description="Will display a message
for all binding update errors that occurred when a form was posted."
+ * @netui:tag name="bindingUpdateErrors" body-content="empty"
description="Will display a message for all binding update errors that occurred
when a form was posted."
* @netui.tldx:tag requiredchild="#nothing"
renderer="workshop.netui.jspdesigner.tldx.BindingUpdateErrorsRenderer"
bodycontentpref="empty" whitespace="indent"
*/
-public class BindingUpdateErrors extends AbstractClassicTag
+public class BindingUpdateErrors extends AbstractSimpleTag
{
private String _expression = null;
private boolean _alwaysReport = false;
@@ -71,21 +68,17 @@
* is set, only binding errors for that expression will be displayed.
* Otherwise, all errors will be displayed.
* @param expression The expression to match against.
- *
- * @jsptagref.attributedescription
- * String. The data binding expression to match for binding errors. If an
data binding expression
+ * @jsptagref.attributedescription String. The data binding expression to
match for binding errors. If an data binding expression
* is specified, only binding errors for that expression will be displayed.
* Otherwise, all errors will be displayed.
- *
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>string_databinding_expression</i>
- *
* @netui:attribute required="false" rtexprvalue="true"
*/
public void setExpression(String expression)
+ throws JspException
{
- _expression = expression;
+ _expression = setRequiredValueAttribute(expression,"expression");
}
/**
@@ -93,15 +86,10 @@
* errors in production mode.
* @param alwaysReport a boolean that if <code>true</code> will cause
* the errors to always be displayed. The default is
<code>false</code>
- *
- * @jsptagref.attributedescription
- * Boolean. If <code>isAlwaysReport</code> is set to true, then the errors
will be displayed in Production mode
+ * @jsptagref.attributedescription Boolean. If <code>isAlwaysReport</code>
is set to true, then the errors will be displayed in Production mode
* as well as in Development mode. Otherwise, the errors will be
displayed only in Development mode.
- *
* @jsptagref.databindable false
- *
* @jsptagref.attributesyntaxvalue <i>boolean_always_report</i>
- *
* @netui:attribute required="false" rtexprvalue="true" type="boolean"
*/
public void setAlwaysReport(boolean alwaysReport)
@@ -113,65 +101,52 @@
* Render the specified error messages if there are any.
* @throws JspException if a JSP exception has occurred
*/
- public int doStartTag() throws JspException
+ public void doTag()
+ throws JspException
{
- ServerAdapter sa = InternalUtils.getServerAdapter();
- assert(sa != null);
+ // report error if there are any
+ if (hasErrors()) {
+ reportErrors();
+ return;
+ }
+ ServerAdapter sa = InternalUtils.getServerAdapter();
+ PageContext pageContext = getPageContext();
ServletRequest request = pageContext.getRequest();
+ assert(sa != null);
- try {
- // check to see if we are supposed to report the error
- boolean prodMode = sa.isInProductionMode();
- if (prodMode && !_alwaysReport)
- return SKIP_BODY;
-
- LinkedHashMap map = (LinkedHashMap)
- InternalUtils.getBindingUpdateErrors(request);
-
- if (map == null)
- return SKIP_BODY;
-
- if (_expression != null) {
- String expr = "{" + _expression + "}";
- BindingUpdateError err = (BindingUpdateError) map.get(expr);
- if (err != null) {
- Throwable cause = err.getCause();
- String msg = (cause != null) ? cause.getMessage() :
- err.getMessage();
- String s = Bundle.getString("Tags_BindingUpdateError",
- new Object[]{_expression, msg});
- registerTagError(s, null);
- reportErrors();
- }
- return SKIP_BODY;
- }
-
- Iterator it = map.values().iterator();
- while (it.hasNext()) {
- BindingUpdateError err = (BindingUpdateError) it.next();
+ // check to see if we are supposed to report the error
+ boolean prodMode = sa.isInProductionMode();
+ if (prodMode && !_alwaysReport)
+ return;
+
+ LinkedHashMap map = (LinkedHashMap)
+ InternalUtils.getBindingUpdateErrors(request);
+
+ if (map == null)
+ return;
+
+ if (_expression != null) {
+ String expr = "{" + _expression + "}";
+ BindingUpdateError err = (BindingUpdateError) map.get(expr);
+ if (err != null) {
Throwable cause = err.getCause();
- String msg = (cause != null) ? cause.getMessage() :
- err.getMessage();
- String s = Bundle.getString("Tags_BindingUpdateError",
- new Object[]{err.getExpression(), msg});
+ String msg = (cause != null) ? cause.getMessage() :
err.getMessage();
+ String s = Bundle.getString("Tags_BindingUpdateError", new
Object[]{_expression, msg});
registerTagError(s, null);
+ reportErrors();
}
- reportErrors();
- return SKIP_BODY;
- }
- finally {
- localRelease();
+ return;
}
- }
- /**
- * Release any acquired resources.
- */
- protected void localRelease()
- {
- super.localRelease();
- _expression = null;
- _alwaysReport = false;
+ Iterator it = map.values().iterator();
+ while (it.hasNext()) {
+ BindingUpdateError err = (BindingUpdateError) it.next();
+ Throwable cause = err.getCause();
+ String msg = (cause != null) ? cause.getMessage() :
err.getMessage();
+ String s = Bundle.getString("Tags_BindingUpdateError", new
Object[]{err.getExpression(), msg});
+ registerTagError(s, null);
+ }
+ reportErrors();
}
}
Modified:
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Body.java
==============================================================================
---
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Body.java
(original)
+++
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Body.java
Sat Aug 7 20:20:20 2004
@@ -33,9 +33,8 @@
*/
public class Body extends HtmlBaseTag
{
- // @todo: need to support all of the attributes.
- BodyTag.State _state = new BodyTag.State();
- String _text;
+ private BodyTag.State _state = new BodyTag.State();
+ private String _text;
/**
* Return the name of the Tag.
@@ -56,6 +55,134 @@
}
/**
+ * Sets the onLoad javascript event.
+ * @param onload - the onLoad event.
+ *
+ * @jsptagref.attributedescription
+ * The onLoad JavaScript event.
+ *
+ * @jsptagref.databindable false
+ *
+ * @jsptagref.attributesyntaxvalue <i>string_onLoad</i>
+ *
+ * @netui:attribute required="false" rtexprvalue="true"
+ * @netui.tldx:attribute
propertyclass="workshop.jspdesigner.properties.EventPropertyClass"
category="event"
+ */
+ public void setOnLoad(String onload)
+ {
+ _state.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, ONLOAD,
onload);
+ }
+
+ /**
+ * Sets the onUnload javascript event.
+ * @param onunload - the onUnload event.
+ *
+ * @jsptagref.attributedescription
+ * The onLoad JavaScript event.
+ *
+ * @jsptagref.databindable false
+ *
+ * @jsptagref.attributesyntaxvalue <i>string_onUnload</i>
+ *
+ * @netui:attribute required="false" rtexprvalue="true"
+ * @netui.tldx:attribute
propertyclass="workshop.jspdesigner.properties.EventPropertyClass"
category="event"
+ */
+ public void setOnUnload(String onunload)
+ {
+ _state.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, ONUNLOAD,
onunload);
+ }
+
+ /**
+ * Sets the background color of the page.
+ * @param background - the background color of the page.
+ * @jsptagref.attributedescription
+ * The background color of the page.
+ *
+ * @jsptagref.databindable false
+ *
+ * @jsptagref.attributesyntaxvalue <i>string_background</i>
+ *
+ * @netui:attribute required="false" rtexprvalue="true"
+ * @netui.tldx:attribute category="misc"
+ */
+ public void setBackground(String background)
+ {
+ _state.registerAttribute(AbstractHtmlState.ATTR_GENERAL, BACKGROUND,
background);
+ }
+
+ /**
+ * Sets the foreground text color of the page.
+ * @param text - the foreground text color of the page.
+ * @jsptagref.attributedescription
+ * The foreground text color of the page.
+ *
+ * @jsptagref.databindable false
+ *
+ * @jsptagref.attributesyntaxvalue <i>string_text</i>
+ *
+ * @netui:attribute required="false" rtexprvalue="true"
+ * @netui.tldx:attribute category="misc"
+ */
+ public void setText(String text)
+ {
+ _state.registerAttribute(AbstractHtmlState.ATTR_GENERAL, TEXT, text);
+ }
+
+ /**
+ * Sets the the color of text marking unvisited hypertext links.
+ * @param link - the color of text marking unvisited hypertext links of
the page.
+ * @jsptagref.attributedescription
+ * The color of text marking unvisited hypertext links of the page
+ *
+ * @jsptagref.databindable false
+ *
+ * @jsptagref.attributesyntaxvalue <i>string_link</i>
+ *
+ * @netui:attribute required="false" rtexprvalue="true"
+ * @netui.tldx:attribute category="misc"
+ */
+ public void setLink(String link)
+ {
+ _state.registerAttribute(AbstractHtmlState.ATTR_GENERAL, LINK, link);
+ }
+
+ /**
+ * Sets the the color of text marking visited hypertext links.
+ * @param vlink - the color of text marking visited hypertext links of the
page.
+ * @jsptagref.attributedescription
+ * The color of text marking visited hypertext links of the page
+ *
+ * @jsptagref.databindable false
+ *
+ * @jsptagref.attributesyntaxvalue <i>string_vlink</i>
+ *
+ * @netui:attribute required="false" rtexprvalue="true"
+ * @netui.tldx:attribute category="misc"
+ */
+ public void setVlink(String vlink)
+ {
+ _state.registerAttribute(AbstractHtmlState.ATTR_GENERAL, VLINK, vlink);
+ }
+
+ /**
+ * Sets the color of text marking hypertext links when selected by the
user.
+ * @param alink - the color of text marking hypertext links when selected
by the user.
+ * @jsptagref.attributedescription
+ * The color of text marking hypertext links when selected by the user
+ *
+ * @jsptagref.databindable false
+ *
+ * @jsptagref.attributesyntaxvalue <i>string_alink</i>
+ *
+ * @netui:attribute required="false" rtexprvalue="true"
+ * @netui.tldx:attribute category="misc"
+ */
+ public void setAlink(String alink)
+ {
+ _state.registerAttribute(AbstractHtmlState.ATTR_GENERAL, ALINK, alink);
+ }
+
+ /**
* Process the start of the Button.
* @throws javax.servlet.jsp.JspException if a JSP exception has occurred
*/
@@ -127,5 +254,4 @@
_state.clear();
_text = null;
}
-
}
Modified:
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/HtmlConstants.java
==============================================================================
---
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/HtmlConstants.java
(original)
+++
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/HtmlConstants.java
Sat Aug 7 20:20:20 2004
@@ -84,6 +84,11 @@
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";
@@ -123,6 +128,11 @@
*/
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.
@@ -167,6 +177,11 @@
static final String ALT = "alt";
/**
+ * The name of the <code>background</code> attribute.
+ */
+ static final String BACKGROUND = "background";
+
+ /**
* The name of the <code>border</code> attribute.
*/
static final String BORDER = "border";
@@ -252,9 +267,19 @@
static final String LONGDESC = "longdesc";
/**
- * The name of the <code>lowsrc</code> attribute.
+ * The name of the <code>link</code> attribute.
*/
- static final String LOWSRC = "lowsrc";
+ 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.
@@ -335,6 +360,11 @@
* 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.