com.japisoft.framework.dialog
Class DialogManager

java.lang.Object
  extended bycom.japisoft.framework.dialog.DialogManager

public final class DialogManager
extends java.lang.Object

Here a manager for showing a dialog

Version:
1.0
Author:
(c) 2004 JAPISoft / http://www.japisoft.com

Field Summary
static int CANCEL_ID
           
static int DEF_ACTION
           
static int OK_ID
           
 
Constructor Summary
DialogManager()
           
 
Method Summary
static DialogActionModel buildNewActionModel()
           
static DialogComponent getCurrentDialog()
          Helper for having the current dialog instance shown
static int getDefaultAction()
           
static int getDefaultClosingAction()
           
static DialogActionModel getDefaultDialogActionModel()
           
static DialogFooter getDefaultDialogFooter()
           
static DialogHeader getDefaultDialogHeader()
           
static javax.swing.Icon getDefaultDialogIcon()
          Return the default dialog icon
static void resetDefaultLocation(java.awt.Point point)
           
static void resetDefaultSize(java.awt.Dimension dim)
           
static void setAutoCenter(boolean autoCenter)
          Enable the auto center location for dialogs.
static void setDefaultAction(int id)
          Reset the default action ID
static void setDefaultClosingAction(int id)
          Reset the default closing window action when pressing ESCAPE, by default Cancel
static void setDefaultDialogActionModel(DialogActionModel model)
          Reset the default model for dialog action
static void setDefaultDialogFooter(java.lang.Class footerclass)
          Reset the default dialog footer
static void setDefaultDialogHeader(java.lang.Class headerclass)
          Update the default dialog header
static void setDefaultDialogIcon(javax.swing.Icon icon)
          Reset the default dialog icon
static void setDefaultDialogIcon(java.lang.String resourcePath)
           
static int showDialog(java.awt.Window owner, java.lang.String dialogTitle, java.lang.String title, java.lang.String comment, javax.swing.Icon icon, javax.swing.JComponent pane)
           
static int showDialog(java.awt.Window owner, java.lang.String dialogTitle, java.lang.String title, java.lang.String comment, javax.swing.Icon icon, javax.swing.JComponent pane, DialogActionModel model, java.awt.Dimension size)
           
static int showDialog(java.awt.Window owner, java.lang.String dialogTitle, java.lang.String title, java.lang.String comment, javax.swing.Icon icon, javax.swing.JComponent pane, java.awt.Dimension initialSize)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OK_ID

public static int OK_ID

CANCEL_ID

public static int CANCEL_ID

DEF_ACTION

public static int DEF_ACTION
Constructor Detail

DialogManager

public DialogManager()
Method Detail

setDefaultDialogIcon

public static void setDefaultDialogIcon(javax.swing.Icon icon)
Reset the default dialog icon


setDefaultDialogIcon

public static void setDefaultDialogIcon(java.lang.String resourcePath)

getDefaultDialogIcon

public static javax.swing.Icon getDefaultDialogIcon()
Return the default dialog icon


setDefaultDialogActionModel

public static void setDefaultDialogActionModel(DialogActionModel model)
Reset the default model for dialog action


getDefaultDialogActionModel

public static DialogActionModel getDefaultDialogActionModel()
Returns:
the default action model

buildNewActionModel

public static DialogActionModel buildNewActionModel()
Returns:
a new instanceof of the action model cloning the default action model

setDefaultDialogHeader

public static void setDefaultDialogHeader(java.lang.Class headerclass)
Update the default dialog header


getDefaultDialogHeader

public static DialogHeader getDefaultDialogHeader()
Returns:
the default dialog header

getDefaultDialogFooter

public static DialogFooter getDefaultDialogFooter()
Returns:
the default dialog footer with the set of buttons

setDefaultDialogFooter

public static void setDefaultDialogFooter(java.lang.Class footerclass)
Reset the default dialog footer


setDefaultAction

public static void setDefaultAction(int id)
Reset the default action ID


getDefaultAction

public static int getDefaultAction()
Returns:
the default action ID

setDefaultClosingAction

public static void setDefaultClosingAction(int id)
Reset the default closing window action when pressing ESCAPE, by default Cancel


getDefaultClosingAction

public static int getDefaultClosingAction()
Returns:
the default closing when pressing ESCAPE ID

showDialog

public static int showDialog(java.awt.Window owner,
                             java.lang.String dialogTitle,
                             java.lang.String title,
                             java.lang.String comment,
                             javax.swing.Icon icon,
                             javax.swing.JComponent pane)
Parameters:
owner - dialog or frame parent
dialogTitle - The title of the dialog
title - The main title
comment - The user comment
icon - An icon
pane - The user UI element
Returns:
an Action Id like OKAction.ID

showDialog

public static int showDialog(java.awt.Window owner,
                             java.lang.String dialogTitle,
                             java.lang.String title,
                             java.lang.String comment,
                             javax.swing.Icon icon,
                             javax.swing.JComponent pane,
                             java.awt.Dimension initialSize)
Parameters:
owner - dialog or frame parent
dialogTitle - The title of the dialog
title - The main title
comment - The user comment
icon - An icon
pane - The user UI element
initialSize - the default size for the dialog
Returns:
an Action Id like OKAction.ID

showDialog

public static int showDialog(java.awt.Window owner,
                             java.lang.String dialogTitle,
                             java.lang.String title,
                             java.lang.String comment,
                             javax.swing.Icon icon,
                             javax.swing.JComponent pane,
                             DialogActionModel model,
                             java.awt.Dimension size)
Parameters:
owner - dialog or frame parent
dialogTitle - The title of the dialog
title - The main title
comment - The user comment
icon - An icon
pane - The user UI element
model - The model of the available actions like OK
size - The initial size
Returns:
an Action Id like OKAction.ID

getCurrentDialog

public static DialogComponent getCurrentDialog()
Helper for having the current dialog instance shown


setAutoCenter

public static void setAutoCenter(boolean autoCenter)
Enable the auto center location for dialogs. By default to false


resetDefaultSize

public static void resetDefaultSize(java.awt.Dimension dim)
Parameters:
dim - Update for a default size before showing a dialog

resetDefaultLocation

public static void resetDefaultLocation(java.awt.Point point)
Parameters:
point - Update a default location before showing a dialog