Package org.esa.snap.ui.assistant
Class AbstractAssistantPage
- java.lang.Object
-
- org.esa.snap.ui.assistant.AbstractAssistantPage
-
- All Implemented Interfaces:
AssistantPage
- Direct Known Subclasses:
AbstractLayerSourceAssistantPage
public abstract class AbstractAssistantPage extends Object implements AssistantPage
An abstract implementation ofAssistantPage
.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
Constructors Modifier Constructor Description protected
AbstractAssistantPage(String pageTitle)
Creates a new instance with the given page title.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description 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()
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()
void
performHelp()
Only called if @link #canHelp ()} returnstrue
.void
setContext(AssistantPageContext pageContext)
Sets the current context for this page.boolean
validatePage()
Called fromAssistantPageContext.updateState()
in order to validate user inputs.
-
-
-
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 interfaceAssistantPage
- 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 interfaceAssistantPage
- 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 interfaceAssistantPage
- Returns:
- The page title.
-
getPageComponent
public final Component getPageComponent()
Description copied from interface:AssistantPage
Gets the component of the page.- Specified by:
getPageComponent
in interfaceAssistantPage
- 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 fromAssistantPageContext.updateState()
in order to validate user inputs.- Specified by:
validatePage
in interfaceAssistantPage
- Returns:
- true, if the current page is valid
-
hasNextPage
public boolean hasNextPage()
- Specified by:
hasNextPage
in interfaceAssistantPage
- Returns:
- true, if a next page is available
-
getNextPage
public AssistantPage getNextPage()
Description copied from interface:AssistantPage
- Specified by:
getNextPage
in interfaceAssistantPage
- 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 interfaceAssistantPage
- Returns:
true
if the page can perform finish, otherwisefalse
-
performFinish
public boolean performFinish()
Description copied from interface:AssistantPage
- Specified by:
performFinish
in interfaceAssistantPage
- Returns:
true
if finishing was successful, otherwisefalse
.
-
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 interfaceAssistantPage
-
canHelp
public boolean canHelp()
Description copied from interface:AssistantPage
Determines if the page can show help information.- Specified by:
canHelp
in interfaceAssistantPage
- Returns:
true
if the page can show help information, otherwisefalse
-
performHelp
public void performHelp()
Description copied from interface:AssistantPage
Only called if @link #canHelp ()} returnstrue
.- Specified by:
performHelp
in interfaceAssistantPage
-
-