org.esa.beam.framework.ui.assistant
Class AbstractAssistantPage

java.lang.Object
  extended by org.esa.beam.framework.ui.assistant.AbstractAssistantPage
All Implemented Interfaces:
AssistantPage
Direct Known Subclasses:
AbstractLayerSourceAssistantPage

public abstract class AbstractAssistantPage
extends Object
implements AssistantPage

An abstract implementation of AssistantPage.

The user has only to implement the createPageComponent() method. Other methods have meaningful default implementations, which can be overriden according to the concrete implementation.


Constructor Summary
protected AbstractAssistantPage(String pageTitle)
          Creates a new instance with the given page title.
 
Method Summary
 boolean canFinish()
          Determines if the page can finish the current assitant or not.
 boolean canHelp()
          Determines if the page can show help information.
protected abstract  Component createPageComponent()
          Creates the component of this page.
 AssistantPageContext getContext()
          Gets the current context for this page.
 AssistantPage getNextPage()
          Called only if AssistantPage.validatePage() and AssistantPage.hasNextPage() return true.
 Component getPageComponent()
          Gets the component of the page.
 String getPageTitle()
          Gets the title of the page.
 boolean hasNextPage()
           
 void performCancel()
          Cancels the current execution of the assitant.
 boolean performFinish()
          Ccalled only if AssistantPage.validatePage() and AssistantPage.canFinish() return true.
 void performHelp()
          Only called if @link #canHelp ()} returns true.
 void setContext(AssistantPageContext pageContext)
          Sets the current context for this page.
 boolean validatePage()
          Called from AssistantPageContext.updateState() in order to validate user inputs.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractAssistantPage

protected AbstractAssistantPage(String pageTitle)
Creates a new instance with the given page title.

Parameters:
pageTitle - The title of the page.
Method Detail

setContext

public void setContext(AssistantPageContext pageContext)
Description copied from interface: AssistantPage
Sets the current context for this page.

Specified by:
setContext in interface AssistantPage
Parameters:
pageContext - The context of the page.

getContext

public AssistantPageContext getContext()
Description copied from interface: AssistantPage
Gets the current context for this page.

Specified by:
getContext in interface AssistantPage
Returns:
The context of the page.

getPageTitle

public String getPageTitle()
Description copied from interface: AssistantPage
Gets the title of the page.

Specified by:
getPageTitle in interface AssistantPage
Returns:
The page title.

getPageComponent

public final Component getPageComponent()
Description copied from interface: AssistantPage
Gets the component of the page.

Specified by:
getPageComponent in interface AssistantPage
Returns:
The page component.

createPageComponent

protected abstract Component createPageComponent()
Creates the component of this page.

Returns:
The component of this page

validatePage

public boolean validatePage()
Description copied from interface: AssistantPage
Called from AssistantPageContext.updateState() in order to validate user inputs.

Specified by:
validatePage in interface AssistantPage
Returns:
true, if the current page is valid

hasNextPage

public boolean hasNextPage()
Specified by:
hasNextPage in interface AssistantPage
Returns:
true, if a next page is available

getNextPage

public AssistantPage getNextPage()
Description copied from interface: AssistantPage
Called only if AssistantPage.validatePage() and AssistantPage.hasNextPage() return true.

Specified by:
getNextPage in interface AssistantPage
Returns:
the next page, or null if no next page exists or the page could not be created.

canFinish

public boolean canFinish()
Description copied from interface: AssistantPage
Determines if the page can finish the current assitant or not.

Specified by:
canFinish in interface AssistantPage
Returns:
true if the page can perform finish, otherwise false

performFinish

public boolean performFinish()
Description copied from interface: AssistantPage
Ccalled only if AssistantPage.validatePage() and AssistantPage.canFinish() return true.

Specified by:
performFinish in interface AssistantPage
Returns:
true if finishing was successful, otherwise false.

performCancel

public void performCancel()
Description copied from interface: AssistantPage
Cancels the current execution of the assitant. Implementors shall release allocated resources.

Specified by:
performCancel in interface AssistantPage

canHelp

public boolean canHelp()
Description copied from interface: AssistantPage
Determines if the page can show help information.

Specified by:
canHelp in interface AssistantPage
Returns:
true if the page can show help information, otherwise false

performHelp

public void performHelp()
Description copied from interface: AssistantPage
Only called if @link #canHelp ()} returns true.

Specified by:
performHelp in interface AssistantPage


Copyright © 2002-2012 Brockmann Consult GmbH. All Rights Reserved.