All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.sf.juife.swing.wizard.WizardModel Maven / Gradle / Ivy

There is a newer version: 0.7
Show newest version
/*
 *   juife - Java User Interface Framework Extensions
 *
 *   Copyright (C) 2005-2007 Grigor Iliev 
 *
 *   This file is part of juife.
 *
 *   juife is free software; you can redistribute it and/or
 *   modify it under the terms of the GNU Lesser General Public
 *   License version 2.1 as published by the Free Software Foundation.
 *
 *   juife is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *   Lesser General Public License for more details.
 *
 *   You should have received a copy of the GNU Lesser General Public
 *   License along with juife; if not, write to the Free Software
 *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 *   MA  02110-1301, USA
 */

package net.sf.juife.swing.wizard;

import java.awt.event.ActionListener;


/**
 * This interface defines a suitable data model for a Wizard.
 * @author  Grigor Iliev
 */
public interface WizardModel {
	/**
	 * Registers the specified ActionListener to be
	 * notified when the current page is changed.
	 * @param l The ActionListener to register.
	 */
	void addActionListener(ActionListener l);
	
	/**
	 * Removes the specified listener.
	 * @param l The ActionListener to remove.
	 */
	void removeActionListener(ActionListener l);
	
	/**
	 * Determines whether there is a next page in this wizard.
	 * @return true if there is a next page in this wizard,
	 * false otherwise.
	 * @see #next
	 */
	boolean hasNext();
	
	/**
	 * Moves to the next page in the wizard.
	 * @return The next page in the wizard.
	 * @see #hasNext
	 */
	WizardPage next();
	
	/**
	 * Determines whether there is a previous page in this wizard.
	 * @return true if there is a previous page in this wizard,
	 * false otherwise.
	 * @see #previous
	 */
	boolean hasPrevious();
	
	/**
	 * Moves to the previous page in the wizard.
	 * @return The previous page in the wizard.
	 * @see #hasPrevious
	 */
	WizardPage previous();
	
	/**
	 * Determines whether the last page is specified.
	 * If the last page is specified the 'Last' button in the wizard will be enabled.
	 * @return true if last page is specified,
	 * false otherwise.
	 * @see #last
	 */
	boolean hasLast();
	
	/**
	 * Moves to the last page in the wizard.
	 * Last page is the page which will be displayed when the user clicks the 'Last' button.
	 * Note that the last page in the wizard is not necessarily the last page in the model.
	 * @return The page specified as last in the wizard.
	 * @see #hasLast
	 */
	WizardPage last();
	
	/**
	 * Gets the current page.
	 * @return The current page or null if there isn't current page yet.
	 */
	WizardPage getCurrentPage();
	
	/**
	 * Gets a String array providing the current list of steps.
	 * @return A String array providing the current list of steps or
	 * null if the list of steps is not available.
	 */
	String[] getSteps();
	
	/**
	 * Gets the current step in the wizard.
	 * @return The current step in the wizard or
	 * null if there is no current step.
	 */
	String getCurrentStep();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy