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.kernel.util;
016    
017    import com.liferay.portal.kernel.model.Theme;
018    import com.liferay.portal.kernel.security.pacl.permission.PortalRuntimePermission;
019    
020    /**
021     * @author Harrison Schueler
022     */
023    public class ThemeFactoryUtil {
024    
025            public static Theme getDefaultRegularTheme(long companyId) {
026                    return getThemeFactory().getDefaultRegularTheme(companyId);
027            }
028    
029            public static String getDefaultRegularThemeId(long companyId) {
030                    return getThemeFactory().getDefaultRegularThemeId(companyId);
031            }
032    
033            public static Theme getTheme() {
034                    return getThemeFactory().getTheme();
035            }
036    
037            public static Theme getTheme(String themeId) {
038                    return getThemeFactory().getTheme(themeId);
039            }
040    
041            public static Theme getTheme(String themeId, String name) {
042                    return getThemeFactory().getTheme(themeId, name);
043            }
044    
045            public static ThemeFactory getThemeFactory() {
046                    PortalRuntimePermission.checkGetBeanProperty(ThemeFactoryUtil.class);
047    
048                    return _ThemeFactory;
049            }
050    
051            public void setThemeFactory(ThemeFactory ThemeFactory) {
052                    PortalRuntimePermission.checkSetBeanProperty(getClass());
053    
054                    _ThemeFactory = ThemeFactory;
055            }
056    
057            private static ThemeFactory _ThemeFactory;
058    
059    }