com.glaivestone.mv.swing
Class SwingUISessionManager

java.lang.Object
  |
  +--com.glaivestone.javax.util.EventManager
        |
        +--com.glaivestone.javax.execution.SessionManager
              |
              +--com.glaivestone.mv.UISessionManager
                    |
                    +--com.glaivestone.mv.swing.SwingUISessionManager

public class SwingUISessionManager
extends UISessionManager

A SwingUISessionManager should be installed as the current session manager for an application using Swing UI elements. The standard UISessionManager is extended to provide some Swing-specific LAF facilities.

Author:
Deb Lewis

Field Summary
static javax.swing.LookAndFeel CROSS_PLATFORM_LAF
           
static SwingUISessionManager current
          The session manager for the current application session.
static javax.swing.LookAndFeel DEFAULT_LAF
           
static javax.swing.LookAndFeel HOST_SYSTEM_LAF
           
 
Fields inherited from class com.glaivestone.javax.execution.SessionManager
DEFAULT_DIRECTORY, NULL_VALUE
 
Method Summary
 javax.swing.LookAndFeel getCurrentLookAndFeel()
          Answer the look and feel to use for windows in this session.
static javax.swing.LookAndFeel getLookAndFeel(java.lang.String className)
          Returns a new instance of the specified Swing look-and-feel class.
 boolean installCrossPlatformLookAndFeel()
          Install the standard Java cross-platorm look-and-feel as the current LAF for windows in the current session.
static void installCurrent()
          Install a SwingUISessionManager as the current session manager.
 boolean installHostSystemLookAndFeel()
          Install the host system look-and-feel as the current LAF for windows in the current session.
 boolean installLookAndFeel(javax.swing.LookAndFeel aLookAndFeel)
          Install the given Swing LookAndFeel as the look-and-feel for windows this session.
 boolean installLookAndFeel(java.lang.String className)
          /** Install the specified Swing LookAndFeel as the look-and-feel for windows this session.
 void setEscapeKeyClosesDialogs(boolean escapeKeyClosesDialogs)
          Specify whether the ESC key should invoke the close operation on a dialog window.
 boolean shouldEscapeKeyCloseDialogWindows()
          Answer whether the Escape key should close dialog windows in the current UI session.
 
Methods inherited from class com.glaivestone.mv.UISessionManager
addWindowListener, confirmWindowClose, getDefaultWindowIconReference, getOpenWindows, getSessionControlPolicy, hasOpenWindows, hasSessionControlPolicy, isActive, removeWindowListener, setDefaultWindowIconReference, setSessionControlPolicy, windowClosed, windowClosing, windowOpened
 
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 SwingUISessionManager current
The session manager for the current application session.


HOST_SYSTEM_LAF

public static final javax.swing.LookAndFeel HOST_SYSTEM_LAF

CROSS_PLATFORM_LAF

public static final javax.swing.LookAndFeel CROSS_PLATFORM_LAF

DEFAULT_LAF

public static final javax.swing.LookAndFeel DEFAULT_LAF
Method Detail

getLookAndFeel

public static javax.swing.LookAndFeel getLookAndFeel(java.lang.String className)
Returns a new instance of the specified Swing look-and-feel class. Returns null if not available.


installCurrent

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

Should be done exactly once during initial session startup.


getCurrentLookAndFeel

public javax.swing.LookAndFeel getCurrentLookAndFeel()
Answer the look and feel to use for windows in this session.


installCrossPlatformLookAndFeel

public boolean installCrossPlatformLookAndFeel()
Install the standard Java cross-platorm look-and-feel as the current LAF for windows in the current session. Answer whether successful.


installLookAndFeel

public boolean installLookAndFeel(javax.swing.LookAndFeel aLookAndFeel)
Install the given Swing LookAndFeel as the look-and-feel for windows this session. Answer whether successful.

This service fails quietly by suppressing the failure exception, so it should only be used for LAF which are known to be supported.


installLookAndFeel

public boolean installLookAndFeel(java.lang.String className)
/** Install the specified Swing LookAndFeel as the look-and-feel for windows this session. Answer whether successful.

This service fails quietly by suppressing the failure exception, so it should only be used for standard LAF which are known to exist.


installHostSystemLookAndFeel

public boolean installHostSystemLookAndFeel()
Install the host system look-and-feel as the current LAF for windows in the current session. Answer whether successful.


setEscapeKeyClosesDialogs

public void setEscapeKeyClosesDialogs(boolean escapeKeyClosesDialogs)
Specify whether the ESC key should invoke the close operation on a dialog window.

The current system LAF should normally dictate this behavior.


shouldEscapeKeyCloseDialogWindows

public boolean shouldEscapeKeyCloseDialogWindows()
Answer whether the Escape key should close dialog windows in the current UI session.


GFL 1.1 API