View Javadoc

1   /*
2    * $Id: UpDownSelectTag.java 451544 2006-09-30 05:38:02Z mrdon $
3    *
4    * Copyright 2006 The Apache Software Foundation.
5    *
6    * Licensed under the Apache License, Version 2.0 (the "License");
7    * you may not use this file except in compliance with the License.
8    * You may obtain a copy of the License at
9    *
10   *      http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing, software
13   * distributed under the License is distributed on an "AS IS" BASIS,
14   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15   * See the License for the specific language governing permissions and
16   * limitations under the License.
17   */
18  package org.apache.struts2.views.jsp.ui;
19  
20  import javax.servlet.http.HttpServletRequest;
21  import javax.servlet.http.HttpServletResponse;
22  
23  import org.apache.struts2.components.Component;
24  import org.apache.struts2.components.UpDownSelect;
25  
26  import com.opensymphony.xwork2.util.ValueStack;
27  
28  /***
29   * @see UpDownSelect
30   */
31  public class UpDownSelectTag extends SelectTag {
32  
33  	private static final long serialVersionUID = -8136573053799541353L;
34  	
35  	protected String allowMoveUp;
36  	protected String allowMoveDown;
37  	protected String allowSelectAll;
38  	
39  	protected String moveUpLabel;
40  	protected String moveDownLabel;
41  	protected String selectAllLabel;
42  	
43  	
44  	public Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
45  		return new UpDownSelect(stack, req, res);
46  	}
47  	
48  	protected void populateParams() {
49  		super.populateParams();
50  		
51  		UpDownSelect c = (UpDownSelect) component;
52  		
53  		c.setAllowMoveUp(allowMoveUp);
54  		c.setAllowMoveDown(allowMoveDown);
55  		c.setAllowSelectAll(allowSelectAll);
56  		
57  		c.setMoveUpLabel(moveUpLabel);
58  		c.setMoveDownLabel(moveDownLabel);
59  		c.setSelectAllLabel(selectAllLabel);
60  	
61  	}
62  	
63  	
64  	public String getAllowMoveUp() { 
65  		return allowMoveUp;
66  	}
67  	
68  	public void setAllowMoveUp(String allowMoveUp) {
69  		this.allowMoveUp = allowMoveUp;
70  	}
71  	
72  	
73  	
74  	public String getAllowMoveDown() {
75  		return allowMoveDown;
76  	}
77  	
78  	public void setAllowMoveDown(String allowMoveDown) {
79  		this.allowMoveDown = allowMoveDown;
80  	}
81  	
82  	
83  	
84  	public String getAllowSelectAll() {
85  		return allowSelectAll;
86  	}
87  	
88  	public void setAllowSelectAll(String allowSelectAll) {
89  		this.allowSelectAll = allowSelectAll;
90  	}
91  	
92  	
93  	public String getMoveUpLabel() {
94  		return moveUpLabel;
95  	}
96  	
97  	public void setMoveUpLabel(String moveUpLabel) {
98  		this.moveUpLabel = moveUpLabel;
99  	}
100 	
101 	
102 	
103 	public String getMoveDownLabel() {
104 		return moveDownLabel;
105 	}
106 	
107 	public void setMoveDownLabel(String moveDownLabel) {
108 		this.moveDownLabel = moveDownLabel;
109 	}
110 	
111 
112 	
113 	public String getSelectAllLabel() {
114 		return selectAllLabel;
115 	}
116 	
117 	public void setSelectAllLabel(String selectAllLabel) {
118 		this.selectAllLabel = selectAllLabel;
119 	}
120 }