1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions 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   */
38  public class InputMoveBoxesTag extends IncludeTag {
39  
40      public int doStartTag() {
41          HttpServletRequest request =
42              (HttpServletRequest)pageContext.getRequest();
43  
44          request.setAttribute("liferay-ui:input-move-boxes:formName", _formName);
45          request.setAttribute(
46              "liferay-ui:input-move-boxes:leftTitle", _leftTitle);
47          request.setAttribute(
48              "liferay-ui:input-move-boxes:rightTitle", _rightTitle);
49          request.setAttribute(
50              "liferay-ui:input-move-boxes:leftBoxName", _leftBoxName);
51          request.setAttribute(
52              "liferay-ui:input-move-boxes:rightBoxName", _rightBoxName);
53          request.setAttribute(
54              "liferay-ui:input-move-boxes:leftOnChange", _leftOnChange);
55          request.setAttribute(
56              "liferay-ui:input-move-boxes:rightOnChange", _rightOnChange);
57          request.setAttribute(
58              "liferay-ui:input-move-boxes:leftReorder", _leftReorder);
59          request.setAttribute(
60              "liferay-ui:input-move-boxes:rightReorder", _rightReorder);
61          request.setAttribute(
62              "liferay-ui:input-move-boxes:leftList", _leftList);
63          request.setAttribute(
64              "liferay-ui:input-move-boxes:rightList", _rightList);
65  
66          return EVAL_BODY_BUFFERED;
67      }
68  
69      public void setFormName(String formName) {
70          _formName = formName;
71      }
72  
73      public void setLeftTitle(String leftTitle) {
74          _leftTitle = leftTitle;
75      }
76  
77      public void setRightTitle(String rightTitle) {
78          _rightTitle = rightTitle;
79      }
80  
81      public void setLeftBoxName(String leftBoxName) {
82          _leftBoxName = leftBoxName;
83      }
84  
85      public void setRightBoxName(String rightBoxName) {
86          _rightBoxName = rightBoxName;
87      }
88  
89      public void setLeftOnChange(String leftOnChange) {
90          _leftOnChange = leftOnChange;
91      }
92  
93      public void setRightOnChange(String rightOnChange) {
94          _rightOnChange = rightOnChange;
95      }
96  
97      public void setLeftReorder(String leftReorder) {
98          _leftReorder = leftReorder;
99      }
100 
101     public void setRightReorder(String rightReorder) {
102         _rightReorder = rightReorder;
103     }
104 
105     public void setLeftList(List<KeyValuePair> leftList) {
106         _leftList = leftList;
107     }
108 
109     public void setRightList(List<KeyValuePair> rightList) {
110         _rightList = rightList;
111     }
112 
113     protected String getDefaultPage() {
114         return _PAGE;
115     }
116 
117     private static final String _PAGE =
118         "/html/taglib/ui/input_move_boxes/page.jsp";
119 
120     private String _formName = "fm";
121     private String _leftTitle;
122     private String _rightTitle;
123     private String _leftBoxName;
124     private String _rightBoxName;
125     private String _leftOnChange;
126     private String _rightOnChange;
127     private String _leftReorder;
128     private String _rightReorder;
129     private List<KeyValuePair> _leftList;
130     private List<KeyValuePair> _rightList;
131 
132 }