org.springframework.richclient.dialog
Class AbstractDialogPage

java.lang.Object
  extended by org.springframework.richclient.application.support.ApplicationServicesAccessor
      extended by org.springframework.richclient.core.LabeledObjectSupport
          extended by org.springframework.richclient.dialog.AbstractDialogPage
All Implemented Interfaces:
PropertyChangePublisher, CommandLabelConfigurable, DescribedElement, DescriptionConfigurable, Guarded, TitleConfigurable, VisualizedElement, DialogPage, Messagable, ControlFactory, IconConfigurable, ImageConfigurable
Direct Known Subclasses:
AbstractWizardPage, CompositeDialogPage, FormBackedDialogPage, PreferencePage

public abstract class AbstractDialogPage
extends LabeledObjectSupport
implements DialogPage, ControlFactory, Guarded, IconConfigurable

A convenience implementation of the DialogPage interface. Recommended to be used as a base class for all GUI dialog pages (or panes.)

Author:
Keith Donald
See Also:
DialogPage

Field Summary
 
Fields inherited from class org.springframework.richclient.core.LabeledObjectSupport
logger
 
Fields inherited from interface org.springframework.richclient.dialog.DialogPage
DESCRIPTION_PROPERTY, PAGE_COMPLETE_PROPERTY
 
Fields inherited from interface org.springframework.richclient.dialog.Messagable
MESSAGE_PROPERTY
 
Fields inherited from interface org.springframework.richclient.core.DescribedElement
CAPTION_PROPERTY, DESCRIPTION_PROPERTY, DISPLAY_NAME_PROPERTY
 
Constructor Summary
protected AbstractDialogPage(String pageId)
          Creates a new dialog page.
protected AbstractDialogPage(String pageId, boolean autoConfigure)
          Creates a new dialog page.
protected AbstractDialogPage(String pageId, boolean autoConfigure, String title)
          Creates a new dialog page with the given title.
protected AbstractDialogPage(String pageId, boolean autoConfigure, String title, Image icon)
          Creates a new dialog page with the given title and image.
 
Method Summary
protected abstract  JComponent createControl()
           
 JComponent getControl()
          Returns the control that this factory is responsible for producing.
 Icon getIcon()
          Returns the icon associated with the application component, or null.
 String getId()
          Returns this page's name.
 Message getMessage()
          Returns the current message for this dialog page.
 Window getParentWindowControl()
           
 String getTitle()
          Returns this dialog page's title.
 boolean hasErrorMessage()
           
 boolean hasInfoMessage()
           
 boolean hasWarningMessage()
           
 boolean isControlCreated()
           
 boolean isEnabled()
          Indicates if the object is in an enabled state.
 boolean isPageComplete()
          Returns whether this page is complete or not.
 boolean isVisible()
          Returns the visibility of this dialog page.
 void performHelp()
          This default implementation of an AbstractDialogPage method does nothing.
 void setEnabled(boolean enabled)
          Sets the enabled state of the object.
 void setIcon(Icon icon)
           
protected  void setId(String pageId, boolean autoConfigure)
           
 void setMessage(Message newMessage)
          Sets or clears the message for this page.
 void setPageComplete(boolean pageComplete)
           
 void setVisible(boolean visible)
          Sets the visibility of this dialog page.
 
Methods inherited from class org.springframework.richclient.core.LabeledObjectSupport
addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, getAccelerator, getCaption, getDescription, getDisplayName, getImage, getLabel, getMnemonic, getMnemonicIndex, hasChanged, hasChanged, hasChanged, removePropertyChangeListener, removePropertyChangeListener, setCaption, setDescription, setImage, setLabelInfo, setTitle, toString
 
Methods inherited from class org.springframework.richclient.application.support.ApplicationServicesAccessor
getActiveWindow, getApplication, getApplicationContext, getApplicationName, getApplicationServices, getCommandConfigurer, getComponentFactory, getConversionService, getIconSource, getImageSource, getMessage, getMessage, getMessage, getMessage, getMessages, getMessageSource, getObjectConfigurer, getService
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.springframework.richclient.dialog.DialogPage
getDescription, getImage
 
Methods inherited from interface org.springframework.binding.value.PropertyChangePublisher
addPropertyChangeListener, addPropertyChangeListener, removePropertyChangeListener, removePropertyChangeListener
 

Constructor Detail

AbstractDialogPage

protected AbstractDialogPage(String pageId)
Creates a new dialog page. This titles of this dialog page will be configured using the default ObjectConfigurer.

Parameters:
pageId - the id of this dialog page. This will be used to configure the page.

AbstractDialogPage

protected AbstractDialogPage(String pageId,
                             boolean autoConfigure)
Creates a new dialog page.

Parameters:
pageId - the id of this dialog page
autoConfigure - whether or not to use an ObjectConfigurer to configure the titles of this dialog page using the given pageId

AbstractDialogPage

protected AbstractDialogPage(String pageId,
                             boolean autoConfigure,
                             String title)
Creates a new dialog page with the given title.

Parameters:
pageId - the id of this dialog page
autoConfigure - whether or not to use an ObjectConfigurer to configure the titles of this dialog page using the given pageId
title - the title of this dialog page, or null if none

AbstractDialogPage

protected AbstractDialogPage(String pageId,
                             boolean autoConfigure,
                             String title,
                             Image icon)
Creates a new dialog page with the given title and image.

Parameters:
pageId - the id of this dialog page
autoConfigure - whether or not to use an ObjectConfigurer to configure the titles of this dialog page using the given pageId
title - the title of this dialog page, or null if none
icon - the image for this dialog page, or null if none
Method Detail

getId

public String getId()
Description copied from interface: DialogPage
Returns this page's name.

Specified by:
getId in interface DialogPage
Returns:
the name of this page

setId

protected void setId(String pageId,
                     boolean autoConfigure)

getTitle

public String getTitle()
Description copied from interface: DialogPage
Returns this dialog page's title.

Specified by:
getTitle in interface DialogPage
Returns:
the title of this dialog page, or null if none

getMessage

public Message getMessage()
Description copied from interface: DialogPage
Returns the current message for this dialog page.

Specified by:
getMessage in interface DialogPage
Returns:
the message, or null if none

setMessage

public void setMessage(Message newMessage)
Sets or clears the message for this page.

Specified by:
setMessage in interface Messagable
Parameters:
newMessage - the message, or null to clear the message

hasErrorMessage

public boolean hasErrorMessage()

hasWarningMessage

public boolean hasWarningMessage()

hasInfoMessage

public boolean hasInfoMessage()

setVisible

public void setVisible(boolean visible)
Description copied from interface: DialogPage
Sets the visibility of this dialog page.

Specified by:
setVisible in interface DialogPage
Parameters:
visible - true to make this page visible, and false to hide it

isVisible

public boolean isVisible()
Description copied from interface: DialogPage
Returns the visibility of this dialog page.

Specified by:
isVisible in interface DialogPage
Returns:
true this page is visible, or false if this page is hidden

isPageComplete

public boolean isPageComplete()
Description copied from interface: DialogPage
Returns whether this page is complete or not.

This information is typically to decide when it is okay to submit a form.

Specified by:
isPageComplete in interface DialogPage
Returns:
true if this page is complete, and false otherwise

setPageComplete

public void setPageComplete(boolean pageComplete)

isEnabled

public boolean isEnabled()
Description copied from interface: Guarded
Indicates if the object is in an enabled state.

Specified by:
isEnabled in interface Guarded
Returns:
if the object is in an enabled state, otherwise.

setEnabled

public void setEnabled(boolean enabled)
Description copied from interface: Guarded
Sets the enabled state of the object.

Specified by:
setEnabled in interface Guarded
Parameters:
enabled - true to enable the object, false to disable it.

getControl

public JComponent getControl()
Description copied from interface: ControlFactory
Returns the control that this factory is responsible for producing. Depending on the implementation, this control may or not be a singleton instance.

Specified by:
getControl in interface ControlFactory
Returns:
The control, never null.

isControlCreated

public boolean isControlCreated()

getParentWindowControl

public Window getParentWindowControl()

performHelp

public void performHelp()
This default implementation of an AbstractDialogPage method does nothing. Subclasses should override to take some action in response to a help request.

Specified by:
performHelp in interface DialogPage

createControl

protected abstract JComponent createControl()

setIcon

public void setIcon(Icon icon)
Specified by:
setIcon in interface IconConfigurable

getIcon

public Icon getIcon()
Description copied from interface: VisualizedElement
Returns the icon associated with the application component, or null.

Specified by:
getIcon in interface VisualizedElement
Specified by:
getIcon in interface DialogPage
Overrides:
getIcon in class LabeledObjectSupport
Returns:
the icon for this dialog page, or null if none


Copyright © 2004-2008 The Spring Framework. All Rights Reserved.