jgnash.ui.util
Class DialogUtils

java.lang.Object
  extended by jgnash.ui.util.DialogUtils

public class DialogUtils
extends java.lang.Object

Static Dialog Utilities

Version:
$Id$
Author:
Craig Cavanaugh

Constructor Summary
private DialogUtils()
           
 
Method Summary
static void addBoundsListener(java.awt.Window w)
           
static void addBoundsListener(java.awt.Window w, java.lang.String key)
           
private static void addBoundsListener(java.awt.Window w, java.lang.String prefNode, java.lang.String key)
          Listens to a JDialog to save and restore windows bounds automatically.
static void addEscapeListener(javax.swing.JDialog dialog)
           
static void addSizeListener(java.awt.Window w)
           
private static void addSizeListener(java.awt.Window w, java.lang.String key)
           
private static void addSizeListener(java.awt.Window w, java.lang.String prefNode, java.lang.String key)
          Listens to a JDialog to save and restore the size automatically.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DialogUtils

private DialogUtils()
Method Detail

addBoundsListener

private static void addBoundsListener(java.awt.Window w,
                                      java.lang.String prefNode,
                                      java.lang.String key)
Listens to a JDialog to save and restore windows bounds automatically.

setVisible(false) and dispose() must not be used to close the window. Instead, dispatch a window closing event.

 dispatchEvent(new WindowEvent(this, WindowEvent.WINDOW_CLOSING));
 
and the dialog must be set to dispose on close
 setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
 

Parameters:
w - Window to listen to
prefNode - String identifier to preference node to save and restore from
key - the key to save and restore from

addBoundsListener

public static void addBoundsListener(java.awt.Window w,
                                     java.lang.String key)

addBoundsListener

public static void addBoundsListener(java.awt.Window w)

addSizeListener

private static void addSizeListener(java.awt.Window w,
                                    java.lang.String prefNode,
                                    java.lang.String key)
Listens to a JDialog to save and restore the size automatically.

setVisible(false) and dispose() must not be used to close the window. Instead, dispatch a window closing event.

 dispatchEvent(new WindowEvent(this, WindowEvent.WINDOW_CLOSING));
 
and the dialog must be set to dispose on close
 setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
 

Parameters:
w - Window to listen to
prefNode - String identifier to preference node to save and restore from
key - the key to save and restore from

addSizeListener

private static void addSizeListener(java.awt.Window w,
                                    java.lang.String key)

addSizeListener

public static void addSizeListener(java.awt.Window w)

addEscapeListener

public static void addEscapeListener(javax.swing.JDialog dialog)