PageRenderTime 21ms CodeModel.GetById 16ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/src/main/java/com/googlecode/struts2yuiplugin/views/jsp/ui/PushButtonTag.java

http://struts2yuiplugin.googlecode.com/
Java | 69 lines | 51 code | 15 blank | 3 comment | 0 complexity | d44646ac9ab0cd4eeb5782cafec34a01 MD5 | raw file
 1package com.googlecode.struts2yuiplugin.views.jsp.ui;
 2
 3import com.googlecode.struts2yuiplugin.components.XHRComponent;
 4import com.googlecode.struts2yuiplugin.components.Submit;
 5import com.googlecode.struts2yuiplugin.components.PushButton;
 6import com.opensymphony.xwork2.util.ValueStack;
 7import org.apache.struts2.components.Component;
 8import org.apache.struts2.views.jsp.ui.FormTag;
 9
10import javax.servlet.http.HttpServletRequest;
11import javax.servlet.http.HttpServletResponse;
12import javax.servlet.jsp.tagext.Tag;
13
14/**
15 * Tag for a YUI button widget of type PushButton
16 */
17public class PushButtonTag extends AbstractYUITag implements XHRComponent {
18
19    private String formId;
20    private String href;
21    private String method;
22    private String target;
23    private String callback;
24    private String clickListener;
25
26    @Override
27    protected void populateParams() {
28        super.populateParams();
29
30        PushButton button = (PushButton) this.component;
31
32        button.setFormId(formId);
33        button.setHref(href);
34        button.setMethod(method);
35        button.setTarget(target);
36        button.setCallback(callback);
37        button.setClickListener(clickListener);
38    }
39
40    @Override
41    public Component getBean(ValueStack valueStack, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) {
42        return new PushButton(valueStack, httpServletRequest, httpServletResponse);
43    }
44   
45    public void setFormId(String formId) {
46        this.formId = formId;
47    }
48
49    public void setHref(String href) {
50        this.href = href;
51    }
52
53    public void setMethod(String method) {
54        this.method = method;
55    }
56
57    public void setTarget(String target) {
58        this.target = target;
59    }
60
61    public void setCallback(String callback) {
62        this.callback = callback;
63    }
64
65    public void setClickListener(String clickListener) {
66        this.clickListener = clickListener;
67    }
68
69}