001    /**
002     * Copyright (c) 2000-2010 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.taglib.util.IncludeTag;
018    
019    import javax.servlet.http.HttpServletRequest;
020    
021    /**
022     * @author Brian Wing Shun Chan
023     */
024    public class InputEditorTag extends IncludeTag {
025    
026            public void setCssClass(String cssClass) {
027                    _cssClass = cssClass;
028            }
029    
030            public void setEditorImpl(String editorImpl) {
031                    _editorImpl = editorImpl;
032            }
033    
034            public void setHeight(String height) {
035                    _height = height;
036            }
037    
038            public void setInitMethod(String initMethod) {
039                    _initMethod = initMethod;
040            }
041    
042            public void setName(String name) {
043                    _name = name;
044            }
045    
046            public void setOnChangeMethod(String onChangeMethod) {
047                    _onChangeMethod = onChangeMethod;
048            }
049    
050            public void setToolbarSet(String toolbarSet) {
051                    _toolbarSet = toolbarSet;
052            }
053    
054            public void setWidth(String width) {
055                    _width = width;
056            }
057    
058            protected void cleanUp() {
059                    _cssClass = null;
060                    _editorImpl = null;
061                    _height = null;
062                    _initMethod = null;
063                    _name = null;
064                    _onChangeMethod = null;
065                    _toolbarSet = null;
066                    _width = null;
067            }
068    
069            protected String getPage() {
070                    return _PAGE;
071            }
072    
073            protected void setAttributes(HttpServletRequest request) {
074                    request.setAttribute("liferay-ui:input-editor:cssClass", _cssClass);
075                    request.setAttribute("liferay-ui:input-editor:editorImpl", _editorImpl);
076                    request.setAttribute("liferay-ui:input-editor:height", _height);
077                    request.setAttribute("liferay-ui:input-editor:initMethod", _initMethod);
078                    request.setAttribute("liferay-ui:input-editor:name", _name);
079                    request.setAttribute(
080                            "liferay-ui:input-editor:onChangeMethod", _onChangeMethod);
081                    request.setAttribute("liferay-ui:input-editor:toolbarSet", _toolbarSet);
082                    request.setAttribute("liferay-ui:input-editor:width", _width);
083            }
084    
085            private static final String _PAGE = "/html/taglib/ui/input_editor/page.jsp";
086    
087            private String _cssClass;
088            private String _editorImpl;
089            private String _height;
090            private String _initMethod;
091            private String _name;
092            private String _onChangeMethod;
093            private String _toolbarSet;
094            private String _width;
095    
096    }