com.liferay.portal.kernel.portlet.configuration.icon.BasePortletConfigurationIcon.java Source code

Java tutorial

Introduction

Here is the source code for com.liferay.portal.kernel.portlet.configuration.icon.BasePortletConfigurationIcon.java

Source

/**
 * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package com.liferay.portal.kernel.portlet.configuration.icon;

import com.liferay.portal.kernel.model.Layout;
import com.liferay.portal.kernel.theme.ThemeDisplay;
import com.liferay.portal.kernel.util.PortalUtil;
import com.liferay.portal.kernel.util.PropsKeys;
import com.liferay.portal.kernel.util.PropsUtil;
import com.liferay.portal.kernel.util.WebKeys;

import java.io.IOException;

import java.util.Locale;
import java.util.Map;
import java.util.ResourceBundle;

import javax.portlet.PortletRequest;
import javax.portlet.PortletResponse;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author Eudaldo Alonso
 */
public abstract class BasePortletConfigurationIcon implements PortletConfigurationIcon {

    @Override
    public String getAlt() {
        return null;
    }

    @Override
    public String getAriaRole() {
        return null;
    }

    @Override
    public String getCssClass() {
        return null;
    }

    @Override
    public Map<String, Object> getData() {
        return null;
    }

    @Override
    public String getIconCssClass() {
        return null;
    }

    @Override
    public String getId() {
        return null;
    }

    @Override
    public String getImage() {
        return null;
    }

    @Override
    public String getImageHover() {
        return null;
    }

    @Override
    public String getLang() {
        return null;
    }

    @Override
    public String getLinkCssClass() {
        return null;
    }

    @Override
    public String getMessage(PortletRequest portletRequest) {
        return null;
    }

    @Override
    public String getMethod() {
        return null;
    }

    @Override
    public String getOnClick(PortletRequest portletRequest, PortletResponse portletResponse) {

        return null;
    }

    public ResourceBundle getResourceBundle(Locale locale) {
        return PortalUtil.getResourceBundle(locale);
    }

    @Override
    public String getSrc() {
        return null;
    }

    @Override
    public String getSrcHover() {
        return null;
    }

    @Override
    public String getTarget() {
        return null;
    }

    @Override
    public String getURL(PortletRequest portletRequest, PortletResponse portletResponse) {

        return null;
    }

    @Override
    public double getWeight() {
        return 0;
    }

    /**
     * @throws IOException
     */
    @Override
    public boolean include(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse)
            throws IOException {

        return false;
    }

    @Override
    public boolean isLabel() {
        return false;
    }

    @Override
    public boolean isToolTip() {
        return false;
    }

    @Override
    public boolean isUseDialog() {
        return false;
    }

    protected Locale getLocale(PortletRequest portletRequest) {
        ThemeDisplay themeDisplay = (ThemeDisplay) portletRequest.getAttribute(WebKeys.THEME_DISPLAY);

        return themeDisplay.getLocale();
    }

    protected boolean isEmbeddedPersonalApplicationLayout(Layout layout) {
        if (layout.isTypeControlPanel()) {
            return false;
        }

        String layoutFriendlyURL = layout.getFriendlyURL();

        if (layout.isSystem()
                && layoutFriendlyURL.equals(PropsUtil.get(PropsKeys.CONTROL_PANEL_LAYOUT_FRIENDLY_URL))) {

            return true;
        }

        return false;
    }

}