Skip to content

Commit

Permalink
removed FormButton align attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksandr-m committed Jun 16, 2014
1 parent af0f3cf commit a0b3480
Show file tree
Hide file tree
Showing 26 changed files with 18 additions and 79 deletions.
10 changes: 0 additions & 10 deletions core/src/main/java/org/apache/struts2/components/FormButton.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ public abstract class FormButton extends ClosingUIBean {

protected String action;
protected String method;
protected String align;
protected String type;

public FormButton(ValueStack stack, HttpServletRequest request, HttpServletResponse response) {
Expand All @@ -52,9 +51,6 @@ public FormButton(ValueStack stack, HttpServletRequest request, HttpServletRespo
//public void evaluateParams() {
public void evaluateExtraParams() {
super.evaluateExtraParams();
if (align == null) {
align = "right";
}

String submitType = BUTTONTYPE_INPUT;
if (type != null && (BUTTONTYPE_BUTTON.equalsIgnoreCase(type) || (supportsImageType() && BUTTONTYPE_IMAGE.equalsIgnoreCase(type))))
Expand Down Expand Up @@ -88,8 +84,6 @@ public void evaluateExtraParams() {
addParameter("name", name);
}

addParameter("align", findString(align));

}

/**
Expand Down Expand Up @@ -158,10 +152,6 @@ public void setMethod(String method) {
this.method = method;
}

@StrutsTagAttribute(description="HTML align attribute.")
public void setAlign(String align) {
this.align = align;
}

@StrutsTagAttribute(description="The type of submit to use. Valid values are <i>input</i>, " +
"<i>button</i> and <i>image</i>.", defaultValue="input")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ public class ResetTag extends AbstractUITag {

protected String action;
protected String method;
protected String align;
protected String type;
protected String src;

Expand All @@ -51,7 +50,6 @@ protected void populateParams() {
Reset reset = ((Reset) component);
reset.setAction(action);
reset.setMethod(method);
reset.setAlign(align);
reset.setType(type);
reset.setSrc(src);
}
Expand All @@ -64,10 +62,6 @@ public void setMethod(String method) {
this.method = method;
}

public void setAlign(String align) {
this.align = align;
}

public void setType(String type) {
this.type = type;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ public class SubmitTag extends AbstractClosingTag {

protected String action;
protected String method;
protected String align;
protected String type;
protected String src;

Expand All @@ -52,7 +51,6 @@ protected void populateParams() {
Submit submit = ((Submit) component);
submit.setAction(action);
submit.setMethod(method);
submit.setAlign(align);
submit.setType(type);
submit.setSrc(src);
}
Expand All @@ -65,10 +63,6 @@ public void setMethod(String method) {
this.method = method;
}

public void setAlign(String align) {
this.align = align;
}

public String getType() {
return type;
}
Expand Down
4 changes: 1 addition & 3 deletions core/src/main/resources/template/css_xhtml/reset.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@
<#else>
<span <#rt/>
</#if>
<#if parameters.align??>
align="${parameters.align?html}"<#t/>
</#if>
class="formButton"<#t/>
<#if parameters.id??>
id="wwctrl_${parameters.id}"<#rt/>
</#if>
Expand Down
1 change: 1 addition & 0 deletions core/src/main/resources/template/css_xhtml/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@
.tdCheckboxInput {text-align:left; vertical-align:top;}
.tdCheckboxErrorMessage {text-align:left; vertical-align:top;}
.tdErrorMessage {text-align:center; vertical-align:top;}
.formButton {text-align:right;}
4 changes: 1 addition & 3 deletions core/src/main/resources/template/css_xhtml/submit.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@
<#else>
<span <#rt/>
</#if>
<#if parameters.align??>
align="${parameters.align?html}"<#t/>
</#if>
class="formButton"<#t/>
<#if parameters.id??>
id="wwctrl_${parameters.id}"<#rt/>
</#if>
Expand Down
3 changes: 0 additions & 3 deletions core/src/main/resources/template/xhtml/controlheader.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,4 @@
-->
<#include "/${parameters.templateDir}/${parameters.expandTheme}/controlheader-core.ftl" />
<td
<#if parameters.align??>
align="${parameters.align?html}"<#t/>
</#if>
><#t/>
6 changes: 1 addition & 5 deletions core/src/main/resources/template/xhtml/reset.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,7 @@
*/
-->
<tr>
<td colspan="2"><div <#rt/>
<#if parameters.align??>
align="${parameters.align?html}"<#t/>
</#if>
><#t/>
<td colspan="2"><div class="formButton"><#t/>
<#include "/${parameters.templateDir}/simple/reset.ftl" />
</div><#t/>
<#include "/${parameters.templateDir}/${parameters.expandTheme}/controlfooter.ftl" />
1 change: 1 addition & 0 deletions core/src/main/resources/template/xhtml/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,4 @@
.tdCheckboxInput {text-align:left; vertical-align:top;}
.tdCheckboxErrorMessage {text-align:left; vertical-align:top;}
.tdErrorMessage {text-align:center; vertical-align:top;}
.formButton {text-align:right;}
6 changes: 1 addition & 5 deletions core/src/main/resources/template/xhtml/submit.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,5 @@
*/
-->
<tr>
<td colspan="2"><div <#rt/>
<#if parameters.align??>
align="${parameters.align?html}"<#t/>
</#if>
><#t/>
<td colspan="2"><div class="formButton"><#t/>
<#include "/${parameters.templateDir}/simple/submit.ftl" />
8 changes: 0 additions & 8 deletions core/src/site/resources/tags/reset.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,6 @@ <h2>Attributes</h2>
<td align="left" valign="top">String</td>
<td align="left" valign="top">Set action attribute.</td>
</tr>
<tr>
<td align="left" valign="top">align</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top"></td>
<td align="left" valign="top">false</td>
<td align="left" valign="top">String</td>
<td align="left" valign="top">HTML align attribute.</td>
</tr>
<tr>
<td align="left" valign="top">cssClass</td>
<td align="left" valign="top">false</td>
Expand Down
8 changes: 0 additions & 8 deletions core/src/site/resources/tags/submit.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,6 @@ <h2>Attributes</h2>
<td align="left" valign="top">String</td>
<td align="left" valign="top">Set action attribute.</td>
</tr>
<tr>
<td align="left" valign="top">align</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top"></td>
<td align="left" valign="top">false</td>
<td align="left" valign="top">String</td>
<td align="left" valign="top">HTML align attribute.</td>
</tr>
<tr>
<td align="left" valign="top">cssClass</td>
<td align="left" valign="top">false</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ public void testSimple() throws Exception {
ResetTag tag = new ResetTag();
tag.setPageContext(pageContext);
tag.setLabel("mylabel");
tag.setAlign("left");
tag.setName("myname");
tag.setValue("%{foo}");

Expand Down Expand Up @@ -91,7 +90,6 @@ public void testButtonWithLabel() throws Exception {
tag.setPageContext(pageContext);
tag.setLabel("mylabel");
tag.setType("button");
tag.setAlign("left");
tag.setName("myname");
tag.setValue("%{foo}");

Expand Down Expand Up @@ -166,7 +164,6 @@ public void testSimpleThemeImageUsingActionAndMethod() throws Exception {
tag.setLabel("mylabel");
tag.setAction("manager");
tag.setMethod("update");
tag.setAlign("left");

tag.doStartTag();
tag.doEndTag();
Expand All @@ -186,7 +183,6 @@ public void testSimpleThemeImageUsingActionOnly() throws Exception {
tag.setLabel("mylabel");
tag.setAction("manager");
tag.setMethod(null); // no method
tag.setAlign("left");

tag.doStartTag();
tag.doEndTag();
Expand All @@ -206,7 +202,6 @@ public void testSimpleThemeImageUsingMethodOnly() throws Exception {
tag.setLabel("mylabel");
tag.setAction(null); // no action
tag.setMethod("update");
tag.setAlign("left");

tag.doStartTag();
tag.doEndTag();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ public void testSimple() throws Exception {
SubmitTag tag = new SubmitTag();
tag.setPageContext(pageContext);
tag.setLabel("mylabel");
tag.setAlign("left");
tag.setName("myname");
tag.setValue("%{foo}");
tag.setDisabled("true");
Expand Down Expand Up @@ -116,7 +115,6 @@ public void testButtonWithLabel() throws Exception {
tag.setPageContext(pageContext);
tag.setLabel("mylabel");
tag.setType("button");
tag.setAlign("left");
tag.setName("myname");
tag.setValue("%{foo}");

Expand Down Expand Up @@ -173,7 +171,6 @@ public void testSimpleThemeImageUsingActionAndMethod() throws Exception {
tag.setLabel("mylabel");
tag.setAction("manager");
tag.setMethod("update");
tag.setAlign("left");

tag.doStartTag();
tag.doEndTag();
Expand All @@ -193,7 +190,6 @@ public void testSimpleThemeImageUsingActionOnly() throws Exception {
tag.setLabel("mylabel");
tag.setAction("manager");
tag.setMethod(null); // no method
tag.setAlign("left");

tag.doStartTag();
tag.doEndTag();
Expand All @@ -213,7 +209,6 @@ public void testSimpleThemeImageUsingMethodOnly() throws Exception {
tag.setLabel("mylabel");
tag.setAction(null); // no action
tag.setMethod("update");
tag.setAlign("left");

tag.doStartTag();
tag.doEndTag();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<tr>
<td colspan="2"><div align="left"><input type="reset" name="myname" value="bar"/></div></td>
<td colspan="2"><div class="formButton"><input type="reset" name="myname" value="bar"/></div></td>
</tr>
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<tr>
<td colspan="2"><div align="right"><input type="reset" name="myname" value="Reset" title="mytitle"/></div></td>
<td colspan="2"><div class="formButton"><input type="reset" name="myname" value="Reset" title="mytitle"/></div></td>
</tr>
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<tr>
<td colspan="2"><div align="right"><button type="reset" name="myname" value="bar">bar</button></div></td>
<td colspan="2"><div class="formButton"><button type="reset" name="myname" value="bar">bar</button></div></td>
</tr>
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<tr>
<td colspan="2"><div align="left"><button type="reset" name="myname" value="bar">mylabel</button></div></td>
<td colspan="2"><div class="formButton"><button type="reset" name="myname" value="bar">mylabel</button></div></td>
</tr>
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<tr>
<td colspan="2"><div align="right"><button type="reset" name="myname" value="bar" disabled="disabled">bar</button></div></td>
<td colspan="2"><div class="formButton"><button type="reset" name="myname" value="bar" disabled="disabled">bar</button></div></td>
</tr>
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<tr>
<td colspan="2"><div align="right"><button type="reset" name="myname" value="bar"><img alt="mylabel" src="some.gif"/></button></div></td>
<td colspan="2"><div class="formButton"><button type="reset" name="myname" value="bar"><img alt="mylabel" src="some.gif"/></button></div></td>
</tr>
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<tr>
<td colspan="2"><div align="left"><input type="submit" id="myname" name="myname" value="bar" disabled="disabled" tabindex="1"/></div></td>
<td colspan="2"><div class="formButton"><input type="submit" id="myname" name="myname" value="bar" disabled="disabled" tabindex="1"/></div></td>
</tr>
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<tr>
<td colspan="2"><div align="right"><input type="submit" id="myname" name="myname" value="Submit" title="mytitle"/></div></td>
<td colspan="2"><div class="formButton"><input type="submit" id="myname" name="myname" value="Submit" title="mytitle"/></div></td>
</tr>
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<tr>
<td colspan="2"><div align="right"><button type="submit" id="myname" name="myname" value="bar" disabled="disabled" tabindex="1">bar</button></div></td>
<td colspan="2"><div class="formButton"><button type="submit" id="myname" name="myname" value="bar" disabled="disabled" tabindex="1">bar</button></div></td>
</tr>
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<tr>
<td colspan="2"><div align="left"><button type="submit" id="myname" name="myname" value="bar">mylabel</button></div></td>
<td colspan="2"><div class="formButton"><button type="submit" id="myname" name="myname" value="bar">mylabel</button></div></td>
</tr>
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<tr>
<td colspan="2"><div align="right"><input type="image" alt="bar" id="myname" name="myname" value="bar" disabled="disabled"/></div></td>
<td colspan="2"><div class="formButton"><input type="image" alt="bar" id="myname" name="myname" value="bar" disabled="disabled"/></div></td>
</tr>
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<tr>
<td colspan="2"><div align="right"><input type="image" alt="mylabel" src="some.gif" id="myname" name="myname" value="bar"/></div></td>
<td colspan="2"><div class="formButton"><input type="image" alt="mylabel" src="some.gif" id="myname" name="myname" value="bar"/></div></td>
</tr>

0 comments on commit a0b3480

Please sign in to comment.