Author: pbenedict Date: Mon Nov 27 06:25:35 2006 New Revision: 479633 URL: http://svn.apache.org/viewvc?view=rev&rev=479633 Log: STR-1559: Added missing dir and lang attributes to FormTag+OptionTag, and cleared the properties on release
Modified: struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/BaseHandlerTag.java struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/FormTag.java struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/OptionTag.java Modified: struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/BaseHandlerTag.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/BaseHandlerTag.java?view=diff&rev=479633&r1=479632&r2=479633 ============================================================================== --- struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/BaseHandlerTag.java (original) +++ struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/BaseHandlerTag.java Mon Nov 27 06:25:35 2006 @@ -785,11 +785,13 @@ alt = null; altKey = null; bundle = null; + dir = null; errorKey = Globals.ERROR_KEY; errorStyle = null; errorStyleClass = null; errorStyleId = null; indexed = false; + lang = null; locale = Globals.LOCALE_KEY; onclick = null; ondblclick = null; Modified: struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/FormTag.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/FormTag.java?view=diff&rev=479633&r1=479632&r2=479633 ============================================================================== --- struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/FormTag.java (original) +++ struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/FormTag.java Mon Nov 27 06:25:35 2006 @@ -190,6 +190,16 @@ */ protected boolean readonly = false; + /** + * The language code of this element. + */ + private String lang = null; + + /** + * The direction for weak/neutral text of this element. + */ + private String dir = null; + // ------------------------------------------------------------- Properties /** @@ -406,6 +416,42 @@ return readonly; } + /** + * Returns the language code of this element. + * + * @since Struts 1.3.6 + */ + public String getLang() { + return this.lang; + } + + /** + * Sets the language code of this element. + * + * @since Struts 1.3.6 + */ + public void setLang(String lang) { + this.lang = lang; + } + + /** + * Returns the direction for weak/neutral text this element. + * + * @since Struts 1.3.6 + */ + public String getDir() { + return this.dir; + } + + /** + * Sets the direction for weak/neutral text of this element. + * + * @since Struts 1.3.6 + */ + public void setDir(String dir) { + this.dir = dir; + } + // --------------------------------------------------------- Public Methods /** @@ -495,7 +541,9 @@ renderAction(results); renderAttribute(results, "accept-charset", getAcceptCharset()); renderAttribute(results, "class", getStyleClass()); + renderAttribute(results, "dir", getDir()); renderAttribute(results, "enctype", getEnctype()); + renderAttribute(results, "lang", getLang()); renderAttribute(results, "onreset", getOnreset()); renderAttribute(results, "onsubmit", getOnsubmit()); renderAttribute(results, "style", getStyle()); @@ -716,9 +764,11 @@ action = null; moduleConfig = null; enctype = null; + dir = null; disabled = false; focus = null; focusIndex = null; + lang = null; mapping = null; method = null; onreset = null; Modified: struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/OptionTag.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/OptionTag.java?view=diff&rev=479633&r1=479632&r2=479633 ============================================================================== --- struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/OptionTag.java (original) +++ struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/OptionTag.java Mon Nov 27 06:25:35 2006 @@ -97,6 +97,16 @@ protected String styleId = null; /** + * The language code of this element. + */ + private String lang = null; + + /** + * The direction for weak/neutral text of this element. + */ + private String dir = null; + + /** * The server value for this option, also used to match against the * current property value to determine whether this option should be * marked as selected. @@ -183,6 +193,42 @@ this.value = value; } + /** + * Returns the language code of this element. + * + * @since Struts 1.3.6 + */ + public String getLang() { + return this.lang; + } + + /** + * Sets the language code of this element. + * + * @since Struts 1.3.6 + */ + public void setLang(String lang) { + this.lang = lang; + } + + /** + * Returns the direction for weak/neutral text this element. + * + * @since Struts 1.3.6 + */ + public String getDir() { + return this.dir; + } + + /** + * Sets the direction for weak/neutral text of this element. + * + * @since Struts 1.3.6 + */ + public void setDir(String dir) { + this.dir = dir; + } + // --------------------------------------------------------- Public Methods /** @@ -274,6 +320,18 @@ results.append("\""); } + if (dir != null) { + results.append(" dir=\""); + results.append(dir); + results.append("\""); + } + + if (lang != null) { + results.append(" lang=\""); + results.append(lang); + results.append("\""); + } + results.append(">"); results.append(text()); @@ -310,8 +368,10 @@ public void release() { super.release(); bundle = Globals.MESSAGES_KEY; + dir = null; disabled = false; key = null; + lang = null; locale = Globals.LOCALE_KEY; style = null; styleClass = null;