001    /**
002     * Copyright (c) 2000-present 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.portletext;
016    
017    import com.liferay.taglib.ui.IconTag;
018    
019    import javax.servlet.http.HttpServletRequest;
020    
021    /**
022     * @author Brian Wing Shun Chan
023     */
024    public class IconOptionsTag extends IconTag {
025    
026            public void setDirection(String direction) {
027                    _direction = direction;
028            }
029    
030            public void setShowArrow(boolean showArrow) {
031                    _showArrow = showArrow;
032            }
033    
034            @Override
035            protected void cleanUp() {
036                    super.cleanUp();
037    
038                    _direction = "down";
039                    _showArrow = true;
040            }
041    
042            @Override
043            protected String getPage() {
044                    return "/html/taglib/portlet/icon_options/page.jsp";
045            }
046    
047            @Override
048            protected void setAttributes(HttpServletRequest request) {
049                    super.setAttributes(request);
050    
051                    request.setAttribute("liferay-ui:icon:direction", _direction);
052                    request.setAttribute(
053                            "liferay-ui:icon:showArrow", String.valueOf(_showArrow));
054            }
055    
056            private static String _direction = "down";
057            private static boolean _showArrow = true;
058    
059    }