PageRenderTime 59ms CodeModel.GetById 44ms app.highlight 9ms RepoModel.GetById 2ms app.codeStats 0ms

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

http://struts2yuiplugin.googlecode.com/
Java | 55 lines | 39 code | 12 blank | 4 comment | 0 complexity | 34d855bc562dd1ae274b682c3b7f2535 MD5 | raw file
 1package com.googlecode.struts2yuiplugin.views.jsp.ui;
 2
 3import com.googlecode.struts2yuiplugin.components.Anchor;
 4import com.googlecode.struts2yuiplugin.components.Div;
 5import com.googlecode.struts2yuiplugin.components.XHRComponent;
 6import com.opensymphony.xwork2.util.ValueStack;
 7import org.apache.struts2.components.Component;
 8
 9import javax.servlet.http.HttpServletRequest;
10import javax.servlet.http.HttpServletResponse;
11
12/**
13 * A div that can load its own HTML content via XHR
14 * 
15 */
16public class DivTag extends AbstractYUITag implements XHRComponent {
17
18    private String formId;
19    private String href;
20    private String method;
21    private String callback;
22
23    @Override
24    public Component getBean(ValueStack valueStack, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) {
25        return new Div(valueStack, httpServletRequest, httpServletResponse);
26    }
27
28    @Override
29    protected void populateParams() {
30        super.populateParams();
31
32        Div div = (Div) this.component;
33        div.setFormId(formId);
34        div.setHref(href);
35        div.setMethod(method);
36        div.setCallback(callback);
37    }
38
39    public void setFormId(String formId) {
40        this.formId = formId;
41    }
42
43    public void setHref(String href) {
44        this.href = href;
45    }
46
47    public void setMethod(String method) {
48        this.method = method;
49    }
50
51    public void setCallback(String callback) {
52        this.callback = callback;
53    }
54
55}