📄 basecomponentlifecycle.java
字号:
/** * @author <a href="mailto:novotny@gridsphere.org">Jason Novotny</a> * @version $Id: BaseComponentLifecycle.java 4986 2006-08-04 09:54:38Z novotny $ */package org.gridsphere.layout;import org.gridsphere.portlet.impl.SportletProperties;import org.gridsphere.portletcontainer.GridSphereEvent;import javax.portlet.PortletRequest;import java.util.List;/** * The <code>BaseComponentLifecycle</code> provides an abstract implemetation of the * <code>ComponentLifecycle</code> lifecyle methods and is subclassed by the * {@link BasePortletComponent}. */public abstract class BaseComponentLifecycle implements ComponentLifecycle { protected int COMPONENT_ID = 0; protected String componentIDStr = "0"; protected BaseComponentLifecycle() { } /** * Initializes the portlet component. Since the components are isolated * after Castor unmarshalls from XML, the ordering is determined by a * passed in List containing the previous portlet components in the tree. * * @param list a list of component identifiers * @return a list of updated component identifiers * @see ComponentIdentifier */ public List<ComponentIdentifier> init(PortletRequest req, List<ComponentIdentifier> list) { this.COMPONENT_ID = list.size(); componentIDStr = String.valueOf(COMPONENT_ID); return list; } /** * Destroys this portlet component */ public void destroy() { } /** * Returns the associated portlet component id * * @return the portlet component id */ public int getComponentID() { return COMPONENT_ID; } /** * Sets the associated portlet component id * * @param compId the portlet component id */ public void setComponentID(int compId) { this.COMPONENT_ID = compId; } /** * Performs an action on this portlet component * * @param event a gridsphere event */ public void actionPerformed(GridSphereEvent event) { PortletRequest req = event.getActionRequest(); req.setAttribute(SportletProperties.COMPONENT_ID, componentIDStr); } /** * Renders the portlet component * * @param event a gridsphere event */ public abstract void doRender(GridSphereEvent event); public Object clone() throws CloneNotSupportedException { BaseComponentLifecycle b = (BaseComponentLifecycle) super.clone(); b.COMPONENT_ID = this.COMPONENT_ID; b.componentIDStr = this.componentIDStr; return b; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -