001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
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            @Override
074            protected void cleanUp() {
075                    _cssClass = null;
076                    _leftBoxName = null;
077                    _leftList = null;
078                    _leftOnChange = null;
079                    _leftReorder = null;
080                    _leftTitle = null;
081                    _rightBoxName = null;
082                    _rightList = null;
083                    _rightOnChange = null;
084                    _rightReorder = null;
085                    _rightTitle = null;
086            }
087    
088            @Override
089            protected String getPage() {
090                    return _PAGE;
091            }
092    
093            @Override
094            protected void setAttributes(HttpServletRequest request) {
095                    request.setAttribute("liferay-ui:input-move-boxes:cssClass", _cssClass);
096                    request.setAttribute(
097                            "liferay-ui:input-move-boxes:leftBoxName", _leftBoxName);
098                    request.setAttribute("liferay-ui:input-move-boxes:leftList", _leftList);
099                    request.setAttribute(
100                            "liferay-ui:input-move-boxes:leftOnChange", _leftOnChange);
101                    request.setAttribute(
102                            "liferay-ui:input-move-boxes:leftReorder", _leftReorder);
103                    request.setAttribute(
104                            "liferay-ui:input-move-boxes:leftTitle", _leftTitle);
105                    request.setAttribute(
106                            "liferay-ui:input-move-boxes:rightBoxName", _rightBoxName);
107                    request.setAttribute(
108                            "liferay-ui:input-move-boxes:rightList", _rightList);
109                    request.setAttribute(
110                            "liferay-ui:input-move-boxes:rightOnChange", _rightOnChange);
111                    request.setAttribute(
112                            "liferay-ui:input-move-boxes:rightReorder", _rightReorder);
113                    request.setAttribute(
114                            "liferay-ui:input-move-boxes:rightTitle", _rightTitle);
115            }
116    
117            private static final String _PAGE =
118                    "/html/taglib/ui/input_move_boxes/page.jsp";
119    
120            private String _cssClass;
121            private String _leftBoxName;
122            private List<KeyValuePair> _leftList;
123            private String _leftOnChange;
124            private String _leftReorder;
125            private String _leftTitle;
126            private String _rightBoxName;
127            private List<KeyValuePair> _rightList;
128            private String _rightOnChange;
129            private String _rightReorder;
130            private String _rightTitle;
131    
132    }