View Javadoc

1   /*
2    * $Id: SubmitTag.java 651946 2008-04-27 13:41:38Z apetrelli $
3    *
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   *  http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  package org.apache.struts2.dojo.views.jsp.ui;
23  
24  import javax.servlet.http.HttpServletRequest;
25  import javax.servlet.http.HttpServletResponse;
26  
27  import org.apache.struts2.components.Component;
28  import org.apache.struts2.dojo.components.Submit;
29  import org.apache.struts2.views.jsp.ui.AbstractUITag;
30  
31  import com.opensymphony.xwork2.util.ValueStack;
32  
33  /***
34   * @see Submit
35   */
36  public class SubmitTag extends AbstractUITag {
37  
38      private static final long serialVersionUID = 2179281109958301343L;
39  
40      protected String method;
41      protected String align;
42      protected String type;
43      protected String href;
44      protected String listenTopics;
45      protected String notifyTopics;
46      protected String loadingText;
47      protected String errorText;
48      protected String executeScripts;
49      protected String handler;
50      protected String formId;
51      protected String formFilter;
52      protected String src;
53      protected String showErrorTransportText;
54      protected String indicator;
55      protected String showLoadingText;
56      protected String targets;
57      protected String beforeNotifyTopics;
58      protected String afterNotifyTopics;
59      protected String errorNotifyTopics;
60      protected String highlightColor;
61      protected String highlightDuration;
62      protected String validate;
63      protected String ajaxAfterValidation;
64      protected String separateScripts;
65      protected String transport;
66      protected String parseContent;
67      
68      public Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
69          return new Submit(stack, req, res);
70      }
71  
72      protected void populateParams() {
73          super.populateParams();
74  
75          Submit submit = ((Submit) component);
76          submit.setMethod(method);
77          submit.setAlign(align);
78          submit.setType(type);
79          submit.setHref(href);
80          submit.setListenTopics(listenTopics);
81          submit.setLoadingText(loadingText);
82          submit.setErrorText(errorText);
83          submit.setExecuteScripts(executeScripts);
84          submit.setHandler(handler);
85          submit.setFormFilter(formFilter);
86          submit.setFormId(formId);
87          submit.setSrc(src);
88          submit.setTargets(targets);
89          submit.setNotifyTopics(notifyTopics);
90          submit.setShowErrorTransportText(showErrorTransportText);
91          submit.setIndicator(indicator);
92          submit.setShowLoadingText(showLoadingText);
93          submit.setAfterNotifyTopics(afterNotifyTopics);
94          submit.setBeforeNotifyTopics(beforeNotifyTopics);
95          submit.setErrorNotifyTopics(errorNotifyTopics);
96          submit.setHighlightColor(highlightColor);
97          submit.setHighlightDuration(highlightDuration);
98          submit.setValidate(validate);
99          submit.setAjaxAfterValidation(ajaxAfterValidation);
100         submit.setSeparateScripts(separateScripts);
101         submit.setTransport(transport);
102         submit.setParseContent(parseContent);
103     }
104 
105     public void setMethod(String method) {
106         this.method = method;
107     }
108 
109     public void setAlign(String align) {
110         this.align = align;
111     }
112 
113     public String getType() {
114         return type;
115     }
116 
117     public void setType(String type) {
118         this.type = type;
119     }
120 
121     public void setHref(String href) {
122         this.href = href;
123     }
124 
125     public void setErrorText(String errorText) {
126         this.errorText = errorText;
127     }
128 
129     public void setLoadingText(String loadingText) {
130         this.loadingText = loadingText;
131     }
132 
133     public void setListenTopics(String listenTopics) {
134         this.listenTopics = listenTopics;
135     }
136 
137     public void setExecuteScripts(String executeScripts) {
138         this.executeScripts = executeScripts;
139     }
140 
141     public void setHandler(String handler) {
142         this.handler = handler;
143     }
144 
145     public void setFormFilter(String formFilter) {
146         this.formFilter = formFilter;
147     }
148 
149     public void setFormId(String formId) {
150         this.formId = formId;
151     }
152 
153     public void setSrc(String src) {
154         this.src = src;
155     }
156 
157     public void setTargets(String targets) {
158         this.targets = targets;
159     }
160 
161     public void setNotifyTopics(String notifyTopics) {
162         this.notifyTopics = notifyTopics;
163     }
164 
165     public void setShowErrorTransportText(String showErrorTransportText) {
166         this.showErrorTransportText = showErrorTransportText;
167     }
168 
169     public void setIndicator(String indicator) {
170         this.indicator = indicator;
171     }
172 
173     public void setShowLoadingText(String showLoadingText) {
174         this.showLoadingText = showLoadingText;
175     }
176 
177     public void setAfterNotifyTopics(String afterNotifyTopics) {
178         this.afterNotifyTopics = afterNotifyTopics;
179     }
180 
181     public void setBeforeNotifyTopics(String beforeNotifyTopics) {
182         this.beforeNotifyTopics = beforeNotifyTopics;
183     }
184 
185     public void setErrorNotifyTopics(String errorNotifyTopics) {
186         this.errorNotifyTopics = errorNotifyTopics;
187     }
188 
189     public void setHighlightColor(String highlightColor) {
190         this.highlightColor = highlightColor;
191     }
192 
193     public void setHighlightDuration(String highlightDuration) {
194         this.highlightDuration = highlightDuration;
195     }
196 
197     public void setValidate(String validate) {
198         this.validate = validate;
199     }
200 
201     public void setAjaxAfterValidation(String ajaxAfterValidation) {
202         this.ajaxAfterValidation = ajaxAfterValidation;
203     }
204 
205     public void setSeparateScripts(String separateScripts) {
206         this.separateScripts = separateScripts;
207     }
208 
209     public void setTransport(String transport) {
210         this.transport = transport;
211     }
212 
213     public void setParseContent(String parseContent) {
214         this.parseContent = parseContent;
215     }
216 }