com.sri.emo.wizard.defaults
Class EmoWizardPage

java.lang.Object
  extended by com.sri.emo.wizard.defaults.EmoWizardPage
All Implemented Interfaces:
WizardPage, Serializable
Direct Known Subclasses:
CompletionPartsPage, CreationPartsPage, CustomPartHandlerPage, CustomPartHandlerPage, DisplaySummaryPage, EmoDebugWizardPage, MultiEntryWizardPage, MultiEntryWizardPage, NameNodePage, SearchListPage

public class EmoWizardPage
extends Object
implements WizardPage, Serializable

Wizard Page implementation for Emo. By default will store one string per page, although derived classes will often store maps, lists, and sets.

Author:
Michael Rimov
See Also:
Serialized Form

Constructor Summary
EmoWizardPage(Integer newId, PageMetadata pageMetadata, ValidValue[] optionalMenu)
          Constructor that takes a PageMetadata object and a page definition object to build itself.
 
Method Summary
 void addError(String message)
          Adds an error to be associated with the current page.
 boolean equals(Object parm1)
          Override to performs field comparison.
 Serializable getData()
          Retrieve the data associated with the page.
 Serializable getId()
          Every page must have an id that is serializable.
 ValidValue[] getMenu()
          Retrieve the picklist value for the map.
 PageMetadata getMetadata()
          Retrieve the metadata associated with the page.
 ErrorCollection getPageErrors()
          Retrieve an error collection (if any) that is associated with this page.
 String getPrintableData()
          Retrieve the data in a printable fashion.
 int hashCode()
          Override of hashcode.
 void removeErrors()
          Clear all errors associated with the page.
 void setData(Serializable newData)
          Sets the data associated with the page.
 String toString()
          Override of toString(), returns the Id.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EmoWizardPage

public EmoWizardPage(Integer newId,
                     PageMetadata pageMetadata,
                     ValidValue[] optionalMenu)
Constructor that takes a PageMetadata object and a page definition object to build itself.

Parameters:
newId - the page id.
pageMetadata - the metadata for the page
optionalMenu - The menu to pick from (may be null).
Method Detail

getId

public Serializable getId()
Description copied from interface: WizardPage
Every page must have an id that is serializable.

Specified by:
getId in interface WizardPage
Returns:
Serializable.

getData

public Serializable getData()
Description copied from interface: WizardPage
Retrieve the data associated with the page.

Specified by:
getData in interface WizardPage
Returns:
the data instance

getPrintableData

public String getPrintableData()
Description copied from interface: WizardPage
Retrieve the data in a printable fashion. (For labels, etc.)

Specified by:
getPrintableData in interface WizardPage
Returns:
String

getMetadata

public PageMetadata getMetadata()
Description copied from interface: WizardPage
Retrieve the metadata associated with the page.

Specified by:
getMetadata in interface WizardPage
Returns:
PageMetadata instance.

setData

public void setData(Serializable newData)
             throws WizardException
Description copied from interface: WizardPage
Sets the data associated with the page.

Specified by:
setData in interface WizardPage
Parameters:
newData - the new data for the page.
Throws:
WizardException - upon error.

equals

public boolean equals(Object parm1)
Override to performs field comparison.

Overrides:
equals in class Object
Parameters:
parm1 - The other object to compare.
Returns:
true if all fields are equal

hashCode

public int hashCode()
Override of hashcode. Hashes the id.

Overrides:
hashCode in class Object
Returns:
integer

toString

public String toString()
Override of toString(), returns the Id.

Overrides:
toString in class Object
Returns:
String

getMenu

public ValidValue[] getMenu()
Retrieve the picklist value for the map.

Specified by:
getMenu in interface WizardPage
Returns:
ValidValue[]

getPageErrors

public ErrorCollection getPageErrors()
Retrieve an error collection (if any) that is associated with this page. May return null if there are no errors.

Specified by:
getPageErrors in interface WizardPage
Returns:
ErrorCollection

removeErrors

public void removeErrors()
Clear all errors associated with the page.

Specified by:
removeErrors in interface WizardPage

addError

public void addError(String message)
Adds an error to be associated with the current page.

Specified by:
addError in interface WizardPage
Parameters:
message - String


Copyright © 2004-2006 Codeguild, Inc.. All Rights Reserved.