Class QuickSetupDialog


  • public class QuickSetupDialog
    extends Object
    This class represents the dialog used by quicksetup applications. In its constructor it gets as parameters an object describing the current installation status and the default values to be proposed to the user in the panels. If we are installing Open DS and the server has already been installed it will display an error message. In the other cases it will display a wizard.
    • Constructor Detail

      • QuickSetupDialog

        public QuickSetupDialog​(GuiApplication app,
                                CurrentInstallStatus installStatus,
                                QuickSetup qs)
        Constructor of QuickSetupDialog.
        Parameters:
        app - Application to run in as a wizard
        installStatus - of the current environment
        qs - QuickSetup acting as controller
    • Method Detail

      • packAndShow

        public void packAndShow()
        Packs and displays this dialog.
      • 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.
      • setDisplayedStep

        public void setDisplayedStep​(WizardStep step,
                                     UserData userData)
        Displays the panel corresponding to the provided step. The panel contents are updated with the contents of the UserData object.
        Parameters:
        step - the step that we want to display.
        userData - the UserData object that must be used to populate the panels.
      • getDisplayedStep

        public WizardStep getDisplayedStep()
        Returns the currently displayed step.
        Returns:
        the currently displayed step.
      • displayProgress

        public void displayProgress​(ProgressDescriptor descriptor)
        Forwards to the displayed panel the ProgressDescriptor so that they can update their contents accordingly.
        Parameters:
        descriptor - the descriptor of the Installation progress.
      • displayError

        public void displayError​(org.forgerock.i18n.LocalizableMessage msg,
                                 org.forgerock.i18n.LocalizableMessage title)
        Displays an error message dialog.
        Parameters:
        msg - the error message.
        title - the title for the dialog.
      • displayConfirmation

        public boolean displayConfirmation​(org.forgerock.i18n.LocalizableMessage msg,
                                           org.forgerock.i18n.LocalizableMessage title)
        Displays a confirmation message dialog.
        Parameters:
        msg - the confirmation message.
        title - the title of the dialog.
        Returns:
        true if the user confirms the message, or false if not.
      • getFieldValue

        public Object getFieldValue​(FieldName fieldName)
        Returns the value corresponding to the provided FieldName.
        Parameters:
        fieldName - the FieldName for which we want to obtain the value.
        Returns:
        the value corresponding to the provided FieldName.
      • displayFieldInvalid

        public void displayFieldInvalid​(FieldName fieldName,
                                        boolean invalid)
        Marks as invalid (or valid depending on the value of the invalid parameter) a field corresponding to FieldName. This basically implies udpating the style of the JLabel associated with fieldName (the association is done using the LabelFieldDescriptor class).
        Parameters:
        fieldName - the FieldName to be marked as valid or invalid.
        invalid - whether to mark the field as valid or invalid.
      • addButtonActionListener

        public void addButtonActionListener​(ButtonActionListener l)
        Adds a button listener. All the button listeners will be notified when the buttons are clicked (by the user or programatically).
        Parameters:
        l - the ButtonActionListener to be added.
      • workerStarted

        public void workerStarted()
        This method is called to inform that a worker has started (the QuickSetup is doing some data validation). The worker is doing its tasks outside the event thread to avoid blocking of the painting and this class is notified of this fact. The method basically simply the Next and Previous buttons. This method can be called from the event thread or outside the event thread.
      • workerFinished

        public void workerFinished()
        This method is called to inform that a worker has finished. The method just enables the Next and Previous buttons. This method can be called from the event thread or outside the event thread.
      • getFrame

        public JFrame getFrame()
        Returns the frame containing the dialog.
        Returns:
        the frame containing the dialog.
      • setButtonEnabled

        public void setButtonEnabled​(ButtonName buttonName,
                                     boolean enable)
        Enables a button associated with the given Button Name.
        Parameters:
        buttonName - the button name of the button.
        enable - boolean indicating to enable or to disable the button.
      • getStepsPanel

        public org.opends.quicksetup.ui.StepsPanel getStepsPanel()
        Returns the steps panel.
        Returns:
        the steps panel.
      • getCurrentStepPanel

        public CurrentStepPanel getCurrentStepPanel()
        Returns the current step panel.
        Returns:
        the current step panel.
      • getButtonsPanel

        public ButtonsPanel getButtonsPanel()
        Returns the buttons panel.
        Returns:
        the buttons panel.
      • setFocusOnButton

        public void setFocusOnButton​(ButtonName buttonName)
        Sets the focus in the button associated with the ButtonName.
        Parameters:
        buttonName - the ButtonName associated with the button.
      • setDefaultButton

        public void setDefaultButton​(ButtonName buttonName)
        Sets the default button for the frame.
        Parameters:
        buttonName - the ButtonName associated with the button.
      • getInstalledPanel

        public QuickSetupErrorPanel getInstalledPanel()
        Returns (and creates if it is not already created) the panel that informs the user that the server is already installed when the installation has been launched.
        Returns:
        the panel that is used to inform the user that the server is already installed when the installation has been launched.
      • notifyButtonEvent

        public void notifyButtonEvent​(ButtonName buttonName)
        Notifies the ButtonActionListener objects that an ButtonEvent has occurred in the button associated with buttonName.
        Parameters:
        buttonName - the ButtonName associated with the button.