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.portal.theme;
016    
017    import com.liferay.portal.kernel.model.PortletDecorator;
018    import com.liferay.portal.kernel.theme.PortletDecoratorFactory;
019    import com.liferay.portal.kernel.util.StringPool;
020    import com.liferay.portal.model.impl.PortletDecoratorImpl;
021    import com.liferay.portal.util.PropsValues;
022    
023    /**
024     * @author Eduardo Garcia
025     */
026    public class PortletDecoratorFactoryImpl implements PortletDecoratorFactory {
027    
028            @Override
029            public PortletDecorator getDefaultPortletDecorator() {
030                    return new PortletDecoratorImpl(
031                            getDefaultPortletDecoratorId(), StringPool.BLANK,
032                            getDefaultPortletDecoratorCssClass());
033            }
034    
035            @Override
036            public String getDefaultPortletDecoratorCssClass() {
037                    return PropsValues.DEFAULT_PORTLET_DECORATOR_CSS_CLASS;
038            }
039    
040            @Override
041            public String getDefaultPortletDecoratorId() {
042                    return PropsValues.DEFAULT_PORTLET_DECORATOR_ID;
043            }
044    
045            @Override
046            public PortletDecorator getPortletDecorator() {
047                    return new PortletDecoratorImpl();
048            }
049    
050            @Override
051            public PortletDecorator getPortletDecorator(String portletDecoratorId) {
052                    return new PortletDecoratorImpl(portletDecoratorId);
053            }
054    
055            @Override
056            public PortletDecorator getPortletDecorator(
057                    String portletDecoratorId, String name, String cssClass) {
058    
059                    return new PortletDecoratorImpl(portletDecoratorId, name, cssClass);
060            }
061    
062    }