View Javadoc

1   /*
2    * $Id: DivTag.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.Div;
29  
30  import com.opensymphony.xwork2.util.ValueStack;
31  
32  public class DivTag extends AbstractRemoteTag {
33  
34      private static final long serialVersionUID = 5309231035916461758L;
35  
36      protected String updateFreq;
37      protected String autoStart;
38      protected String delay;
39      protected String startTimerListenTopics;
40      protected String stopTimerListenTopics;
41      protected String refreshOnShow;
42      protected String separateScripts;
43      protected String closable;
44      protected String preload;
45      
46      public Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
47          return new Div(stack, req, res);
48      }
49  
50      protected void populateParams() {
51          super.populateParams();
52  
53          Div div = (Div) component;
54          div.setUpdateFreq(updateFreq);
55          div.setAutoStart(autoStart);
56          div.setDelay(delay);
57          div.setStartTimerListenTopics(startTimerListenTopics);
58          div.setStopTimerListenTopics(stopTimerListenTopics);
59          div.setRefreshOnShow(refreshOnShow);
60          div.setSeparateScripts(separateScripts);
61          div.setClosable(closable);
62          div.setPreload(preload);
63      }
64  
65      public void setAutoStart(String autoStart) {
66          this.autoStart = autoStart;
67      }
68  
69      public void setDelay(String delay) {
70          this.delay = delay;
71      }
72  
73      public void setUpdateFreq(String updateInterval) {
74          this.updateFreq = updateInterval;
75      }
76  
77      public void setStartTimerListenTopics(String startTimerListenTopic) {
78          this.startTimerListenTopics = startTimerListenTopic;
79      }
80  
81      public void setStopTimerListenTopics(String stopTimerListenTopic) {
82          this.stopTimerListenTopics = stopTimerListenTopic;
83      }
84  
85      public void setRefreshOnShow(String refreshOnShow) {
86          this.refreshOnShow = refreshOnShow;
87      }
88  
89      public void setSeparateScripts(String separateScripts) {
90          this.separateScripts = separateScripts;
91      }
92  
93      public void setClosable(String closable) {
94          this.closable = closable;
95      }
96      
97      public void setPreload(String preload) {
98          this.preload = preload;
99      }
100 }