com.glaivestone.mv
Class UISessionManager

java.lang.Object
  |
  +--com.glaivestone.javax.util.EventManager
        |
        +--com.glaivestone.javax.execution.SessionManager
              |
              +--com.glaivestone.mv.UISessionManager
Direct Known Subclasses:
SwingUISessionManager

public class UISessionManager
extends SessionManager

A UISessionManager should be installed as the current session manager for an application with UI elements.

The UISessionManager.current keeps track of the open main windows in the session and provides notifications of session UI activity to interested observers when windows are opened or closed,

Applications are responsible for notifying the UI session manager when a main window is opened or closed. (Note that dialog windows should generally not be reported, however.) Suitable window event notifications to the UISessionManager.current are provided for by the ApplicationModel framework, so applications implemented within the standard model-view framework do not need to take any special action.

Author:
Deb Lewis

Field Summary
static UISessionManager current
          The session manager for the current application session.
 
Fields inherited from class com.glaivestone.javax.execution.SessionManager
DEFAULT_DIRECTORY, NULL_VALUE
 
Method Summary
 void addWindowListener(WindowEventListener aListener)
          Register a window event listener.
 boolean confirmWindowClose(java.awt.Window aWindow)
          Notify the session manager that a window is going to be closed.
 java.lang.String getDefaultWindowIconReference()
          Specify the reference to the image resource for the default window icon to use for windows in the current session.
 java.util.Collection getOpenWindows()
          Answer a collection containing the open main windows in this session.
 SessionControlPolicy getSessionControlPolicy()
          Answer the control policy for the current UI session.
 boolean hasOpenWindows()
          Answer whether there are open main windows in the current session.
 boolean hasSessionControlPolicy()
          Answer whether a session control policy has been installed in the receiver.
static void installCurrent()
          Install a UISessionManager as the current session manager.
 boolean isActive()
          Answer whether there is activity in the current session.
 void removeWindowListener(WindowEventListener aListener)
          Remove a window event listener.
 void setDefaultWindowIconReference(java.lang.String anImageResourceReference)
          Specify the reference to the image resource for the default window icon to use for windows in the current session.
 void setSessionControlPolicy(SessionControlPolicy aPolicy)
          Set the control policy for the current UI session.
 void windowClosed(java.awt.Window aWindow)
          Notify the session manager that a window has been closed.
 void windowClosing(java.awt.Window aWindow)
          Notify the session manager that a window is going to be closed.
 void windowOpened(java.awt.Window aWindow)
          Notify the session manager that a window has been opened.
 
Methods inherited from class com.glaivestone.javax.execution.SessionManager
addFirstSessionListener, addSessionListener, exit, fireAboutToStartSession, fireSessionStarted, getOption, getOption, getSystemResource, hasOption, registerOption, removeOption, removeSessionListener, shutdown, toString
 
Methods inherited from class com.glaivestone.javax.util.EventManager
addFirstListener, addListener, getEventTable, getEventTableForEdit, getListeners, removeListener
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

current

public static UISessionManager current
The session manager for the current application session.

Method Detail

installCurrent

public static void installCurrent()
Install a UISessionManager as the current session manager.

Should be done exactly once during initial session startup.


addWindowListener

public void addWindowListener(WindowEventListener aListener)
Register a window event listener.

Parameters:
aListener - the window event listener

confirmWindowClose

public boolean confirmWindowClose(java.awt.Window aWindow)
Notify the session manager that a window is going to be closed. Answer whether the close operation should be allowed to proceed.

This service should be used only by the application itself when it closes its view.


getDefaultWindowIconReference

public java.lang.String getDefaultWindowIconReference()
Specify the reference to the image resource for the default window icon to use for windows in the current session.


getOpenWindows

public java.util.Collection getOpenWindows()
Answer a collection containing the open main windows in this session.

Clients must not edit the contents of the window collection.


getSessionControlPolicy

public SessionControlPolicy getSessionControlPolicy()
Answer the control policy for the current UI session.


hasOpenWindows

public boolean hasOpenWindows()
Answer whether there are open main windows in the current session.


hasSessionControlPolicy

public boolean hasSessionControlPolicy()
Answer whether a session control policy has been installed in the receiver.


isActive

public boolean isActive()
Answer whether there is activity in the current session.


removeWindowListener

public void removeWindowListener(WindowEventListener aListener)
Remove a window event listener.

Parameters:
aListener - the window event listener

setDefaultWindowIconReference

public void setDefaultWindowIconReference(java.lang.String anImageResourceReference)
Specify the reference to the image resource for the default window icon to use for windows in the current session.


setSessionControlPolicy

public void setSessionControlPolicy(SessionControlPolicy aPolicy)
Set the control policy for the current UI session. In particular, the session control policy determines when session shutdown occurs.


windowClosed

public void windowClosed(java.awt.Window aWindow)
Notify the session manager that a window has been closed.

This service should be used only by the application itself when it opens its view.


windowClosing

public void windowClosing(java.awt.Window aWindow)
Notify the session manager that a window is going to be closed.

This service should be used only by the application itself when it closes its view.


windowOpened

public void windowOpened(java.awt.Window aWindow)
Notify the session manager that a window has been opened.

This service should be used only by the application itself when it closes its view.


GFL 1.1 API