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