View Javadoc

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