View Javadoc

1   /*
2    * $Id: UpDownSelectTag.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.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.components.UpDownSelect;
29  
30  import com.opensymphony.xwork2.util.ValueStack;
31  
32  /***
33   * @see UpDownSelect
34   */
35  public class UpDownSelectTag extends SelectTag {
36  
37      private static final long serialVersionUID = -8136573053799541353L;
38  
39      protected String allowMoveUp;
40      protected String allowMoveDown;
41      protected String allowSelectAll;
42  
43      protected String moveUpLabel;
44      protected String moveDownLabel;
45      protected String selectAllLabel;
46  
47  
48      public Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
49          return new UpDownSelect(stack, req, res);
50      }
51  
52      protected void populateParams() {
53          super.populateParams();
54  
55          UpDownSelect c = (UpDownSelect) component;
56  
57          c.setAllowMoveUp(allowMoveUp);
58          c.setAllowMoveDown(allowMoveDown);
59          c.setAllowSelectAll(allowSelectAll);
60  
61          c.setMoveUpLabel(moveUpLabel);
62          c.setMoveDownLabel(moveDownLabel);
63          c.setSelectAllLabel(selectAllLabel);
64  
65      }
66  
67  
68      public String getAllowMoveUp() {
69          return allowMoveUp;
70      }
71  
72      public void setAllowMoveUp(String allowMoveUp) {
73          this.allowMoveUp = allowMoveUp;
74      }
75  
76  
77  
78      public String getAllowMoveDown() {
79          return allowMoveDown;
80      }
81  
82      public void setAllowMoveDown(String allowMoveDown) {
83          this.allowMoveDown = allowMoveDown;
84      }
85  
86  
87  
88      public String getAllowSelectAll() {
89          return allowSelectAll;
90      }
91  
92      public void setAllowSelectAll(String allowSelectAll) {
93          this.allowSelectAll = allowSelectAll;
94      }
95  
96  
97      public String getMoveUpLabel() {
98          return moveUpLabel;
99      }
100 
101     public void setMoveUpLabel(String moveUpLabel) {
102         this.moveUpLabel = moveUpLabel;
103     }
104 
105 
106 
107     public String getMoveDownLabel() {
108         return moveDownLabel;
109     }
110 
111     public void setMoveDownLabel(String moveDownLabel) {
112         this.moveDownLabel = moveDownLabel;
113     }
114 
115 
116 
117     public String getSelectAllLabel() {
118         return selectAllLabel;
119     }
120 
121     public void setSelectAllLabel(String selectAllLabel) {
122         this.selectAllLabel = selectAllLabel;
123     }
124 }