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