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
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
ConstructorsModifierConstructorDescriptionprotected
AbstractAssistantPage
(String pageTitle) Creates a new instance with the given page title. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Determines if the page can finish the current assitant or not.boolean
canHelp()
Determines if the page can show help information.protected abstract Component
Creates the component of this page.Gets the current context for this page.final Component
Gets the component of the page.Gets the title of the page.boolean
void
Cancels the current execution of the assitant.boolean
void
Only called if @link #canHelp ()} returnstrue
.void
setContext
(AssistantPageContext pageContext) Sets the current context for this page.boolean
Called fromAssistantPageContext.updateState()
in order to validate user inputs.
-
Constructor Details
-
AbstractAssistantPage
Creates a new instance with the given page title.- Parameters:
pageTitle
- The title of the page.
-
-
Method Details
-
setContext
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
Description copied from interface:AssistantPage
Gets the current context for this page.- Specified by:
getContext
in interfaceAssistantPage
- Returns:
- The context of the page.
-
getPageTitle
Description copied from interface:AssistantPage
Gets the title of the page.- Specified by:
getPageTitle
in interfaceAssistantPage
- Returns:
- The page title.
-
getPageComponent
Description copied from interface:AssistantPage
Gets the component of the page.- Specified by:
getPageComponent
in interfaceAssistantPage
- Returns:
- The page 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
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
-