001    /**
002     * Copyright (c) 2000-2013 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.taglib.util.IncludeTag;
018    
019    import java.util.Map;
020    
021    import javax.servlet.http.HttpServletRequest;
022    
023    /**
024     * @author Sergio Gonz??lez
025     */
026    public class AppViewDisplayStyleTag extends IncludeTag {
027    
028            @Override
029            public int doStartTag() {
030                    return EVAL_BODY_INCLUDE;
031            }
032    
033            public void setDisplayStyle(String displayStyle) {
034                    _displayStyle = displayStyle;
035            }
036    
037            public void setDisplayStyles(String[] displayStyles) {
038                    _displayStyles = displayStyles;
039            }
040    
041            public void setRequestParams(Map<String, String> requestParams) {
042                    _requestParams = requestParams;
043            }
044    
045            @Override
046            protected void cleanUp() {
047                    _displayStyle = null;
048                    _displayStyles = null;
049                    _requestParams = null;
050            }
051    
052            @Override
053            protected String getPage() {
054                    return _PAGE;
055            }
056    
057            @Override
058            protected boolean isCleanUpSetAttributes() {
059                    return _CLEAN_UP_SET_ATTRIBUTES;
060            }
061    
062            @Override
063            protected void setAttributes(HttpServletRequest request) {
064                    request.setAttribute(
065                            "liferay-ui:app-view-display-style:displayStyle", _displayStyle);
066                    request.setAttribute(
067                            "liferay-ui:app-view-display-style:displayStyles", _displayStyles);
068                    request.setAttribute(
069                            "liferay-ui:app-view-display-style:requestParams", _requestParams);
070            }
071    
072            private static final boolean _CLEAN_UP_SET_ATTRIBUTES = true;
073    
074            private static final String _PAGE =
075                    "/html/taglib/ui/app_view_display_style/page.jsp";
076    
077            private String _displayStyle;
078            private String[] _displayStyles;
079            private Map<String, String> _requestParams;
080    
081    }