📄 formbutton.java
字号:
// Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://kpdus.tripod.com/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi space
// Source File Name: FormButton.java
package org.apache.struts2.components;
import com.opensymphony.xwork2.util.ValueStack;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
// Referenced classes of package org.apache.struts2.components:
// UIBean, Form
public abstract class FormButton extends UIBean
{
static final String BUTTONTYPE_INPUT = "input";
static final String BUTTONTYPE_BUTTON = "button";
static final String BUTTONTYPE_IMAGE = "image";
protected String action;
protected String method;
protected String align;
protected String type;
public FormButton(ValueStack stack, HttpServletRequest request, HttpServletResponse response)
{
super(stack, request, response);
}
public void evaluateExtraParams()
{
super.evaluateExtraParams();
if (align == null)
align = "right";
String submitType = "input";
if (type != null && ("button".equalsIgnoreCase(type) || supportsImageType() && "image".equalsIgnoreCase(type)))
submitType = type;
addParameter("type", submitType);
if (!"input".equals(submitType) && label == null)
addParameter("label", getParameters().get("nameValue"));
if (action != null || method != null)
{
String name;
if (action != null)
{
name = (new StringBuilder()).append("action:").append(findString(action)).toString();
if (method != null)
name = (new StringBuilder()).append(name).append("!").append(findString(method)).toString();
} else
{
name = (new StringBuilder()).append("method:").append(findString(method)).toString();
}
addParameter("name", name);
}
addParameter("align", findString(align));
}
protected void populateComponentHtmlId(Form form)
{
String _tmp_id = "";
if (id != null)
{
if (altSyntax())
_tmp_id = findString(id);
else
_tmp_id = id;
} else
{
if (form != null && form.getParameters().get("id") != null)
_tmp_id = (new StringBuilder()).append(_tmp_id).append(form.getParameters().get("id").toString()).append("_").toString();
if (name != null)
_tmp_id = (new StringBuilder()).append(_tmp_id).append(escape(name)).toString();
else
if (action != null || method != null)
{
if (action != null)
_tmp_id = (new StringBuilder()).append(_tmp_id).append(escape(action)).toString();
if (method != null)
_tmp_id = (new StringBuilder()).append(_tmp_id).append("_").append(escape(method)).toString();
} else
if (form != null)
_tmp_id = (new StringBuilder()).append(_tmp_id).append(form.getSequence()).toString();
}
addParameter("id", _tmp_id);
}
protected abstract boolean supportsImageType();
public void setAction(String action)
{
this.action = action;
}
public void setMethod(String method)
{
this.method = method;
}
public void setAlign(String align)
{
this.align = align;
}
public void setType(String type)
{
this.type = type;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -