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 protectedAbstractAssistantPage(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 booleancanFinish()Determines if the page can finish the current assitant or not.booleancanHelp()Determines if the page can show help information.protected abstract ComponentcreatePageComponent()Creates the component of this page.AssistantPageContextgetContext()Gets the current context for this page.AssistantPagegetNextPage()ComponentgetPageComponent()Gets the component of the page.StringgetPageTitle()Gets the title of the page.booleanhasNextPage()voidperformCancel()Cancels the current execution of the assitant.booleanperformFinish()voidperformHelp()Only called if @link #canHelp ()} returnstrue.voidsetContext(AssistantPageContext pageContext)Sets the current context for this page.booleanvalidatePage()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:AssistantPageSets the current context for this page.- Specified by:
setContextin interfaceAssistantPage- Parameters:
pageContext- The context of the page.
-
getContext
public AssistantPageContext getContext()
Description copied from interface:AssistantPageGets the current context for this page.- Specified by:
getContextin interfaceAssistantPage- Returns:
- The context of the page.
-
getPageTitle
public String getPageTitle()
Description copied from interface:AssistantPageGets the title of the page.- Specified by:
getPageTitlein interfaceAssistantPage- Returns:
- The page title.
-
getPageComponent
public final Component getPageComponent()
Description copied from interface:AssistantPageGets the component of the page.- Specified by:
getPageComponentin 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:AssistantPageCalled fromAssistantPageContext.updateState()in order to validate user inputs.- Specified by:
validatePagein interfaceAssistantPage- Returns:
- true, if the current page is valid
-
hasNextPage
public boolean hasNextPage()
- Specified by:
hasNextPagein interfaceAssistantPage- Returns:
- true, if a next page is available
-
getNextPage
public AssistantPage getNextPage()
Description copied from interface:AssistantPage- Specified by:
getNextPagein interfaceAssistantPage- Returns:
- the next page, or
nullif no next page exists or the page could not be created.
-
canFinish
public boolean canFinish()
Description copied from interface:AssistantPageDetermines if the page can finish the current assitant or not.- Specified by:
canFinishin interfaceAssistantPage- Returns:
trueif the page can perform finish, otherwisefalse
-
performFinish
public boolean performFinish()
Description copied from interface:AssistantPage- Specified by:
performFinishin interfaceAssistantPage- Returns:
trueif finishing was successful, otherwisefalse.
-
performCancel
public void performCancel()
Description copied from interface:AssistantPageCancels the current execution of the assitant. Implementors shall release allocated resources.- Specified by:
performCancelin interfaceAssistantPage
-
canHelp
public boolean canHelp()
Description copied from interface:AssistantPageDetermines if the page can show help information.- Specified by:
canHelpin interfaceAssistantPage- Returns:
trueif the page can show help information, otherwisefalse
-
performHelp
public void performHelp()
Description copied from interface:AssistantPageOnly called if @link #canHelp ()} returnstrue.- Specified by:
performHelpin interfaceAssistantPage
-
-