KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > nightlabs > rcp > wizard > IWizardHop


1 /*
2  * Created on Jun 13, 2005
3  */

4 package com.nightlabs.rcp.wizard;
5
6 import java.util.List JavaDoc;
7
8 import org.eclipse.jface.wizard.IWizard;
9 import org.eclipse.jface.wizard.IWizardPage;
10
11 /**
12  * @author Marco Schulze - marco at nightlabs dot de
13  */

14 public interface IWizardHop
15 {
16     /**
17      * @return Returns the wizard.
18      */

19     IWizard getWizard();
20
21     /**
22      * @return Returns either <tt>null</tt> or the parent {@link IWizardHop} if there
23      * has been a branching and this is a child hop.
24      *
25      * @see #setParentHop(IWizardHop)
26      */

27     IWizardHop getParentHop();
28
29     /**
30      * This method sets the parent hop. It should be set automatically when the
31      * entryPage of this hop is set as exitPage of the parent.
32      *
33      * @param parentHop The hop from which we came.
34      */

35     void setParentHop(IWizardHop parentHop);
36
37     /**
38      * @param entryPage The entryPage to set.
39      *
40      * @see #getEntryPage()
41      */

42     void setEntryPage(IWizardHopPage entryPage);
43
44     /**
45      * @return Returns the entryPage. This page must be registered in the <tt>Wizard</tt>
46      * and is not registered here as one of the hop pages.
47      *
48      * @see #setEntryPage(IWizardHopPage)
49      */

50     IWizardHopPage getEntryPage();
51
52     /**
53      * Call this method to fork out of the current hop into a new hop. Note, that
54      * the <tt>exitPage</tt> here is always identical with <tt>entryPage</tt> of
55      * the child hop. Hence, <tt>exitPage.getWizardHop()</tt> must return the
56      * child hop - NOT this one.
57      * <p>
58      * This method should call {@link #setParentHop(IWizardHop)} of the exitPage's
59      * hop like this: <tt>exitPage.getWizardHop().setParentHop(this);</tt>
60      * <p>
61      * You can set <tt>null</tt> as <tt>exitPage</tt>. If the <tt>exitPage</tt> is
62      * <tt>null</tt>, the wizard
63      *
64      * @param exitPage The exitPage to which shall be forked.
65      *
66      * @see #getExitPage()
67      */

68     void setExitPage(IWizardHopPage exitPage);
69
70     /**
71      * @return Returns either </tt>null</tt> or the <tt>entryPage</tt> of the next hop.
72      * Note, that <tt>exitPage.getWizardHop() != this</tt>, because it is part of the
73      * following child hop.
74      *
75      * @see #setExitPage(IWizardHopPage)
76      */

77     IWizardHopPage getExitPage();
78
79     /**
80      * @return Returns the first page after the entry page or null, if not existent.
81      * Note that this is not the entryPage, but the first page AFTER the entry page.
82      */

83     IWizardHopPage getFirstHopPage();
84
85     /**
86      * @return Returns the last page of this hop or null, if no hop page existent.
87      * Note that this is not the exitPage, but the last page BEFORE the exit page.
88      */

89     IWizardHopPage getLastHopPage();
90
91     /**
92      * This method adds a {@link IWizardHopPage} to the <tt>List</tt>. Neither the
93      * entry page, nor the exit page are registered as hop page!!!
94      *
95      * @param page The new page to be added.
96      */

97     void addHopPage(IWizardHopPage page);
98
99     boolean removeHopPage(IWizardHopPage page);
100
101     void removeAllHopPages();
102
103     /**
104      * @return Returns a read-only list of all hop pages (both, entry and exit
105      * page, are both not contained).
106      */

107     List JavaDoc getHopPages();
108
109     IWizardPage getNextPage(IWizardPage currentPage);
110
111 // IWizardPage getPreviousPage(IWizardPage currentPage);
112
}
Popular Tags