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.FriendlyURLNormalizerUtil;
018    import com.liferay.portal.kernel.util.StringPool;
019    import com.liferay.taglib.util.IncludeTag;
020    
021    import javax.servlet.http.HttpServletRequest;
022    
023    /**
024     * @author Brian Wing Shun Chan
025     */
026    public class InputTextAreaTag extends IncludeTag {
027    
028            public void setCssClass(String cssClass) {
029                    _cssClass = cssClass;
030            }
031    
032            public void setDefaultValue(String defaultValue) {
033                    _defaultValue = defaultValue;
034            }
035    
036            public void setDisabled(boolean disabled) {
037                    _disabled = disabled;
038            }
039    
040            public void setParam(String param) {
041                    _param = param;
042            }
043    
044            @Override
045            protected void cleanUp() {
046                    _cssClass = null;
047                    _defaultValue = StringPool.BLANK;
048                    _disabled = false;
049                    _param = null;
050            }
051    
052            @Override
053            protected String getPage() {
054                    return _PAGE;
055            }
056    
057            @Override
058            protected void setAttributes(HttpServletRequest request) {
059                    request.setAttribute("liferay-ui:input-textarea:cssClass", _cssClass);
060                    request.setAttribute(
061                            "liferay-ui:input-textarea:defaultValue", _defaultValue);
062                    request.setAttribute(
063                            "liferay-ui:input-textarea:disabled", String.valueOf(_disabled));
064                    request.setAttribute("liferay-ui:input-textarea:param", _param);
065                    request.setAttribute(
066                            "liferay-ui:input-textarea:paramId",
067                            FriendlyURLNormalizerUtil.normalize(_param));
068            }
069    
070            private static final String _PAGE =
071                    "/html/taglib/ui/input_textarea/page.jsp";
072    
073            private String _cssClass;
074            private String _defaultValue = StringPool.BLANK;
075            private boolean _disabled;
076            private String _param;
077    
078    }