001    /*
002     * Copyright 2002-2004 the original author or authors.
003     * 
004     * Licensed under the Apache License, Version 2.0 (the "License"); you may not
005     * use this file except in compliance with the License. You may obtain a copy of
006     * the License at
007     * 
008     * http://www.apache.org/licenses/LICENSE-2.0
009     * 
010     * Unless required by applicable law or agreed to in writing, software
011     * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
012     * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
013     * License for the specific language governing permissions and limitations under
014     * the License.
015     */
016    package org.springframework.richclient.wizard;
017    
018    import org.springframework.richclient.core.Guarded;
019    import org.springframework.richclient.dialog.DialogPage;
020    
021    public interface WizardPage extends DialogPage, Guarded {
022    
023        /**
024         * Returns the wizard page that would to be shown if the user was to press
025         * the Next button.
026         * 
027         * @return the next wizard page, or <code>null</code> if none
028         */
029        public WizardPage getNextPage();
030    
031        /**
032         * Returns the wizard page that would to be shown if the user was to press
033         * the Back button.
034         * 
035         * @return the previous wizard page, or <code>null</code> if none
036         */
037        public WizardPage getPreviousPage();
038    
039        /**
040         * Sets the wizard page that would typically be shown if the user was to
041         * press the Back button.
042         * <p>
043         * This method is called by the container.
044         * </p>
045         * 
046         * @param page
047         *            the previous wizard page
048         */
049        public void setPreviousPage(WizardPage page);
050    
051        /**
052         * Returns the wizard that hosts this wizard page.
053         * 
054         * @return the wizard, or <code>null</code> if this page has not been
055         *         added to any wizard
056         * @see #setWizard
057         */
058        public Wizard getWizard();
059    
060        /**
061         * Returns whether the next page could be displayed.
062         * 
063         * @return <code>true</code> if the next page could be displayed, and
064         *         <code>false</code> otherwise
065         */
066        public boolean canFlipToNextPage();
067    
068        /**
069         * Sets the wizard that hosts this wizard page. Once established, a page's
070         * wizard cannot be changed to a different wizard.
071         * 
072         * @param newWizard
073         *            the wizard
074         * @see #getWizard
075         */
076        public void setWizard(Wizard newWizard);
077    
078        public void onAboutToShow();
079    }