net.sf.doolin.gui.window.dialog
Class AbstractDialogWindow<B>

java.lang.Object
  extended by net.sf.doolin.gui.window.support.AbstractGUIWindow<B>
      extended by net.sf.doolin.gui.window.support.AbstractRootPaneGUIWindow<B>
          extended by net.sf.doolin.gui.window.dialog.AbstractDialogWindow<B>
Type Parameters:
B - Type of data hold by the window
All Implemented Interfaces:
PropertyContainer, GUIWindow<B>
Direct Known Subclasses:
DialogGUIWindow, WizardWindow

public abstract class AbstractDialogWindow<B>
extends AbstractRootPaneGUIWindow<B>

Window for a dialog. It can rely on a JDialog for modal wizards or on a JFrame for modeless wizards.

Author:
Damien Coraboeuf
See Also:
IWindow

Field Summary
 
Fields inherited from class net.sf.doolin.gui.window.support.AbstractRootPaneGUIWindow
menuBarContextMap
 
Constructor Summary
AbstractDialogWindow(DialogActionsFactory dialogActionsFactory)
          Constructor
 
Method Summary
protected  void addWindowListener(WindowListener listener)
           
protected  void build()
          Builds the window.
 void close()
          Closes the dialog
 void display()
          Displays the window on the screen.
protected  ActionBarContext getActionBarContext()
          Returns the paths for the dialog actions
protected  JButton getButton(String name)
           
protected  GUIAction getCloseAction()
          Gets the close action for this dialog.
protected abstract  IWindowFactory getIwindowFactory()
           
protected abstract  boolean isModal()
           
 void onPostCreate()
          Creates the button bar
protected  void setDefaultButton(JButton button)
           
protected  void setSize(WindowSize size)
          Sets the size of the dialog
 void setWindowIcon(Icon icon)
          Sets the icon for the window
 void setWindowTitle(String value)
          Sets the window title.
 
Methods inherited from class net.sf.doolin.gui.window.support.AbstractRootPaneGUIWindow
getRootPanel, getWindowPanel, installMenuBar, installMenuBar, installToolBar, uninstallMenuBar, uninstallToolBar
 
Methods inherited from class net.sf.doolin.gui.window.support.AbstractGUIWindow
addGUIWindowListener, addView, build, canClose, getActionContext, getApplication, getId, getOpenViews, getProperty, getView, getWindowData, getWindowDescriptor, getWindowListeners, isClosed, removeView, setProperty, showView
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractDialogWindow

public AbstractDialogWindow(DialogActionsFactory dialogActionsFactory)
Constructor

Parameters:
dialogActionsFactory - Factory for the dialog actions (ok, cancel, previous, next, finish, cancel...)
Method Detail

addWindowListener

protected void addWindowListener(WindowListener listener)

build

protected void build()
Description copied from class: AbstractGUIWindow
Builds the window.

Overrides:
build in class AbstractRootPaneGUIWindow<B>
See Also:
AbstractGUIWindow.getApplication(), AbstractGUIWindow.getWindowData()

close

public void close()
Closes the dialog

Specified by:
close in interface GUIWindow<B>
Overrides:
close in class AbstractGUIWindow<B>

display

public void display()
Description copied from interface: GUIWindow
Displays the window on the screen.


getActionBarContext

protected ActionBarContext getActionBarContext()
Returns the paths for the dialog actions

Returns:
Paths for the actions
See Also:
DialogActionsFactory.getDialogActions()

getButton

protected JButton getButton(String name)

getCloseAction

protected GUIAction getCloseAction()
Gets the close action for this dialog. By default, it returns the "Cancel" action, then the "cancelAction" of the window descriptor, then null.


getIwindowFactory

protected abstract IWindowFactory getIwindowFactory()

isModal

protected abstract boolean isModal()

onPostCreate

public void onPostCreate()
Creates the button bar

Specified by:
onPostCreate in interface GUIWindow<B>
Overrides:
onPostCreate in class AbstractGUIWindow<B>

setDefaultButton

protected void setDefaultButton(JButton button)

setSize

protected void setSize(WindowSize size)
Sets the size of the dialog

Parameters:
size - Size specification

setWindowIcon

public void setWindowIcon(Icon icon)
Description copied from interface: GUIWindow
Sets the icon for the window

Parameters:
icon - Icon to set

setWindowTitle

public void setWindowTitle(String value)
Description copied from interface: GUIWindow
Sets the window title.

Parameters:
value - Window title


Copyright © 2011. All Rights Reserved.