craigmcc 01/04/18 16:10:25
Modified: doc struts-html.xml
src/share/org/apache/struts/taglib BaseHandlerTag.java
FormTag.java
Log:
Add a new "styleId" attribute to most of the struts-html tags, so that you
can generate an "id" attribute on the ultimate HTML element. This is very
useful as a referenceable identifier for stylesheets.
PR: Bugzilla #998
Submitted by: [EMAIL PROTECTED]
Revision Changes Path
1.5 +152 -0 jakarta-struts/doc/struts-html.xml
Index: struts-html.xml
===================================================================
RCS file: /home/cvs/jakarta-struts/doc/struts-html.xml,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- struts-html.xml 2001/04/14 02:37:31 1.4
+++ struts-html.xml 2001/04/18 23:10:21 1.5
@@ -248,6 +248,15 @@
</attribute>
<attribute>
+ <name>styleId</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <info>
+ Identifier to be assigned to this HTML element.
+ </info>
+ </attribute>
+
+ <attribute>
<name>tabindex</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
@@ -455,6 +464,15 @@
</attribute>
<attribute>
+ <name>styleId</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <info>
+ Identifier to be assigned to this HTML element.
+ </info>
+ </attribute>
+
+ <attribute>
<name>tabindex</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
@@ -687,6 +705,15 @@
</attribute>
<attribute>
+ <name>styleId</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <info>
+ Identifier to be assigned to this HTML element.
+ </info>
+ </attribute>
+
+ <attribute>
<name>tabindex</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
@@ -1001,6 +1028,15 @@
</attribute>
<attribute>
+ <name>styleId</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <info>
+ Identifier to be assigned to this HTML element.
+ </info>
+ </attribute>
+
+ <attribute>
<name>tabindex</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
@@ -1170,6 +1206,15 @@
</attribute>
<attribute>
+ <name>styleId</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <info>
+ Identifier to be assigned to this HTML element.
+ </info>
+ </attribute>
+
+ <attribute>
<name>target</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
@@ -1945,6 +1990,15 @@
</info>
</attribute>
+ <attribute>
+ <name>styleId</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <info>
+ Identifier to be assigned to this HTML element.
+ </info>
+ </attribute>
+
<attribute>
<name>usemap</name>
<required>false</required>
@@ -2376,6 +2430,15 @@
</info>
</attribute>
+ <attribute>
+ <name>styleId</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <info>
+ Identifier to be assigned to this HTML element.
+ </info>
+ </attribute>
+
<attribute>
<name>tabindex</name>
<required>false</required>
@@ -2632,6 +2695,15 @@
</attribute>
<attribute>
+ <name>styleId</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <info>
+ Identifier to be assigned to this HTML element.
+ </info>
+ </attribute>
+
+ <attribute>
<name>tabindex</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
@@ -3083,6 +3155,14 @@
</info>
</attribute>
+ <attribute>
+ <name>styleId</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <info>
+ Identifier to be assigned to this HTML element.
+ </info>
+ </attribute>
<attribute>
<name>size</name>
@@ -3251,6 +3331,33 @@
</info>
</attribute>
+ <attribute>
+ <name>style</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <info>
+ CSS styles to be applied to this HTML element.
+ </info>
+ </attribute>
+
+ <attribute>
+ <name>styleClass</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <info>
+ CSS stylesheet class to be applied to this HTML element.
+ </info>
+ </attribute>
+
+ <attribute>
+ <name>styleId</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <info>
+ Identifier to be assigned to this HTML element.
+ </info>
+ </attribute>
+
<attribute>
<name>value</name>
<required>true</required>
@@ -3436,6 +3543,15 @@
</attribute>
<attribute>
+ <name>styleId</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <info>
+ Identifier to be assigned to this HTML element.
+ </info>
+ </attribute>
+
+ <attribute>
<name>tabindex</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
@@ -3792,6 +3908,15 @@
</attribute>
<attribute>
+ <name>styleId</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <info>
+ Identifier to be assigned to this HTML element.
+ </info>
+ </attribute>
+
+ <attribute>
<name>tabindex</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
@@ -4002,6 +4127,15 @@
</attribute>
<attribute>
+ <name>styleId</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <info>
+ Identifier to be assigned to this HTML element.
+ </info>
+ </attribute>
+
+ <attribute>
<name>tabindex</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
@@ -4243,6 +4377,15 @@
</attribute>
<attribute>
+ <name>styleId</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <info>
+ Identifier to be assigned to this HTML element.
+ </info>
+ </attribute>
+
+ <attribute>
<name>tabindex</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
@@ -4472,6 +4615,15 @@
<rtexprvalue>true</rtexprvalue>
<info>
CSS stylesheet class to be applied to this HTML element.
+ </info>
+ </attribute>
+
+ <attribute>
+ <name>styleId</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <info>
+ Identifier to be assigned to this HTML element.
</info>
</attribute>
1.5 +25 -6
jakarta-struts/src/share/org/apache/struts/taglib/BaseHandlerTag.java
Index: BaseHandlerTag.java
===================================================================
RCS file:
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/BaseHandlerTag.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- BaseHandlerTag.java 2000/07/17 16:37:45 1.4
+++ BaseHandlerTag.java 2001/04/18 23:10:23 1.5
@@ -1,13 +1,13 @@
/*
- * $Header:
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/BaseHandlerTag.java,v 1.4
2000/07/17 16:37:45 craigmcc Exp $
- * $Revision: 1.4 $
- * $Date: 2000/07/17 16:37:45 $
+ * $Header:
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/BaseHandlerTag.java,v 1.5
2001/04/18 23:10:23 craigmcc Exp $
+ * $Revision: 1.5 $
+ * $Date: 2001/04/18 23:10:23 $
*
* ====================================================================
*
* The Apache Software License, Version 1.1
*
- * Copyright (c) 1999 The Apache Software Foundation. All rights
+ * Copyright (c) 1999-2001 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -29,7 +29,7 @@
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
- * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
+ * 4. The names "The Jakarta Project", "Struts", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
* from this software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
@@ -71,7 +71,7 @@
* appropriate implementations of these.
*
* @author Don Clasen
- * @version $Revision: 1.4 $ $Date: 2000/07/17 16:37:45 $
+ * @version $Revision: 1.5 $ $Date: 2001/04/18 23:10:23 $
*/
public abstract class BaseHandlerTag extends BodyTagSupport {
@@ -154,6 +154,9 @@
/** Named Style class associated with component. */
private String styleClass = null;
+ /** Identifier associated with component. */
+ private String styleId = null;
+
// ------------------------------------------------------------- Properties
// Navigation Management
@@ -349,6 +352,16 @@
return styleClass;
}
+ /** Sets the style id attribute. */
+ public void setStyleId(String styleId) {
+ this.styleId = styleId;
+ }
+
+ /** Returns the style id attribute. */
+ public String getStyleId() {
+ return styleId;
+ }
+
// --------------------------------------------------------- Public Methods
@@ -376,6 +389,7 @@
onFocus = null;
style = null;
styleClass = null;
+ styleId = null;
}
@@ -397,6 +411,11 @@
if (styleClass != null) {
styles.append(" class=\"");
styles.append(styleClass);
+ styles.append("\"");
+ }
+ if (styleId != null) {
+ styles.append(" id=\"");
+ styles.append(styleId);
styles.append("\"");
}
return styles.toString();
1.10 +38 -4 jakarta-struts/src/share/org/apache/struts/taglib/FormTag.java
Index: FormTag.java
===================================================================
RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/FormTag.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- FormTag.java 2000/08/01 20:03:31 1.9
+++ FormTag.java 2001/04/18 23:10:23 1.10
@@ -1,7 +1,7 @@
/*
- * $Header:
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/FormTag.java,v 1.9
2000/08/01 20:03:31 craigmcc Exp $
- * $Revision: 1.9 $
- * $Date: 2000/08/01 20:03:31 $
+ * $Header:
/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/FormTag.java,v 1.10
2001/04/18 23:10:23 craigmcc Exp $
+ * $Revision: 1.10 $
+ * $Date: 2001/04/18 23:10:23 $
*
* ====================================================================
*
@@ -78,7 +78,7 @@
* properties correspond to the various fields of the form.
*
* @author Craig R. McClanahan
- * @version $Revision: 1.9 $ $Date: 2000/08/01 20:03:31 $
+ * @version $Revision: 1.10 $ $Date: 2001/04/18 23:10:23 $
*/
public final class FormTag extends TagSupport {
@@ -165,6 +165,12 @@
/**
+ * The identifier associated with this tag.
+ */
+ private String styleId = null;
+
+
+ /**
* The window target.
*/
protected String target = null;
@@ -378,6 +384,28 @@
/**
+ * Return the style id for this tag.
+ */
+ public String getStyleId() {
+
+ return (this.styleId);
+
+ }
+
+
+ /**
+ * Set the style id for this tag.
+ *
+ * @param styleId The new style id
+ */
+ public void setStyleId(String styleId) {
+
+ this.styleId = styleId;
+
+ }
+
+
+ /**
* Return the window target.
*/
public String getTarget() {
@@ -451,6 +479,11 @@
results.append(styleClass);
results.append("\"");
}
+ if (styleId != null) {
+ results.append(" id=\"");
+ results.append(styleId);
+ results.append("\"");
+ }
if (enctype != null) {
results.append(" enctype=\"");
results.append(enctype);
@@ -574,6 +607,7 @@
scope = "session";
style = null;
styleClass = null;
+ styleId = null;
target = null;
type = null;