4.8.4 WindowListener
The WindowListener is no longer supported in WebSphere Portal as of version 5.1.
Note: The WindowEvent interface has also been removed in WebSphere Portal V5.1; you should use the PortletWindow.getWindowState() method instead. It is included here for information and as a reference for portlets developed using previous releases.
This interface will notify the portlet that the user has changed the window state. Presently, there are only three supported window states, despite the javadoc. NORMAL, MAXIMIZED and MINIMIZED states are supported. The portlet is notified of these three states through windowMaximized, windowMinimized, and windowRestored, respectively. Though only three states are currently supported, the WindowListener defines methods for windowClosing, windowOpening, windowDetached and windowClosed. This methods are never called. However, in order to implement this interface, all methods must be implemented even though several will contain empty bodies.
Note: You will need to make sure you implement the interface org.apache.jetspeed.portlet.event.WindowListener and not the AWT counterpart since some development environments will offer both.
Example 4-19 Implementing the WindowListener
public void windowMaximized(WindowEvent arg0) throws PortletException { // Some action can be performed } public void windowMinimized(WindowEvent arg0) throws PortletException { // Some action can be performed } public void windowRestored(WindowEvent arg0) throws PortletException { // Some action can be performed } public void windowClosing(WindowEvent arg0) throws PortletException { } public void windowClosed(WindowEvent arg0) throws PortletException { } public void windowDetached(WindowEvent arg0) throws PortletException { }
![]()
ibm.com/redbooks