Side of Software
Wizard Library 1.6

sos.wizard
Interface Page

All Superinterfaces:
Model
All Known Implementing Classes:
AbstractPage

public interface Page
extends Model

A page in the wizard progression. A wizard model steps a user through a sequence of pages. A typical page contains a form for the user to complete and instructions on how to complete it. Note that a page is part of the model, in the Model-View-Controller architecture. It is not a view. It is rendered, or viewed, with the aid of a PageEditor.

All pages have a state of either being complete or incomplete. For example, a page is incomplete if it does not have a value for a required field in its form. Use isComplete to determine if a page is complete. A PropertyChangeEvent for the COMPLETE_PROPERTY property is thrown when the page's state changes.

In addition to being complete, a page is either valid or invalid. To check if a page is valid, call validate. A normal return signals the page is valid; an InvalidPageException signals the page is invalid. For example, a page may have an unacceptable value for a field in its form. It is complete, however, since is has a value.

A page typically has a name, which can be accessed via the putValue and getValue methods, passing NAME_PROPERTY.

Since:
1.0
See Also:
WizardModel, PageEditor

Field Summary
static java.lang.String COMPLETE_PROPERTY
          Constant used by property change events to signal that a page's state of being completed has changed.
static java.lang.String NAME_PROPERTY
          Constant used by property change events to signal that a page's name has changed.
 
Method Summary
 java.lang.Object getValue(java.lang.String key)
          Returns the value associated with the specified key, or null if this page does not contain the key.
 boolean isComplete()
          Returns true if this page is considered complete, or finished.
 java.lang.Object putValue(java.lang.String key, java.lang.Object value)
          Associates value with key.
 void validate()
          Checks if this page has acceptable values.
 
Methods inherited from interface sos.wizard.Model
addPropertyChangeListener, addPropertyChangeListener, removePropertyChangeListener, removePropertyChangeListener
 

Field Detail

NAME_PROPERTY

public static final java.lang.String NAME_PROPERTY
Constant used by property change events to signal that a page's name has changed.

See Also:
Constant Field Values

COMPLETE_PROPERTY

public static final java.lang.String COMPLETE_PROPERTY
Constant used by property change events to signal that a page's state of being completed has changed.

See Also:
Constant Field Values
Method Detail

getValue

public java.lang.Object getValue(java.lang.String key)
Returns the value associated with the specified key, or null if this page does not contain the key.

Parameters:
key - a string that identifies the stored object
Returns:
the object associated with key, or null if no such object exists
See Also:
putValue(java.lang.String, java.lang.Object)

isComplete

public boolean isComplete()
Returns true if this page is considered complete, or finished.

Returns:
true if this page is complete

putValue

public java.lang.Object putValue(java.lang.String key,
                                 java.lang.Object value)
Associates value with key.

Parameters:
key - a string that identifies the object
value - the object to be associated with key
Returns:
the object previously associated with key, or null if no such object existed
See Also:
getValue(java.lang.String)

validate

public void validate()
              throws InvalidPageException
Checks if this page has acceptable values. If it does not, it throws an InvalidPageException with an appropriate localized message.

Throws:
InvalidPageException - if this page is not valid

Side of Software
Wizard Library 1.6

Copyright 2004-07 Side of Software (SOS). All rights reserved.