1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
13   */
14  
15  package com.liferay.taglib.ui;
16  
17  import com.liferay.portal.kernel.util.KeyValuePair;
18  import com.liferay.taglib.util.IncludeTag;
19  
20  import java.util.List;
21  
22  import javax.servlet.http.HttpServletRequest;
23  
24  /**
25   * <a href="InputMoveBoxesTag.java.html"><b><i>View Source</i></b></a>
26   *
27   * @author Brian Wing Shun Chan
28   */
29  public class InputMoveBoxesTag extends IncludeTag {
30  
31      public void setCssClass(String cssClass) {
32          _cssClass = cssClass;
33      }
34  
35      public void setFormName(String formName) {
36          _formName = formName;
37      }
38  
39      public void setLeftBoxName(String leftBoxName) {
40          _leftBoxName = leftBoxName;
41      }
42  
43      public void setLeftList(List<KeyValuePair> leftList) {
44          _leftList = leftList;
45      }
46  
47      public void setLeftOnChange(String leftOnChange) {
48          _leftOnChange = leftOnChange;
49      }
50  
51      public void setLeftReorder(String leftReorder) {
52          _leftReorder = leftReorder;
53      }
54  
55      public void setLeftTitle(String leftTitle) {
56          _leftTitle = leftTitle;
57      }
58  
59      public void setRightBoxName(String rightBoxName) {
60          _rightBoxName = rightBoxName;
61      }
62  
63      public void setRightList(List<KeyValuePair> rightList) {
64          _rightList = rightList;
65      }
66  
67      public void setRightOnChange(String rightOnChange) {
68          _rightOnChange = rightOnChange;
69      }
70  
71      public void setRightReorder(String rightReorder) {
72          _rightReorder = rightReorder;
73      }
74  
75      public void setRightTitle(String rightTitle) {
76          _rightTitle = rightTitle;
77      }
78  
79      protected void cleanUp() {
80          _cssClass = null;
81          _formName = "fm";
82          _leftBoxName = null;
83          _leftList = null;
84          _leftOnChange = null;
85          _leftReorder = null;
86          _leftTitle = null;
87          _rightBoxName = null;
88          _rightList = null;
89          _rightOnChange = null;
90          _rightReorder = null;
91          _rightTitle = null;
92      }
93  
94      protected String getPage() {
95          return _PAGE;
96      }
97  
98      protected void setAttributes(HttpServletRequest request) {
99          request.setAttribute("liferay-ui:input-move-boxes:cssClass", _cssClass);
100         request.setAttribute("liferay-ui:input-move-boxes:formName", _formName);
101         request.setAttribute(
102             "liferay-ui:input-move-boxes:leftBoxName", _leftBoxName);
103         request.setAttribute(
104             "liferay-ui:input-move-boxes:leftList", _leftList);
105         request.setAttribute(
106             "liferay-ui:input-move-boxes:leftOnChange", _leftOnChange);
107         request.setAttribute(
108             "liferay-ui:input-move-boxes:leftReorder", _leftReorder);
109         request.setAttribute(
110             "liferay-ui:input-move-boxes:leftTitle", _leftTitle);
111         request.setAttribute(
112             "liferay-ui:input-move-boxes:rightBoxName", _rightBoxName);
113         request.setAttribute(
114             "liferay-ui:input-move-boxes:rightList", _rightList);
115         request.setAttribute(
116             "liferay-ui:input-move-boxes:rightOnChange", _rightOnChange);
117         request.setAttribute(
118             "liferay-ui:input-move-boxes:rightReorder", _rightReorder);
119         request.setAttribute(
120             "liferay-ui:input-move-boxes:rightTitle", _rightTitle);
121     }
122 
123     private static final String _PAGE =
124         "/html/taglib/ui/input_move_boxes/page.jsp";
125 
126     private String _cssClass;
127     private String _formName = "fm";
128     private String _leftBoxName;
129     private List<KeyValuePair> _leftList;
130     private String _leftOnChange;
131     private String _leftReorder;
132     private String _leftTitle;
133     private String _rightBoxName;
134     private List<KeyValuePair> _rightList;
135     private String _rightOnChange;
136     private String _rightReorder;
137     private String _rightTitle;
138 
139 }