|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container java.awt.Window java.awt.Dialog javax.swing.JDialog com.jidesoft.dialog.StandardDialog com.jidesoft.wizard.WizardDialog
public class WizardDialog
Wizard is a well-known user interface that is ideal to guide user through for complex and unfamiliar tasks. A typical usage of it is project wizard - which asks user a couple questions and generate source code of a project automatically for user.
There are several wizard standards. The most famous two are Microsoft Wizard 97 standard and Java Wizard standard. Please see references for details. I strongly suggest you read those chapters before designing any wizards since those documents are also the specs for our wizard component. Both documents are very well-written. Micrsoft Wizard 97 Standard
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.jidesoft.dialog.StandardDialog |
---|
StandardDialog.DefaultStandardDialogPane |
Nested classes/interfaces inherited from class javax.swing.JDialog |
---|
JDialog.AccessibleJDialog |
Nested classes/interfaces inherited from class java.awt.Dialog |
---|
Dialog.AccessibleAWTDialog, Dialog.ModalExclusionType, Dialog.ModalityType |
Nested classes/interfaces inherited from class java.awt.Window |
---|
Window.AccessibleAWTWindow |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
protected WizardDialogPane |
_wizardDialogPane
|
Fields inherited from class com.jidesoft.dialog.StandardDialog |
---|
_propertyChangeListener, _standardDialogPane, RESULT_AFFIRMED, RESULT_CANCELLED |
Fields inherited from class javax.swing.JDialog |
---|
accessibleContext, rootPane, rootPaneCheckingEnabled |
Fields inherited from class java.awt.Dialog |
---|
DEFAULT_MODALITY_TYPE |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface com.jidesoft.dialog.ButtonNames |
---|
APPLY, BACK, BROWSE, CANCEL, CLEAR, CLOSE, DETAILS, EDIT, EXIT, FIND, FIND_NEXT, FINISH, FORWARD, HELP, NEW, NEXT, NO, OK, OPEN, PRINT, REPLACE, RESET, RETRY, RUN, SAVE, SAVE_AS, STOP, YES |
Fields inherited from interface javax.swing.WindowConstants |
---|
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
WizardDialog()
Creates a wizard dialog with no owner. |
|
WizardDialog(Dialog owner,
boolean modal)
Creates a modal or non-modal wizard dialog without a title and with the specified owner. |
|
WizardDialog(Dialog owner,
String title)
Creates a modal or non-modal wizard dialog without a title and with the specified owner. |
|
WizardDialog(Dialog owner,
String title,
boolean modal)
Creates a modal or non-modal wizard dialog without a title and with the specified owner. |
|
WizardDialog(Frame owner,
boolean modal)
Creates a modal or non-modal wizard dialog without a title and with the specified owner. |
|
WizardDialog(Frame owner,
String title)
Creates a modal or non-modal wizard dialog without a title and with the specified owner. |
|
WizardDialog(Frame owner,
String title,
boolean modal)
Creates a modal or non-modal wizard dialog without a title and with the specified owner. |
Method Summary | |
---|---|
boolean |
closeCurrentPage()
Close current dialog page. |
protected boolean |
closeCurrentPage(AbstractDialogPage newPage,
Object source)
Close current dialog page. |
boolean |
closeCurrentPage(Object source)
Close current dialog page with an optional source object. |
protected void |
createActions()
Subclass can override to create actions for buttons. |
JComponent |
createBannerPanel()
Creates the banner panel for WizardDialog. |
ButtonPanel |
createButtonPanel()
Creates the button panel for WizardDialog. |
JComponent |
createContentPanel()
Creates the content panel for WizardDialog. |
protected StandardDialogPane |
createStandardDialogPane()
Creates WizardDialogPane. |
AbstractAction |
getBackAction()
Get the back action. |
AbstractAction |
getCancelAction()
Gets the cancel action. |
Dimension |
getContentLargerSize()
Gets the larger standard size of content pane when the standard size is not enough. |
Dimension |
getContentSize()
Gets the content pane size. |
Dimension |
getContentStandardSize()
Gets the standard size of content pane. |
AbstractDialogPage |
getCurrentPage()
Gets the current selected page. |
Image |
getDefaultGraphic()
Gets the default graphic that will be displayed in left pane. |
AbstractAction |
getFinishAction()
Gets the finish action. |
JavaHelpPane |
getHelpPane()
Gets the help pane if help pane is used. |
int |
getLargerLeftPaneWidth()
Gets the larger standard width of left pane when the larger standard size is used. |
JComponent |
getLeftPanel()
Gets the left pane. |
int |
getLeftPanelWidth()
Gets the width of left panel. |
AbstractAction |
getNextAction()
Get the next action. |
AbstractDialogPage |
getNextPage()
Gets the default next page. |
AbstractDialogPage |
getPageByTitle(String title)
Gets the page by the full title. |
PageList |
getPageList()
Gets the page list which have all the wizard pages. |
JComponent |
getPagesPanel()
Gets the pages panel. |
int |
getStandardLeftPaneWidth()
Gets the standard width of left pane. |
StepsPane |
getStepsPane()
Gets the steps pane if steps pane is used. |
List<AbstractPage> |
getVisitedPages()
Gets list of visited pages. |
protected void |
initWizard()
Customizes the wizard. |
boolean |
isStepsPaneNavigable()
Checks if the steps pane can be clicked to navigate to the corresponding page. |
void |
setBackAction(AbstractAction backAction)
Changes the default back action. |
void |
setCancelAction(AbstractAction cancelAction)
Changes the default cancel action. |
void |
setContentSize(Dimension contentSize)
Sets the content size. |
protected boolean |
setCurrentPage(AbstractDialogPage currentPage,
boolean isBack)
Sets the current selected page. |
protected boolean |
setCurrentPage(AbstractDialogPage currentPage,
boolean isBack,
Object source)
Sets the current selected page. |
boolean |
setCurrentPage(String pageTitle)
Sets the current selected page. |
protected boolean |
setCurrentPage(String pageTitle,
boolean isBack)
Sets the current selected page. |
void |
setDefaultGraphic(Image defaultGraphic)
Sets the default graphic that will be displayed in left pane. |
void |
setFinishAction(AbstractAction finishAction)
Changes the default finish action. |
void |
setLeftPanelWidth(int leftPanelWidth)
Sets the left panel width. |
void |
setLocale(Locale l)
|
void |
setNextAction(AbstractAction nextAction)
Changes the default next action. |
void |
setNextPage(AbstractDialogPage nextPage)
Sets the next page. |
void |
setPageList(PageList pageList)
Sets the page list to wizard dialog. |
void |
setStepsPaneNavigable(boolean stepsPaneNavigable)
Sets the steps pane navigable. |
Methods inherited from class com.jidesoft.dialog.StandardDialog |
---|
createOKCancelButtonPanel, getBannerPanel, getButtonPanel, getContentPanel, getDefaultAction, getDefaultCancelAction, getDialogResult, getInitFocusedComponent, getStandardDialogPane, initComponents, initialize, pack, setDefaultAction, setDefaultCancelAction, setDialogResult, setInitFocusedComponent, show |
Methods inherited from class java.awt.Dialog |
---|
addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setModal, setModalityType, setResizable, setTitle, setUndecorated, setVisible, toBack |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected WizardDialogPane _wizardDialogPane
Constructor Detail |
---|
public WizardDialog() throws HeadlessException
HeadlessException
- if GraphicsEnvironment.isHeadless()
returns true
.public WizardDialog(Frame owner, boolean modal) throws HeadlessException
JComponent.getDefaultLocale
.
owner
- the non-null Frame
from which the dialog is displayedmodal
- true for a modal dialog, false for one that allows other windows to be active at the same time
HeadlessException
- if GraphicsEnvironment.isHeadless()
returns true
.public WizardDialog(Frame owner, String title) throws HeadlessException
JComponent.getDefaultLocale
.
owner
- the non-null Frame
from which the dialog is displayedtitle
- the String
to display in the dialog's title bar
HeadlessException
- if GraphicsEnvironment.isHeadless()
returns true
.public WizardDialog(Frame owner, String title, boolean modal) throws HeadlessException
JComponent.getDefaultLocale
.
owner
- the non-null Frame
from which the dialog is displayedtitle
- the String
to display in the dialog's title barmodal
- true for a modal dialog, false for one that allows other windows to be active at the same time
HeadlessException
- if GraphicsEnvironment.isHeadless()
returns true
.public WizardDialog(Dialog owner, boolean modal) throws HeadlessException
JComponent.getDefaultLocale
.
owner
- the non-null Dialog
from which the dialog is displayedmodal
- true for a modal dialog, false for one that allows other windows to be active at the same time
HeadlessException
- if GraphicsEnvironment.isHeadless()
returns true
.public WizardDialog(Dialog owner, String title) throws HeadlessException
JComponent.getDefaultLocale
.
owner
- the non-null Dialog
from which the dialog is displayedtitle
- the String
to display in the dialog's title bar
HeadlessException
- if GraphicsEnvironment.isHeadless()
returns true
.public WizardDialog(Dialog owner, String title, boolean modal) throws HeadlessException
JComponent.getDefaultLocale
.
owner
- the non-null Dialog
from which the dialog is displayedtitle
- the String
to display in the dialog's title barmodal
- true for a modal dialog, false for one that allows other windows to be active at the same time
HeadlessException
- if GraphicsEnvironment.isHeadless()
returns true
.Method Detail |
---|
protected void initWizard()
protected void createActions()
public void setBackAction(AbstractAction backAction)
backAction
- the back actionpublic AbstractAction getBackAction()
public void setNextAction(AbstractAction nextAction)
nextAction
- the next actionpublic AbstractAction getNextAction()
public void setCancelAction(AbstractAction cancelAction)
cancelAction
- the cancel actionpublic AbstractAction getCancelAction()
public AbstractAction getFinishAction()
public void setFinishAction(AbstractAction finishAction)
finishAction
- the finish actionpublic void setPageList(PageList pageList)
pageList
- the page list
IllegalArgumentException
- if the pages have duplicated titles.public PageList getPageList()
public AbstractDialogPage getCurrentPage()
public boolean setCurrentPage(String pageTitle)
pageTitle
- new page title.
protected boolean setCurrentPage(String pageTitle, boolean isBack)
pageTitle
- new page title.isBack
- is this caused by BACK button.
protected boolean closeCurrentPage(AbstractDialogPage newPage, Object source)
newPage
- the new page. If current page is the same as nwe page, nothing will be done. It you will close the
page and will not open any new page, for example, when finish or cancel button is pressed, you can
pass in null.source
- the source that will be used in event.
public boolean closeCurrentPage()
public boolean closeCurrentPage(Object source)
source
- the source of the PageEvent that will be fired when closing the current page
protected boolean setCurrentPage(AbstractDialogPage currentPage, boolean isBack)
currentPage
- new page.isBack
- is this caused by BACK button.
protected boolean setCurrentPage(AbstractDialogPage currentPage, boolean isBack, Object source)
currentPage
- new page.isBack
- is this caused by BACK button.source
- source for the event
public JComponent getLeftPanel()
public JComponent getPagesPanel()
public int getLeftPanelWidth()
public void setLeftPanelWidth(int leftPanelWidth)
leftPanelWidth
- the widthpublic Dimension getContentSize()
public void setContentSize(Dimension contentSize)
contentSize
- the sizepublic Dimension getContentStandardSize()
public int getStandardLeftPaneWidth()
public Dimension getContentLargerSize()
public int getLargerLeftPaneWidth()
public AbstractDialogPage getPageByTitle(String title)
title
- the title
public AbstractDialogPage getNextPage()
public void setNextPage(AbstractDialogPage nextPage)
nextPage
- next page instancepublic List<AbstractPage> getVisitedPages()
public Image getDefaultGraphic()
public void setDefaultGraphic(Image defaultGraphic)
defaultGraphic
- the imagepublic StepsPane getStepsPane()
public JavaHelpPane getHelpPane()
protected StandardDialogPane createStandardDialogPane()
createStandardDialogPane
in class StandardDialog
public void setLocale(Locale l)
setLocale
in class Component
public JComponent createBannerPanel()
createBannerPanel
in class StandardDialog
public JComponent createContentPanel()
createContentPanel
in class StandardDialog
public ButtonPanel createButtonPanel()
createButtonPanel
in class StandardDialog
ButtonPanel
public boolean isStepsPaneNavigable()
public void setStepsPaneNavigable(boolean stepsPaneNavigable)
stepsPaneNavigable
- true or false.
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |