org.springframework.richclient.dialog
Class TreeCompositeDialogPage

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
              extended by org.springframework.richclient.dialog.CompositeDialogPage
                  extended by org.springframework.richclient.dialog.TreeCompositeDialogPage
All Implemented Interfaces:
PropertyChangePublisher, CommandLabelConfigurable, DescribedElement, DescriptionConfigurable, Guarded, TitleConfigurable, VisualizedElement, DialogPage, Messagable, ControlFactory, IconConfigurable, ImageConfigurable

public class TreeCompositeDialogPage
extends CompositeDialogPage

A concrete implementation of CompositeDialogPage that presents the child pages in a tree on the left, and the pages itself on the right.

When the user selects a page in the tree, it is shown on the right.

This class also decorates the entries in the tree to indicate the page completed status.

Author:
Peter De Bruycker, Oliver Hutchison

Nested Class Summary
protected  class TreeCompositeDialogPage.PageSelector
           
protected  class TreeCompositeDialogPage.PageTitleCellRenderer
           
 
Nested classes/interfaces inherited from class org.springframework.richclient.dialog.CompositeDialogPage
CompositeDialogPage.ChildChangeHandler
 
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
TreeCompositeDialogPage(String pageId)
          Constructs a new TreeCompositeDialogPage instance.
TreeCompositeDialogPage(String pageId, boolean autoConfigure)
           
 
Method Summary
 DialogPage addForm(DialogPage parent, Form form)
          Adds a new page to the tree.
 void addPage(DialogPage page)
          Adds a DialogPage to the tree.
 void addPage(DialogPage parent, DialogPage child)
          Adds a DialogPage to the tree.
 void addPages(DialogPage parent, DialogPage[] pages)
          Adds a group DialogPages to the tree.
protected  JPanel createContentControl()
           
protected  JComponent createControl()
           
protected  void createTreeControl()
           
 void expandAll(boolean expand)
          Expands or collapses all of the tree nodes.
 void expandLevels(int levels, boolean expand)
          Expands or collapses a number of levels of tree nodes.
protected  DefaultMutableTreeNode getNode(DialogPage page)
           
protected  Map getNodes()
          Get the nodes map.
protected  JPanel getPagePanel()
          Get the page panel.
protected  JTree getPageTree()
          Get the page tree.
protected  DefaultTreeModel getPageTreeModel()
          Get the page tree model.
protected  int getTreeControlWidth()
          Get the width of the tree component to use in the final control construction.
protected  void processDialogPage(DialogPage page)
           
 void removePage(DialogPage page)
          Remove a page from the tree.
protected  void updatePageComplete(DialogPage page)
           
protected  void updatePageLabels(DialogPage page)
           
 
Methods inherited from class org.springframework.richclient.dialog.CompositeDialogPage
addForm, addPages, addPages, createDialogPage, createPageControls, decoratePageTitle, getActivePage, getDecoratedPageTitle, getLargestPageSize, getPages, onPageSelected, prepareDialogPage, setActivePage, setAutoConfigureChildPages, updateMessage, updatePageEnabled, updatePageVisibility
 
Methods inherited from class org.springframework.richclient.dialog.AbstractDialogPage
getControl, getIcon, getId, getMessage, getParentWindowControl, getTitle, hasErrorMessage, hasInfoMessage, hasWarningMessage, isControlCreated, isEnabled, isPageComplete, isVisible, performHelp, setEnabled, setIcon, setId, setMessage, setPageComplete, setVisible
 
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

TreeCompositeDialogPage

public TreeCompositeDialogPage(String pageId)
Constructs a new TreeCompositeDialogPage instance.

Parameters:
pageId - the pageId

TreeCompositeDialogPage

public TreeCompositeDialogPage(String pageId,
                               boolean autoConfigure)
Method Detail

addPage

public void addPage(DialogPage page)
Adds a DialogPage to the tree. The page will be added at the top level of the tree hierarchy.

Overrides:
addPage in class CompositeDialogPage
Parameters:
page - the page to add

addForm

public DialogPage addForm(DialogPage parent,
                          Form form)
Adds a new page to the tree. The page is created by wrapping the form page in a FormBackedDialogPage.

Parameters:
parent - the parent page in the tree hierarchy
formPage - the form page to be inserted
Returns:
the DialogPage that wraps form

addPage

public void addPage(DialogPage parent,
                    DialogPage child)
Adds a DialogPage to the tree.

Parameters:
parent - the parent page in the tree hierarchy
page - the page to add

removePage

public void removePage(DialogPage page)
Remove a page from the tree.

Parameters:
page - to remove

addPages

public void addPages(DialogPage parent,
                     DialogPage[] pages)
Adds a group DialogPages to the tree.

Parameters:
parent - the parent page in the tree hierarchy
pages - the pages to add

expandAll

public void expandAll(boolean expand)
Expands or collapses all of the tree nodes.

Parameters:
expand - when true expand all nodes; otherwise collapses all nodes

expandLevels

public void expandLevels(int levels,
                         boolean expand)
Expands or collapses a number of levels of tree nodes.

Parameters:
levels - the number of levels to expand/collapses
expand - when true expand all nodes; otherwise collapses all nodes

createControl

protected JComponent createControl()
Specified by:
createControl in class AbstractDialogPage
See Also:
AbstractDialogPage.createControl()

processDialogPage

protected void processDialogPage(DialogPage page)

createContentControl

protected JPanel createContentControl()

getTreeControlWidth

protected int getTreeControlWidth()
Get the width of the tree component to use in the final control construction. This default implementation returns 150.

Returns:
width of tree control

createTreeControl

protected void createTreeControl()

updatePageComplete

protected void updatePageComplete(DialogPage page)
Overrides:
updatePageComplete in class CompositeDialogPage

updatePageLabels

protected void updatePageLabels(DialogPage page)
Overrides:
updatePageLabels in class CompositeDialogPage

getNode

protected DefaultMutableTreeNode getNode(DialogPage page)

getNodes

protected Map getNodes()
Get the nodes map.

Returns:
nodes map.

getPageTree

protected JTree getPageTree()
Get the page tree.

Returns:
page tree component.

getPagePanel

protected JPanel getPagePanel()
Get the page panel.

Returns:
page panel component.

getPageTreeModel

protected DefaultTreeModel getPageTreeModel()
Get the page tree model.

Returns:
page tree model.


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