001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.taglib.ui;
016    
017    import com.liferay.portal.kernel.util.KeyValuePair;
018    import com.liferay.taglib.util.IncludeTag;
019    
020    import java.util.List;
021    
022    import javax.servlet.http.HttpServletRequest;
023    
024    /**
025     * @author Brian Wing Shun Chan
026     */
027    public class InputMoveBoxesTag extends IncludeTag {
028    
029            public void setCssClass(String cssClass) {
030                    _cssClass = cssClass;
031            }
032    
033            public void setLeftBoxName(String leftBoxName) {
034                    _leftBoxName = leftBoxName;
035            }
036    
037            public void setLeftList(List<KeyValuePair> leftList) {
038                    _leftList = leftList;
039            }
040    
041            public void setLeftOnChange(String leftOnChange) {
042                    _leftOnChange = leftOnChange;
043            }
044    
045            public void setLeftReorder(String leftReorder) {
046                    _leftReorder = leftReorder;
047            }
048    
049            public void setLeftTitle(String leftTitle) {
050                    _leftTitle = leftTitle;
051            }
052    
053            public void setRightBoxName(String rightBoxName) {
054                    _rightBoxName = rightBoxName;
055            }
056    
057            public void setRightList(List<KeyValuePair> rightList) {
058                    _rightList = rightList;
059            }
060    
061            public void setRightOnChange(String rightOnChange) {
062                    _rightOnChange = rightOnChange;
063            }
064    
065            public void setRightReorder(String rightReorder) {
066                    _rightReorder = rightReorder;
067            }
068    
069            public void setRightTitle(String rightTitle) {
070                    _rightTitle = rightTitle;
071            }
072    
073            protected void cleanUp() {
074                    _cssClass = null;
075                    _leftBoxName = null;
076                    _leftList = null;
077                    _leftOnChange = null;
078                    _leftReorder = null;
079                    _leftTitle = null;
080                    _rightBoxName = null;
081                    _rightList = null;
082                    _rightOnChange = null;
083                    _rightReorder = null;
084                    _rightTitle = null;
085            }
086    
087            protected String getPage() {
088                    return _PAGE;
089            }
090    
091            protected void setAttributes(HttpServletRequest request) {
092                    request.setAttribute("liferay-ui:input-move-boxes:cssClass", _cssClass);
093                    request.setAttribute(
094                            "liferay-ui:input-move-boxes:leftBoxName", _leftBoxName);
095                    request.setAttribute(
096                            "liferay-ui:input-move-boxes:leftList", _leftList);
097                    request.setAttribute(
098                            "liferay-ui:input-move-boxes:leftOnChange", _leftOnChange);
099                    request.setAttribute(
100                            "liferay-ui:input-move-boxes:leftReorder", _leftReorder);
101                    request.setAttribute(
102                            "liferay-ui:input-move-boxes:leftTitle", _leftTitle);
103                    request.setAttribute(
104                            "liferay-ui:input-move-boxes:rightBoxName", _rightBoxName);
105                    request.setAttribute(
106                            "liferay-ui:input-move-boxes:rightList", _rightList);
107                    request.setAttribute(
108                            "liferay-ui:input-move-boxes:rightOnChange", _rightOnChange);
109                    request.setAttribute(
110                            "liferay-ui:input-move-boxes:rightReorder", _rightReorder);
111                    request.setAttribute(
112                            "liferay-ui:input-move-boxes:rightTitle", _rightTitle);
113            }
114    
115            private static final String _PAGE =
116                    "/html/taglib/ui/input_move_boxes/page.jsp";
117    
118            private String _cssClass;
119            private String _leftBoxName;
120            private List<KeyValuePair> _leftList;
121            private String _leftOnChange;
122            private String _leftReorder;
123            private String _leftTitle;
124            private String _rightBoxName;
125            private List<KeyValuePair> _rightList;
126            private String _rightOnChange;
127            private String _rightReorder;
128            private String _rightTitle;
129    
130    }