|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object sk.uniba.euromath.editor.wizards.MultiWizard
public class MultiWizard
Multi-wizard switcher. Each wizard it encapsulates must comply to these rules:
getPreviousPage(getNextPage(page)) == page
for any page
the wizard ever returns, except the last page,getPreviousPage(getStartingPage()) == null
getStartingPage()
must consistently return same instance
of page objectcreatePageControls()
is not called.This wizard guarantees that
getNextPage()
and getPreviousPage()
of
enclosed wizard will be called only when this.getNextPage()
(or this.getPreviousPage()
respectively) is called.performFinish()
and performCancel()
are
called only when this wizard's performFinish()
(or
performCancel()
respectively) is called. Thus, if next wizard
(in its creation time) depends on results of previous wizard, you can't
compute those results in the performFinish()
method.This wizard does not support any dialog settings - setting them has no effect.
Nested Class Summary | |
---|---|
protected class |
MultiWizard.PageLocator
Locates page. |
Field Summary | |
---|---|
protected IdentityHashMap<IWizard,List<BaseWizardPage>> |
pages
Contains pages created by the wizards. |
protected IMultiWizardProvider |
provider
Provides switcher with wizard instances. |
protected List<IWizard> |
wizards
Contains list of wizards. |
Constructor Summary | |
---|---|
MultiWizard(IMultiWizardProvider provider)
Creates instance of wizard switcher. |
Method Summary | |
---|---|
boolean |
canFinish()
Returns whether this wizard could be finished without further user interaction. |
BaseWizardPage |
current()
Fetches the current page. |
protected void |
deletePagesAfter(MultiWizard.PageLocator locator,
boolean including)
Deletes all pages after given page. |
void |
dispose()
Disposes of this wizard. |
protected MultiWizard.PageLocator |
getActivePage()
Returns active (last) page. |
protected IWizard |
getActiveWizard()
Returns active wizard - the last item of wizards array. |
String |
getName()
Returns name of this wizard. |
protected MultiWizard.PageLocator |
getPage(BaseWizardPage page)
Finds given page and returns its location in the wizards
and pages properties. |
IMultiWizardProvider |
getProvider()
Returns the provider instance. |
protected BaseWizardPage |
getStartingPage()
Retrieves the first page of the first wizard. |
RGB |
getTitleBarColor()
Returns the title bar color for this wizard. |
boolean |
hasNext()
Checks if there is next page. |
boolean |
hasPrevious()
Checks if there is previous page. |
BaseWizardPage |
next()
Fetches the next page. |
boolean |
performCancel()
Performs any actions appropriate in response to the user having pressed the Cancel button, or refuse if canceling now is not permitted. |
boolean |
performFinish()
Performs any actions appropriate in response to the user having pressed the Finish button, or refuse if finishing now is not permitted. |
BaseWizardPage |
previous()
Fetches the previous page. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final IMultiWizardProvider provider
protected final List<IWizard> wizards
protected final IdentityHashMap<IWizard,List<BaseWizardPage>> pages
Constructor Detail |
---|
public MultiWizard(IMultiWizardProvider provider)
provider
- provides switcher with wizard instances.Method Detail |
---|
protected final IWizard getActiveWizard()
wizards
array.
public boolean canFinish()
IWizard
The result of this method is typically used by the wizard container to enable or disable the Finish button.
canFinish
in interface IWizard
true
if the wizard could be finished, and
false
otherwisepublic void dispose()
IWizard
dispose
in interface IWizard
protected MultiWizard.PageLocator getPage(BaseWizardPage page)
wizards
and pages
properties.
page
- page to find
null
.protected MultiWizard.PageLocator getActivePage()
protected void deletePagesAfter(MultiWizard.PageLocator locator, boolean including)
locator
- the locator of the page.including
- if true
then page itself will be deleted.
In this case the locator must not denote starting page.public boolean hasNext()
IWizard
false
if current page contains errors.
hasNext
in interface IWizard
true
if there is next wizard or false
if next()
will fail.public BaseWizardPage current()
IWizard
current
in interface IWizard
null
only if the provider
provides no pages.public String getName()
IWizard
getName
in interface IWizard
public BaseWizardPage next() throws ProviderException
IWizard
hasNext()
returned true
- it may throw
ProviderException
.
next
in interface IWizard
MultiWizard
initializes it for you. Never
null
.
ProviderException
- if next page instance cannot be constructed
because of to some unexpected error. In such case, wizard stays at
current page, exception is logged and an error dialog is shown.public boolean hasPrevious()
IWizard
hasPrevious
in interface IWizard
true
if there is previous wizard or
false
if previous()
will fail.public BaseWizardPage previous()
IWizard
previous
in interface IWizard
protected final BaseWizardPage getStartingPage()
public RGB getTitleBarColor()
IWizard
getTitleBarColor
in interface IWizard
null
if default should be
used.public boolean performCancel()
IWizard
performCancel
in interface IWizard
true
to indicate the cancel request was accepted,
and false
to indicate that the cancel request was refusedpublic boolean performFinish()
IWizard
performFinish
in interface IWizard
true
to indicate the finish request was accepted,
and false
to indicate that the finish request was refusedpublic final IMultiWizardProvider getProvider()
next()
and
previous()
methods must not be called.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |