Package org.opends.quicksetup.ui
Class GuiApplication
- java.lang.Object
-
- org.opends.quicksetup.Application
-
- org.opends.quicksetup.ui.GuiApplication
-
- All Implemented Interfaces:
Runnable,ProgressNotifier
- Direct Known Subclasses:
Installer,Uninstaller
public abstract class GuiApplication extends Application
This class represents an application with a wizard GUI that can be run in the context of QuickSetup. Examples of applications might be 'installer', and 'uninstaller'.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.opends.quicksetup.Application
Application.ErrorPrintStream, Application.OutputPrintStream, Application.PointAdder
-
-
Field Summary
-
Fields inherited from class org.opends.quicksetup.Application
formatter, installStatus, tempLogFile
-
-
Constructor Summary
Constructors Constructor Description GuiApplication()Constructs an instance of an application.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidacceptCertificateForException(UserDataCertificateException ce, boolean acceptPermanently)Updates the list of certificates accepted by the user in the trust manager based on the information stored in the UserDataCertificateException we got when trying to connect in secure mode.abstract booleancanFinish(WizardStep step)Indicates whether the user is allowed to finish the wizard fromstep.booleancanGoBack(WizardStep step)Indicates whether the user is allowed to return to a previous step fromstep.booleancanGoForward(WizardStep step)Indicates whether the user is allowed to move to a new step fromstep.voidcloseClicked(WizardStep cStep, QuickSetup qs)Called when the user has clicked the 'close' button.booleanconfirmCancel(QuickSetup qs)Called before the application cancels its operation, giving the user a chance to confirm the cancellation action.JPanelcreateFramePanel(QuickSetupDialog dlg)Creates the main panel for the wizard dialog.abstract QuickSetupStepPanelcreateWizardStepPanel(WizardStep step)Creates a wizard panel given a specific step.abstract booleanfinishClicked(WizardStep cStep, QuickSetup qs)Called when the user has clicked the 'finish' button.booleanfinishOnLeft()Indicates whether the finish button must be placed on the left (close to "Next" button) or on the right (close to "Quit" button).voidforceToDisplay()This method is called when we detected that there is something installed we inform of this to the user and the user wants to proceed with the installation destroying the contents of the data and the configuration in the current installation.org.forgerock.i18n.LocalizableMessagegetCloseButtonToolTip()Gets the key for the close button's tool tip text.WizardStepgetCurrentWizardStep()Gets the currently displayed wizard step.intgetExtraDialogHeight()Gets the amount of addition pixels added to the height of the tallest panel in order to size the wizard for asthetic reasons.org.forgerock.i18n.LocalizableMessagegetFinishButtonLabel()Gets the key for the finish button's label.org.forgerock.i18n.LocalizableMessagegetFinishButtonToolTip()Gets the key for the finish button's tool tip text.abstract WizardStepgetFinishedStep()Gets the finished step in the wizard.abstract WizardStepgetFirstWizardStep()Returns the initial wizard step.abstract org.forgerock.i18n.LocalizableMessagegetFrameTitle()Gets the frame title of the GUI application that will be used in some operating systems.abstract ButtonNamegetInitialFocusButtonName()Get the name of the button that will receive initial focus.abstract WizardStepgetNextWizardStep(WizardStep step)Gets the next step in the wizard given a current step.LinkedHashSet<WizardStep>getOrderedSteps()Returns the list of all the steps in an ordered manner.abstract WizardStepgetPreviousWizardStep(WizardStep step)Gets the previous step in the wizard given a current step.org.forgerock.i18n.LocalizableMessagegetQuitButtonToolTip()Gets the key for the quit button's tool tip text.protected org.forgerock.i18n.LocalizableMessagegetTab()Returns the tab formatted.String[]getUserArguments()Returns the arguments passed in the command-line to launch the application.abstract Set<? extends WizardStep>getWizardSteps()Returns the set of wizard steps used in this application's wizard.booleanisSubStep(WizardStep step)Indicates whether the providedstepis a sub step or not.booleanisVisible(WizardStep step, QuickSetup qs)Indicates whether the providedstepis visible or not depending on the contents of the QuickSetup object that is provided.booleanisVisible(WizardStep step, UserData userData)Indicates whether the providedstepis visible or not depending on the contents of the UserData object that is provided.abstract voidnextClicked(WizardStep cStep, QuickSetup qs)Called when the user has clicked the 'next' button.abstract voidpreviousClicked(WizardStep cStep, QuickSetup qs)Called when the user has clicked the 'previous' button.voidquitClicked(WizardStep step, QuickSetup qs)Called when the user has clicked the 'quit' button.voidsetDisplayedWizardStep(WizardStep step, UserData userData, QuickSetupDialog dlg)Called by the quicksetup controller when the user advances to a new step in the wizard.voidsetQuickSetupDialog(QuickSetupDialog dialog)Sets the QuickSetupDialog driving this application.voidsetUserArguments(String[] args)Sets the arguments passed in the command-line to launch the application.abstract voidsetWizardDialogState(QuickSetupDialog dlg, UserData userData, WizardStep step)Called when the user advances to new step in the wizard.abstract voidupdateUserData(WizardStep cStep, QuickSetup qs)Called whenever this application should update its user data from values found in QuickSetup.abstract voidwindowClosing(QuickSetupDialog dlg, WindowEvent evt)Called by the controller when the window is closing.-
Methods inherited from class org.opends.quicksetup.Application
addProgressUpdateListener, applicationPrintStreamReceived, cancel, checkAbort, create, createUserData, getApplicationErrorStream, getApplicationOutputStream, getCurrentProgressStep, getFormattedDone, getFormattedDoneWithLineBreak, getFormattedError, getFormattedError, getFormattedLog, getFormattedLogError, getFormattedProgress, getFormattedProgressWithLineBreak, getFormattedSuccess, getFormattedSummary, getFormattedWarning, getFormattedWithPoints, getInstallation, getInstallationPath, getInstancePath, getLineBreak, getMessage, getProgressMessageFormatter, getRatio, getRemoteConnection, getSummary, getTaskSeparator, getTrustManager, getUserData, isCancellable, isFinished, isVerbose, notifyListeners, notifyListeners, notifyListenersDone, notifyListenersRatioChange, notifyListenersWithPoints, openTempLogFile, removeProgressUpdateListener, setCurrentInstallStatus, setInstallation, setNotifyListeners, setProgressMessageFormatter, setTempLogFile, setUserData
-
-
-
-
Method Detail
-
getFrameTitle
public abstract org.forgerock.i18n.LocalizableMessage getFrameTitle()
Gets the frame title of the GUI application that will be used in some operating systems.- Returns:
- internationalized String representing the frame title
-
getFirstWizardStep
public abstract WizardStep getFirstWizardStep()
Returns the initial wizard step.- Returns:
- Step representing the first step to show in the wizard
-
setDisplayedWizardStep
public void setDisplayedWizardStep(WizardStep step, UserData userData, QuickSetupDialog dlg)
Called by the quicksetup controller when the user advances to a new step in the wizard. Applications are expected to manipulate the QuickSetupDialog to reflect the current step.- Parameters:
step- Step indicating the new current stepuserData- UserData representing the data specified by the userdlg- QuickSetupDialog hosting the wizard
-
setWizardDialogState
public abstract void setWizardDialogState(QuickSetupDialog dlg, UserData userData, WizardStep step)
Called when the user advances to new step in the wizard. Applications are expected to manipulate the QuickSetupDialog to reflect the current step.- Parameters:
dlg- QuickSetupDialog hosting the wizarduserData- UserData representing the data specified by the userstep- Step indicating the new current step
-
getTab
protected org.forgerock.i18n.LocalizableMessage getTab()
Returns the tab formatted.- Returns:
- the tab formatted.
-
windowClosing
public abstract void windowClosing(QuickSetupDialog dlg, WindowEvent evt)
Called by the controller when the window is closing. The application can take application specific actions here.- Parameters:
dlg- QuickSetupDialog that will be closingevt- The event from the Window indicating closing
-
forceToDisplay
public void forceToDisplay()
This method is called when we detected that there is something installed we inform of this to the user and the user wants to proceed with the installation destroying the contents of the data and the configuration in the current installation.
-
confirmCancel
public boolean confirmCancel(QuickSetup qs)
Called before the application cancels its operation, giving the user a chance to confirm the cancellation action.- Parameters:
qs- QuickSetup that can be used for confirming- Returns:
- boolean where true indicates that the user answered affirmatively to the cancelation confirmation
-
getInitialFocusButtonName
public abstract ButtonName getInitialFocusButtonName()
Get the name of the button that will receive initial focus.- Returns:
- ButtonName of the button to receive initial focus
-
createFramePanel
public JPanel createFramePanel(QuickSetupDialog dlg)
Creates the main panel for the wizard dialog.- Parameters:
dlg- QuickSetupDialog used- Returns:
- JPanel frame panel
-
getWizardSteps
public abstract Set<? extends WizardStep> getWizardSteps()
Returns the set of wizard steps used in this application's wizard.- Returns:
- Set of Step objects representing wizard steps
-
createWizardStepPanel
public abstract QuickSetupStepPanel createWizardStepPanel(WizardStep step)
Creates a wizard panel given a specific step.- Parameters:
step- for which a panel representation should be created- Returns:
- QuickSetupStepPanel for representing the
step
-
getNextWizardStep
public abstract WizardStep getNextWizardStep(WizardStep step)
Gets the next step in the wizard given a current step.- Parameters:
step- Step the current step- Returns:
- Step the next step
-
getPreviousWizardStep
public abstract WizardStep getPreviousWizardStep(WizardStep step)
Gets the previous step in the wizard given a current step.- Parameters:
step- Step the current step- Returns:
- Step the previous step
-
getFinishedStep
public abstract WizardStep getFinishedStep()
Gets the finished step in the wizard.- Returns:
- Step the finished step
-
getCurrentWizardStep
public WizardStep getCurrentWizardStep()
Gets the currently displayed wizard step.- Returns:
- WizardStep being displayed.
-
isSubStep
public boolean isSubStep(WizardStep step)
Indicates whether the providedstepis a sub step or not.- Parameters:
step- WizardStep for which the return value indicates whether or not is a sub step.- Returns:
- boolean where true indicates the provided
stepis a substep.
-
isVisible
public boolean isVisible(WizardStep step, UserData userData)
Indicates whether the providedstepis visible or not depending on the contents of the UserData object that is provided.- Parameters:
step- WizardStep for which the return value indicates whether or not is visible.userData- the UserData to be used to determine if the step is visible or not.- Returns:
- boolean where true indicates the provided
stepis visible.
-
isVisible
public boolean isVisible(WizardStep step, QuickSetup qs)
Indicates whether the providedstepis visible or not depending on the contents of the QuickSetup object that is provided.- Parameters:
step- WizardStep for which the return value indicates whether or not is visible.qs- the QuickSetup to be used to determine if the step is visible or not.- Returns:
- boolean where true indicates the provided
stepis visible.
-
getOrderedSteps
public LinkedHashSet<WizardStep> getOrderedSteps()
Returns the list of all the steps in an ordered manner. This is required because in the case of an application with substeps the user of the other interfaces is not enough. This is a default implementation that uses the getNextWizardStep method to calculate the list that work for applications with no substeps.- Returns:
- a list containing ALL the steps (including substeps) in an ordered manner.
-
canGoBack
public boolean canGoBack(WizardStep step)
Indicates whether the user is allowed to return to a previous step fromstep.- Parameters:
step- WizardStep for which the the return value indicates whether or not the user can return to a previous step- Returns:
- boolean where true indicates the user can return to a previous
step from
step
-
canGoForward
public boolean canGoForward(WizardStep step)
Indicates whether the user is allowed to move to a new step fromstep.- Parameters:
step- WizardStep for which the the return value indicates whether or not the user can move to a new step- Returns:
- boolean where true indicates the user can move to a new
step from
step
-
canFinish
public abstract boolean canFinish(WizardStep step)
Indicates whether the user is allowed to finish the wizard fromstep.- Parameters:
step- WizardStep for which the the return value indicates whether or not the user can finish the wizard- Returns:
- boolean where true indicates the user can finish the wizard
-
previousClicked
public abstract void previousClicked(WizardStep cStep, QuickSetup qs)
Called when the user has clicked the 'previous' button.- Parameters:
cStep- WizardStep at which the user clicked the previous buttonqs- QuickSetup controller
-
finishClicked
public abstract boolean finishClicked(WizardStep cStep, QuickSetup qs)
Called when the user has clicked the 'finish' button.- Parameters:
cStep- WizardStep at which the user clicked the previous buttonqs- QuickSetup controller- Returns:
- boolean that the application uses to indicate the the application should be launched. If false, the application is responsible for updating the user data for the final screen and launching the application if this is the desired behavior.
-
nextClicked
public abstract void nextClicked(WizardStep cStep, QuickSetup qs)
Called when the user has clicked the 'next' button.- Parameters:
cStep- WizardStep at which the user clicked the next buttonqs- QuickSetup controller
-
closeClicked
public void closeClicked(WizardStep cStep, QuickSetup qs)
Called when the user has clicked the 'close' button.- Parameters:
cStep- WizardStep at which the user clicked the close buttonqs- QuickSetup controller
-
quitClicked
public void quitClicked(WizardStep step, QuickSetup qs)
Called when the user has clicked the 'quit' button.- Parameters:
step- WizardStep at which the user clicked the quit buttonqs- QuickSetup controller
-
updateUserData
public abstract void updateUserData(WizardStep cStep, QuickSetup qs) throws UserDataException
Called whenever this application should update its user data from values found in QuickSetup.- Parameters:
cStep- current wizard stepqs- QuickSetup controller- Throws:
UserDataException- if there is a problem with the data
-
getCloseButtonToolTip
public org.forgerock.i18n.LocalizableMessage getCloseButtonToolTip()
Gets the key for the close button's tool tip text.- Returns:
- String key of the text in the resource bundle
-
getQuitButtonToolTip
public org.forgerock.i18n.LocalizableMessage getQuitButtonToolTip()
Gets the key for the quit button's tool tip text.- Returns:
- String key of the text in the resource bundle
-
getFinishButtonToolTip
public org.forgerock.i18n.LocalizableMessage getFinishButtonToolTip()
Gets the key for the finish button's tool tip text.- Returns:
- String key of the text in the resource bundle
-
getFinishButtonLabel
public org.forgerock.i18n.LocalizableMessage getFinishButtonLabel()
Gets the key for the finish button's label.- Returns:
- String key of the text in the resource bundle
-
finishOnLeft
public boolean finishOnLeft()
Indicates whether the finish button must be placed on the left (close to "Next" button) or on the right (close to "Quit" button).- Returns:
trueif the finish button must be placed on the left andfalseotherwise.
-
acceptCertificateForException
protected void acceptCertificateForException(UserDataCertificateException ce, boolean acceptPermanently)
Updates the list of certificates accepted by the user in the trust manager based on the information stored in the UserDataCertificateException we got when trying to connect in secure mode.- Parameters:
ce- the UserDataCertificateException that contains the information to be used.acceptPermanently- whether the certificate must be accepted permanently or not.
-
getExtraDialogHeight
public int getExtraDialogHeight()
Gets the amount of addition pixels added to the height of the tallest panel in order to size the wizard for asthetic reasons.- Returns:
- int height to add
-
setQuickSetupDialog
public void setQuickSetupDialog(QuickSetupDialog dialog)
Sets the QuickSetupDialog driving this application.- Parameters:
dialog- QuickSetupDialog driving this application
-
setUserArguments
public void setUserArguments(String[] args)
Sets the arguments passed in the command-line to launch the application.- Parameters:
args- the arguments passed in the command-line to launch the application.
-
getUserArguments
public String[] getUserArguments()
Returns the arguments passed in the command-line to launch the application.- Returns:
- the arguments passed in the command-line to launch the application.
-
-