1   /**
2    * Copyright (c) 2000-2008 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.ServletRequest;
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          ServletRequest req = pageContext.getRequest();
42  
43          req.setAttribute("liferay-ui:input-move-boxes:formName", _formName);
44          req.setAttribute("liferay-ui:input-move-boxes:leftTitle", _leftTitle);
45          req.setAttribute("liferay-ui:input-move-boxes:rightTitle", _rightTitle);
46          req.setAttribute(
47              "liferay-ui:input-move-boxes:leftBoxName", _leftBoxName);
48          req.setAttribute(
49              "liferay-ui:input-move-boxes:rightBoxName", _rightBoxName);
50          req.setAttribute(
51              "liferay-ui:input-move-boxes:leftOnChange", _leftOnChange);
52          req.setAttribute(
53              "liferay-ui:input-move-boxes:rightOnChange", _rightOnChange);
54          req.setAttribute(
55              "liferay-ui:input-move-boxes:leftReorder", _leftReorder);
56          req.setAttribute(
57              "liferay-ui:input-move-boxes:rightReorder", _rightReorder);
58          req.setAttribute("liferay-ui:input-move-boxes:leftList", _leftList);
59          req.setAttribute("liferay-ui:input-move-boxes:rightList", _rightList);
60  
61          return EVAL_BODY_BUFFERED;
62      }
63  
64      public void setFormName(String formName) {
65          _formName = formName;
66      }
67  
68      public void setLeftTitle(String leftTitle) {
69          _leftTitle = leftTitle;
70      }
71  
72      public void setRightTitle(String rightTitle) {
73          _rightTitle = rightTitle;
74      }
75  
76      public void setLeftBoxName(String leftBoxName) {
77          _leftBoxName = leftBoxName;
78      }
79  
80      public void setRightBoxName(String rightBoxName) {
81          _rightBoxName = rightBoxName;
82      }
83  
84      public void setLeftOnChange(String leftOnChange) {
85          _leftOnChange = leftOnChange;
86      }
87  
88      public void setRightOnChange(String rightOnChange) {
89          _rightOnChange = rightOnChange;
90      }
91  
92      public void setLeftReorder(String leftReorder) {
93          _leftReorder = leftReorder;
94      }
95  
96      public void setRightReorder(String rightReorder) {
97          _rightReorder = rightReorder;
98      }
99  
100     public void setLeftList(List<KeyValuePair> leftList) {
101         _leftList = leftList;
102     }
103 
104     public void setRightList(List<KeyValuePair> rightList) {
105         _rightList = rightList;
106     }
107 
108     protected String getDefaultPage() {
109         return _PAGE;
110     }
111 
112     private static final String _PAGE =
113         "/html/taglib/ui/input_move_boxes/page.jsp";
114 
115     private String _formName = "fm";
116     private String _leftTitle;
117     private String _rightTitle;
118     private String _leftBoxName;
119     private String _rightBoxName;
120     private String _leftOnChange;
121     private String _rightOnChange;
122     private String _leftReorder;
123     private String _rightReorder;
124     private List<KeyValuePair> _leftList;
125     private List<KeyValuePair> _rightList;
126 
127 }