⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 portlettitlebareventimpl.java

📁 GridSphere 门户 提供一个基于 portlet 的高级开放源代码门户。GridSphere 是在欧盟提供基金的 GridLab 项目下开发的
💻 JAVA
字号:
/* * @author <a href="mailto:novotny@gridsphere.org">Jason Novotny</a> * @version $Id: PortletTitleBarEventImpl.java 5032 2006-08-17 18:15:06Z novotny $ */package org.gridsphere.layout.event.impl;import org.gridsphere.layout.PortletComponent;import org.gridsphere.layout.PortletTitleBar;import org.gridsphere.layout.event.ComponentAction;import org.gridsphere.layout.event.PortletTitleBarEvent;import org.gridsphere.portlet.impl.SportletProperties;import org.gridsphere.portletcontainer.GridSphereEvent;import javax.portlet.PortletMode;import javax.portlet.WindowState;import javax.servlet.http.HttpServletRequest;/** * A <code>PortletTitleBarEventImpl</code> is the concrete implementation of * <code>PortletTitleBarEvent</code> */public class PortletTitleBarEventImpl implements PortletTitleBarEvent {    private ComponentAction action = null;    private int id;    private PortletTitleBar titleBar = null;    private boolean hasStateAction = false;    private boolean hasModeAction = false;    private PortletMode portletMode;    private WindowState windowState;    /**     * Constructs an instance of a PortletTitleBarEventImpl from a general     * portal event and the portlet title bar component id     *     * @param titleBar the portlet title bar     * @param event the GridSphereEvent     * @param id    the portlet title bar component id     */    public PortletTitleBarEventImpl(PortletTitleBar titleBar, GridSphereEvent event, int id) {        this.titleBar = titleBar;        HttpServletRequest request = event.getHttpServletRequest();        this.id = id;        String pMode = request.getParameter(SportletProperties.PORTLET_MODE);        if (pMode != null) {            action = PortletTitleBarEvent.TitleBarAction.MODE_MODIFY;            hasModeAction = true;            try {                portletMode = new PortletMode(pMode);            } catch (Exception e) {                portletMode = PortletMode.VIEW;            }        }        String wState = request.getParameter(SportletProperties.PORTLET_WINDOW);        if (wState != null) {            action = PortletTitleBarEvent.TitleBarAction.WINDOW_MODIFY;            hasStateAction = true;            if (wState != null) {                try {                    windowState = new WindowState(wState);                } catch (Exception e) {                    windowState = WindowState.NORMAL;                }            }        }    }    public boolean hasAction() {        return (action != null);    }    /**     * Returns the portlet title bar event action     *     * @return the portlet title bar event action     */    public ComponentAction getAction() {        return action;    }    /**     * Returns the portlet title bar mode     *     * @return mode the portlet title bar mode     */    public PortletMode getMode() {        return portletMode;    }    /**     * Returns the portlet title bar window state     *     * @return the portlet title bar window state     */    public WindowState getState() {        return windowState;    }    /**     * Returns true if this title bar event signals a window state change     *     * @return true if this title bar event signals a window state change     */    public boolean hasWindowStateAction() {        return hasStateAction;    }    /**     * Returns true if this title bar event signals a portlet mode change     *     * @return true if this title bar event signals a portlet mode change     */    public boolean hasPortletModeAction() {        return hasModeAction;    }    public PortletComponent getPortletComponent() {        return titleBar;    }    /**     * Returns the portlet title bar component id     *     * @return the portlet title bar component id     */    public int getID() {        return id;    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -