1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    *
5    *
6    *
7    * The contents of this file are subject to the terms of the Liferay Enterprise
8    * Subscription License ("License"). You may not use this file except in
9    * compliance with the License. You can obtain a copy of the License by
10   * contacting Liferay, Inc. See the License for the specific language governing
11   * permissions and limitations under the License, including but not limited to
12   * distribution rights of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.taglib.ui;
24  
25  import com.liferay.portal.kernel.util.KeyValuePair;
26  import com.liferay.taglib.util.IncludeTag;
27  
28  import java.util.List;
29  
30  import javax.servlet.http.HttpServletRequest;
31  
32  /**
33   * <a href="InputMoveBoxesTag.java.html"><b><i>View Source</i></b></a>
34   *
35   * @author Brian Wing Shun Chan
36   */
37  public class InputMoveBoxesTag extends IncludeTag {
38  
39      public int doStartTag() {
40          HttpServletRequest request =
41              (HttpServletRequest)pageContext.getRequest();
42  
43          request.setAttribute("liferay-ui:input-move-boxes:formName", _formName);
44          request.setAttribute(
45              "liferay-ui:input-move-boxes:leftTitle", _leftTitle);
46          request.setAttribute(
47              "liferay-ui:input-move-boxes:rightTitle", _rightTitle);
48          request.setAttribute(
49              "liferay-ui:input-move-boxes:leftBoxName", _leftBoxName);
50          request.setAttribute(
51              "liferay-ui:input-move-boxes:rightBoxName", _rightBoxName);
52          request.setAttribute(
53              "liferay-ui:input-move-boxes:leftOnChange", _leftOnChange);
54          request.setAttribute(
55              "liferay-ui:input-move-boxes:rightOnChange", _rightOnChange);
56          request.setAttribute(
57              "liferay-ui:input-move-boxes:leftReorder", _leftReorder);
58          request.setAttribute(
59              "liferay-ui:input-move-boxes:rightReorder", _rightReorder);
60          request.setAttribute(
61              "liferay-ui:input-move-boxes:leftList", _leftList);
62          request.setAttribute(
63              "liferay-ui:input-move-boxes:rightList", _rightList);
64  
65          return EVAL_BODY_BUFFERED;
66      }
67  
68      public void setFormName(String formName) {
69          _formName = formName;
70      }
71  
72      public void setLeftTitle(String leftTitle) {
73          _leftTitle = leftTitle;
74      }
75  
76      public void setRightTitle(String rightTitle) {
77          _rightTitle = rightTitle;
78      }
79  
80      public void setLeftBoxName(String leftBoxName) {
81          _leftBoxName = leftBoxName;
82      }
83  
84      public void setRightBoxName(String rightBoxName) {
85          _rightBoxName = rightBoxName;
86      }
87  
88      public void setLeftOnChange(String leftOnChange) {
89          _leftOnChange = leftOnChange;
90      }
91  
92      public void setRightOnChange(String rightOnChange) {
93          _rightOnChange = rightOnChange;
94      }
95  
96      public void setLeftReorder(String leftReorder) {
97          _leftReorder = leftReorder;
98      }
99  
100     public void setRightReorder(String rightReorder) {
101         _rightReorder = rightReorder;
102     }
103 
104     public void setLeftList(List<KeyValuePair> leftList) {
105         _leftList = leftList;
106     }
107 
108     public void setRightList(List<KeyValuePair> rightList) {
109         _rightList = rightList;
110     }
111 
112     protected String getDefaultPage() {
113         return _PAGE;
114     }
115 
116     private static final String _PAGE =
117         "/html/taglib/ui/input_move_boxes/page.jsp";
118 
119     private String _formName = "fm";
120     private String _leftTitle;
121     private String _rightTitle;
122     private String _leftBoxName;
123     private String _rightBoxName;
124     private String _leftOnChange;
125     private String _rightOnChange;
126     private String _leftReorder;
127     private String _rightReorder;
128     private List<KeyValuePair> _leftList;
129     private List<KeyValuePair> _rightList;
130 
131 }