Interface ConsoleUtils


  • public interface ConsoleUtils

    ConsoleUtils provides conveniece methods for custom code console actions.

    The ConsoleUtils object is obtained through the one of the custom code Proxy objects by a request for the ConsoleUtils class, as follows:

    Given the InstallerProxy proxy object,

    ConsoleUtils cu = (ConsoleUtils)proxy.getService(ConsoleUtils.class);
    int userChoice = cu.createChoiceListAndGetValue(myVector);
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      int[] createChoiceList​(java.lang.String[] choices)
      Constructs a numbered vertical list of choices from the array of Strings provided in the parameters to this method.
      int[] createChoiceList​(java.lang.String[] choices, int defaultChoice)
      Constructs a numbered vertical list of choices from the array of Strings provided in the parameters to this method.
      int[] createChoiceList​(java.lang.String[] choices, int[] defaultChoice)
      Constructs a numbered vertical list of choices from the array of Strings provided in the parameters to this method.
      int[] createChoiceList​(java.util.Vector choicesV)
      Constructs a numbered vertical list of choices from the Vector of Strings provided in the parameters to this method.
      int[] createChoiceList​(java.util.Vector choicesV, int defaultChoice)
      Constructs a numbered vertical list of choices from the Vector of Strings provided in the parameters to this method.
      int[] createChoiceListAndGetMultipleValues​(java.lang.String prompt, java.lang.String[] choices)
      Constructs a numbered vertical list of choices from the array of Strings provided in the parameters to this method.
      int[] createChoiceListAndGetMultipleValues​(java.lang.String prompt, java.util.Vector choicesV)
      Constructs a numbered vertical list of choices from the Vector of Strings provided in the parameters to this method.
      int[] createChoiceListAndGetMultipleValuesWithDefaults​(java.lang.String prompt, java.util.Vector choicesV, int[] defaults)
      Constructs a numbered vertical list of choices from the array of Strings provided in the parameters to this method.
      int createChoiceListAndGetValue​(java.lang.String prompt, java.lang.String[] choices)
      Constructs a numbered vertical list of choices from the array of Strings provided in the parameters to this method.
      int createChoiceListAndGetValue​(java.lang.String prompt, java.lang.String[] choices, int defaultChoice)
      Constructs a numbered vertical list of choices from the array of Strings provided in the parameters to this method.
      int createChoiceListAndGetValue​(java.lang.String prompt, java.util.Vector choicesV)
      Constructs a numbered vertical list of choices from the Vector of Strings provided in the parameters to this method.
      int createChoiceListAndGetValue​(java.lang.String prompt, java.util.Vector choicesV, int defaultChoice)
      Constructs a numbered vertical list of choices from the Vector of Strings provided in the parameters to this method.
      void enterToContinue()
      Creates a console prompt with default 'enter to continue' text.
      void enterToContinue​(java.lang.String prompt)
      Creates a console prompt with the given String.
      boolean isThisCorrectPrompt()
      Constructs a console prompt that requests the user to make a 'yes' or 'no' choice based on the default 'is this correct text' prompt.
      java.lang.String promptAndBilateralChoice​(java.lang.String prompt, java.lang.String option1, java.lang.String option2)
      Constructs a console prompt that requests the user to choose from one of two supplied options.
      java.lang.String promptAndGetSensitiveInformation​(java.lang.String prompt)
      Creates a console prompt with the given String and returns the value given by the user in response to the console prompt.
      java.lang.String promptAndGetValue​(java.lang.String prompt)
      Creates a console prompt with the given String and returns the value given by the user in response to the console prompt.
      java.lang.String promptAndGetValue​(java.lang.String prompt, boolean requireValue)
      Creates a console prompt with the given String and returns the value given by the user in response to the console prompt.
      java.lang.String promptAndGetValueWithDefaultValue​(java.lang.String prompt, java.lang.String defaultValue)
      Creates a console prompt with the given String and returns the value given by the user in response to the console prompt.
      java.lang.String promptAndGetValueWithEchoCharacter​(java.lang.String prompt, char echoChar)
      Creates a console prompt with the given String and returns the value given by the user in response to the console prompt.
      boolean promptAndYesNoChoice​(java.lang.String prompt)
      Constructs a console prompt that requests the user to make a 'yes' or 'no' choice based on the query presented.
      void wprint​(java.lang.String x)
      Prints a String without terminating the line at the end of the String.
      void wprint​(java.lang.String x, int consoleWidth)
      Prints a String without terminating the line at the end of the String.
      void wprintln​(java.lang.String x)
      Prints a String and then terminates the line.
      void wprintln​(java.lang.String x, int consoleWidth)
      Prints a String and then terminates the line.
      void wprintlnWithBreaks​(java.lang.String text)
      Prints a String and then terminates the line.
      void wprintlnWithBreaks​(java.lang.String text, java.lang.String prompt, int width, int height)
      Prints a String and then terminates the line.
      void wprintlnWithBreaksAndSkipPrompt​(java.lang.String text, java.lang.String prompt, int width, int height)
      Prints a String and then terminates the line.
    • Method Detail

      • promptAndGetValue

        java.lang.String promptAndGetValue​(java.lang.String prompt)
                                    throws PreviousRequestException

        Creates a console prompt with the given String and returns the value given by the user in response to the console prompt.

        This method requires the user to enter some value before proceeding (i.e., the user cannot simply press to proceed past the prompt). Until some value is entered, the prompt will be repeated to the user.

        An input delimiter followed by a space is automatically appended to the supplied prompt.

        Parameters:
        prompt - the prompt to be shown to the user.
        Returns:
        a String representing the user's input.
        Throws:
        PreviousRequestException - if the user replies at the console prompt that they wish to proceed back to the previous step. If this method is called from the executeCustomCode() method of a Custom Code Console Action, it is not necessary to catch the exception unless the action wishes to 'veto' the request and/or perform cleanup prior to allowing the installer to return to a previous step.
        See Also:
        promptAndGetValue(String, boolean)
      • promptAndGetValueWithDefaultValue

        java.lang.String promptAndGetValueWithDefaultValue​(java.lang.String prompt,
                                                           java.lang.String defaultValue)
                                                    throws PreviousRequestException

        Creates a console prompt with the given String and returns the value given by the user in response to the console prompt. If no value is given, the default is returned.

        An input delimiter followed by a space is automatically appended to the supplied prompt.

        Parameters:
        prompt - the prompt to be shown to the user.
        defaultValue - if the user presses enter with no input, returns defautl value.
        Returns:
        a String representing the user's input.
        Throws:
        PreviousRequestException - if the user replies at the console prompt that they wish to proceed back to the previous step. If this method is called from the executeCustomCode() method of a Custom Code Console Action, it is not necessary to catch the exception unless the action wishes to 'veto' the request and/or perform cleanup prior to allowing the installer to return to a previous step.
        See Also:
        promptAndGetValue(String, boolean)
      • promptAndGetValue

        java.lang.String promptAndGetValue​(java.lang.String prompt,
                                           boolean requireValue)
                                    throws PreviousRequestException

        Creates a console prompt with the given String and returns the value given by the user in response to the console prompt.

        This method can either require the user to enter a value before proceeding (i.e., the user cannot simply press to proceed past the prompt) or not require a value to proceed -- based on the parameters supplied. If a value is required, the prompt will be repeated to the user until some value is entered. If a value is not required, and the user pressed to proceed without providing a value in response to the prompt, an empty String or a String with only whitespace will be returned.

        An input delimiter followed by a space is automatically appended to the supplied prompt.

        Parameters:
        prompt - the prompt to be shown to the user.
        requireValue - whether or not to reqire a value from the user (true requires a value).
        Returns:
        a String representing the user's input.
        Throws:
        PreviousRequestException - if the user replies at the console prompt that they wish to proceed back to the previous step. If this method is called from the executeCustomCode() method of a Custom Code Console Action, it is not necessary to catch the exception unless the action wishes to 'veto' the request and/or perform cleanup prior to allowing the installer to return to a previous step.
        See Also:
        promptAndGetValue(String)
      • promptAndGetSensitiveInformation

        java.lang.String promptAndGetSensitiveInformation​(java.lang.String prompt)
                                                   throws PreviousRequestException

        Creates a console prompt with the given String and returns the value given by the user in response to the console prompt. The characters the user enters are hidden, ideally suited for obtaining sensitive information like passwords.

        The behavior may vary depending on the VM version the installer runs on. For VMs version 1.5 or earlier, the behavior is exactly the same of calling the promptAndGetValueWithEchoCharacter() method. For VMs version 1.6 or later the implementation relies on the VM built-in support for console, which does not allow a custom character to be echoed, so they are just hidden.

        Parameters:
        prompt - the prompt to be shown to the user.
        Returns:
        a String representing the user's input.
        Throws:
        PreviousRequestException - if the user replies at the console prompt that they wish to proceed back to the previous step. If this method is called from the executeCustomCode() method of a Custom Code Console Action, it is not necessary to catch the exception unless the action wishes to 'veto' the request and/or perform cleanup prior to allowing the installer to return to a previous step.
      • promptAndGetValueWithEchoCharacter

        java.lang.String promptAndGetValueWithEchoCharacter​(java.lang.String prompt,
                                                            char echoChar)
                                                     throws PreviousRequestException

        Creates a console prompt with the given String and returns the value given by the user in response to the console prompt. The characters the user enters are masked by the echo character specified. Ideally suited for obtaining sensitive information like passwords.

        Please, consider the use of the promptAndGetSensitiveInformation() method, which uses a more robust implementation on VMs 1.6 or earlier.

        Parameters:
        prompt - the prompt to be shown to the user.
        echoChar - the character that is displayed when the user types in a character.
        Returns:
        a String representing the user's input.
        Throws:
        PreviousRequestException - if the user replies at the console prompt that they wish to proceed back to the previous step. If this method is called from the executeCustomCode() method of a Custom Code Console Action, it is not necessary to catch the exception unless the action wishes to 'veto' the request and/or perform cleanup prior to allowing the installer to return to a previous step.
      • enterToContinue

        void enterToContinue​(java.lang.String prompt)
                      throws PreviousRequestException

        Creates a console prompt with the given String. This method does not return a value as the user is not required to enter a value before proceeding past the prompt.

        An input delimiter followed by a space is automatically appended to the supplied prompt.

        Parameters:
        prompt - the prompt to be shown to the user.
        Throws:
        PreviousRequestException - if the user replies at the console prompt that they wish to proceed back to the previous step. If this method is called from the executeCustomCode() method of a Custom Code Console Action, it is not necessary to catch the exception unless the action wishes to 'veto' the request and/or perform cleanup prior to allowing the installer to return to a previous step.
        See Also:
        enterToContinue()
      • enterToContinue

        void enterToContinue()
                      throws PreviousRequestException

        Creates a console prompt with default 'enter to continue' text. This method does not return a value as the user is not required to enter a value before proceeding past the prompt.

        An input delimiter followed by a space is automatically appended to the default prompt.

        Throws:
        PreviousRequestException - if the user replies at the console prompt that they wish to proceed back to the previous step. If this method is called from the executeCustomCode() method of a Custom Code Console Action, it is not necessary to catch the exception unless the action wishes to 'veto' the request and/or perform cleanup prior to allowing the installer to return to a previous step.
        See Also:
        enterToContinue(String)
      • promptAndBilateralChoice

        java.lang.String promptAndBilateralChoice​(java.lang.String prompt,
                                                  java.lang.String option1,
                                                  java.lang.String option2)
                                           throws PreviousRequestException

        Constructs a console prompt that requests the user to choose from one of two supplied options.

        This method requires the user to enter a value corresponding to one of the two supplied choices before proceeding (i.e., the user must supply the text of one of the two choices). This method validates that the user supplied text is equal to one of the two options (case sensitivity is ignored). Until a validated value is supplied, the prompt will be repeated to the user.

        An input delimiter followed by a space is automatically appended to the supplied prompt.

        Parameters:
        prompt - the prompt to be shown to the user.
        option1 - the first of the choices presented to the user.
        option2 - the second of the choices presented to the user.
        Returns:
        a String representing the user's input. This string will equal exactly (including case) one of the two options supplied as parameters to the method.
        Throws:
        PreviousRequestException - if the user replies at the console prompt that they wish to proceed back to the previous step. If this method is called from the executeCustomCode() method of a Custom Code Console Action, it is not necessary to catch the exception unless the action wishes to 'veto' the request and/or perform cleanup prior to allowing the installer to return to a previous step.
        See Also:
        promptAndYesNoChoice(String), isThisCorrectPrompt()
      • promptAndYesNoChoice

        boolean promptAndYesNoChoice​(java.lang.String prompt)
                              throws PreviousRequestException

        Constructs a console prompt that requests the user to make a 'yes' or 'no' choice based on the query presented.

        The 'yes' and 'no' options are represented by their one character representations to make the user choice more efficient. This method requires the user to enter a value corresponding to 'yes' or 'no' options before proceeding (i.e., the user must supply the text of one of the two choices). This method validates that the user supplied text is equal to one of the two options. Until a validated value is supplied, the prompt will be repeated to the user.

        The characters representing the 'yes'/'no' options, an input delimiter, and a space are automatically appended to the supplied prompt.

        Parameters:
        prompt - the prompt to be shown to the user.
        Returns:
        a boolean value representing the user's input. True is 'yes'.
        Throws:
        PreviousRequestException - if the user replies at the console prompt that they wish to proceed back to the previous step. If this method is called from the executeCustomCode() method of a Custom Code Console Action, it is not necessary to catch the exception unless the action wishes to 'veto' the request and/or perform cleanup prior to allowing the installer to return to a previous step.
        See Also:
        promptAndBilateralChoice(String, String, String), isThisCorrectPrompt()
      • isThisCorrectPrompt

        boolean isThisCorrectPrompt()
                             throws PreviousRequestException

        Constructs a console prompt that requests the user to make a 'yes' or 'no' choice based on the default 'is this correct text' prompt.

        The 'yes' and 'no' options are represented by their one character representations to make the user choice more efficient. This method requires the user to enter a value corresponding to the 'yes' or 'no' options before proceeding (i.e., the user must supply the text of one of the two choices). This method validates that the user supplied text is equal to one of the two options. Until a validated value is supplied, the prompt will be repeated to the user.

        The characters representing the 'yes'/'no' options, an input delimiter, and a space are automatically appended to the default prompt.

        Returns:
        a boolean value representing the user's input. True is 'yes'.
        Throws:
        PreviousRequestException - if the user replies at the console prompt that they wish to proceed back to the previous step. If this method is called from the executeCustomCode() method of a Custom Code Console Action, it is not necessary to catch the exception unless the action wishes to 'veto' the request and/or perform cleanup prior to allowing the installer to return to a previous step.
        See Also:
        promptAndBilateralChoice(String, String, String), promptAndYesNoChoice(String)
      • createChoiceList

        int[] createChoiceList​(java.util.Vector choicesV)

        Constructs a numbered vertical list of choices from the Vector of Strings provided in the parameters to this method. This list is displayed in the console.

        Each non-null and non-whitespace only String is represented in the list as a choice with a number (from which a choice can be made). Null or whitespace only elements in the Vector of Strings are automatically converted to line breaks within the choice list and are not part of the valid list of choices. Line breaks created in this fashion are formatting constructs only and do not break the contiguous numbering of the valid choices in the list. For this reason, it is possible for the numbering of the choices in the list to not directly correspond to the index of the related item in the Vector (indeed, the numbering will never correspond directly to the index of the corresponding element in the Vector as the numbers for the choice list start at 1 not 0 (zero)).

        To overcome this issue, this method maintains a mapping of choice list numbers to the corresponding String element index in the Vector. This mapping is returned as an array of integer base types. The number of a choice list item when used as an index to the integer array will provide the String element index in the supplied Vector.

        A sample choice list might look like:

          1- This is a choice
          2- This is also a choice
          3- This is a third choice

          4- Notice the space above this choice

        Parameters:
        choicesV - a Vector of Strings from which to construct the choice list.
        Returns:
        an int[] representing a numerical mapping of the list number choices to the actual index of the corresponding item in the supplied Vector of Strings.
        See Also:
        createChoiceList(Vector, int), createChoiceList(String[]), createChoiceList(String[], int)
      • createChoiceList

        int[] createChoiceList​(java.util.Vector choicesV,
                               int defaultChoice)

        Constructs a numbered vertical list of choices from the Vector of Strings provided in the parameters to this method. This list is displayed in the console.

        A default choice (which is shown by an arrow '->' beside the choices number) can be specified by providing the element index of the String item that should be the default.

        Each non-null and non-whitespace only String is represented in the list as a choice with a number (from which a choice can be made). Null or whitespace only elements in the Vector of Strings are automatically converted to line breaks within the choice list and are not part of the valid list of choices. Line breaks created in this fashion are formatting constructs only and do not break the contiguous numbering of the valid choices in the list. For this reason, it is possible for the numbering of the choices in the list to not directly correspond to the index of the related item in the Vector (indeed, the numbering will never correspond directly to the index of the corresponding element in the Vector as the numbers for the choice list start at 1 not 0 (zero)).

        To overcome this issue, this method maintains a mapping of choice list numbers to the corresponding String element index in the Vector. This mapping is returned as an array of integer base types. The number of a choice list item when used as an index to the integer array will provide the String element index in the supplied Vector.

        A sample choice list might look like:

          1- This is a choice
        ->2- This is also a choice, and the default
          3- This is a third choice

          4- Notice the space above this choice

        Parameters:
        choicesV - a Vector of Strings from which to construct the choice list.
        defaultChoice - the index of the element in the supplied Vector which should be identified as the default.
        Returns:
        an int[] representing a numerical mapping of the list number choices to the actual index of the corresponding item in the supplied Vector of Strings.
        See Also:
        createChoiceList(Vector), createChoiceList(String[]), createChoiceList(String[], int)
      • createChoiceList

        int[] createChoiceList​(java.lang.String[] choices)

        Constructs a numbered vertical list of choices from the array of Strings provided in the parameters to this method. This list is displayed in the console.

        Each non-null and non-whitespace only String is represented in the list as a choice with a number (from which a choice can be made). Null or whitespace only elements in the array of Strings are automatically converted to line breaks within the choice list and are not part of the valid list of choices. Line breaks created in this fashion are formatting constructs only and do not break the contiguous numbering of the valid choices in the list. For this reason, it is possible for the numbering of the choices in the list to not directly correspond to the index of the related item in the array (indeed, the numbering will never correspond directly to the index of the corresponding element in the array as the numbers for the choice list start at 1 not 0 (zero)).

        To overcome this issue, this method maintains a mapping of choice list numbers to the corresponding String element index in the array. This mapping is returned as an array of integer base types. The number of a choice list item when used as an index to the integer array will provide the String element index in the supplied array.

        A sample choice list would look like:

          1- This is a choice
          2- This is also a choice
          3- This is a third choice

          4- Notice the space above this choice

        Parameters:
        choices - an array of Strings from which to construct the choice list.
        Returns:
        an int[] representing a numerical mapping of the list number choices to the actual index of the corresponding item in the supplied array of Strings.
        See Also:
        createChoiceList(Vector), createChoiceList(Vector, int), createChoiceList(String[], int)
      • createChoiceList

        int[] createChoiceList​(java.lang.String[] choices,
                               int defaultChoice)

        Constructs a numbered vertical list of choices from the array of Strings provided in the parameters to this method. This list is displayed in the console.

        A default choice (which is shown by an arrow '->' beside the choices number) can be specified by providing the element index of the String item that should be the default.

        Each non-null and non-whitespace only String is represented in the list as a choice with a number (from which a choice can be made). Null or whitespace only elements in the array of Strings are automatically converted to line breaks within the choice list and are not part of the valid list of choices. Line breaks created in this fashion are formatting constructs only and do not break the contiguous numbering of the valid choices in the list. For this reason, it is possible for the numbering of the choices in the list to not directly correspond to the index of the related item in the array (indeed, the numbering will never correspond directly to the index of the corresponding element in the array as the numbers for the choice list start at 1 not 0 (zero)).

        To overcome this issue, this method maintains a mapping of choice list numbers to the corresponding String element index in the array. This mapping is returned as an array of integer base types. The number of a choice list item when used as an index to the integer array will provide the String element index in the supplied Vector.

        A sample choice list would look like:

          1- This is a choice
        ->2- This is also a choice, and the default
          3- This is a third choice
          
          4- Notice the space above this choice

        Parameters:
        choices - an array of Strings from which to construct the choice list.
        defaultChoice - the index of the element in the supplied String[] which should be identified as the default.
        Returns:
        an int[] representing a numerical mapping of the list number choices to the actual index of the corresponding item in the supplied array of Strings.
        See Also:
        createChoiceList(Vector), createChoiceList(Vector, int), createChoiceList(String[])
      • createChoiceList

        int[] createChoiceList​(java.lang.String[] choices,
                               int[] defaultChoice)

        Constructs a numbered vertical list of choices from the array of Strings provided in the parameters to this method. This list is displayed in the console.

        Default choices (which is shown by an arrow '->' beside the choices number) can be specified by providing the element index of the String item that should be the default.

        Each non-null and non-whitespace only String is represented in the list as a choice with a number (from which a choice can be made). Null or whitespace only elements in the array of Strings are automatically converted to line breaks within the choice list and are not part of the valid list of choices. Line breaks created in this fashion are formatting constructs only and do not break the contiguous numbering of the valid choices in the list. For this reason, it is possible for the numbering of the choices in the list to not directly correspond to the index of the related item in the array (indeed, the numbering will never correspond directly to the index of the corresponding element in the array as the numbers for the choice list start at 1 not 0 (zero)).

        To overcome this issue, this method maintains a mapping of choice list numbers to the corresponding String element index in the array. This mapping is returned as an array of integer base types. The number of a choice list item when used as an index to the integer array will provide the String element index in the supplied Vector.

        A sample choice list would look like:

          1- This is a choice
        ->2- This is also a choice, and the default
          3- This is a third choice
          
          4- Notice the space above this choice

        Parameters:
        choices - an array of Strings from which to construct the choice list.
        defaultChoice - the indexes of elements in the supplied String[] which should be identified as the defaults.
        Returns:
        an int[] representing a numerical mapping of the list number choices to the actual index of the corresponding item in the supplied array of Strings.
        See Also:
        createChoiceList(Vector), createChoiceList(Vector, int), createChoiceList(String[])
      • createChoiceListAndGetValue

        int createChoiceListAndGetValue​(java.lang.String prompt,
                                        java.util.Vector choicesV)
                                 throws PreviousRequestException

        Constructs a numbered vertical list of choices from the Vector of Strings provided in the parameters to this method. This list is displayed in the console. The index of the option chosen by the user is returned.

        Below the list, the user will be presented with the prompt supplied and will be required to enter a value corresponding to the one of the choices in the list before proceeding (i.e., the user cannot simply press to proceed past the prompt). All input will be validated against the numbers as presented in the list. Until a valid input is entered, the prompt will be repeated to the user. An input delimiter followed by a space is automatically appended to the prompt.

        The integer returned by this method corresponds to the index of the item in the Vector which the user chose from the list

        Parameters:
        choicesV - a Vector of Strings from which to construct the choice list.
        prompt - the prompt to be shown to the user.
        Returns:
        an int representing the index of the chosen item in the supplied Vector of Strings.
        Throws:
        PreviousRequestException - if the user replies at the console prompt that they wish to proceed back to the previous step. If this method is called from the executeCustomCode() method of a Custom Code Console Action, it is not necessary to catch the exception unless the action wishes to 'veto' the request and/or perform cleanup prior to allowing the installer to return to a previous step.
        See Also:
        createChoiceList(Vector), createChoiceListAndGetValue(String, Vector, int), createChoiceListAndGetValue(String, String[]), createChoiceListAndGetValue(String, String[], int)
      • createChoiceListAndGetValue

        int createChoiceListAndGetValue​(java.lang.String prompt,
                                        java.util.Vector choicesV,
                                        int defaultChoice)
                                 throws PreviousRequestException

        Constructs a numbered vertical list of choices from the Vector of Strings provided in the parameters to this method. This list is displayed in the console. The index of the option chosen by the user is returned.

        Below the list, the user will be presented with the prompt supplied. Because a default value has been supplied the user will have the option to either a value corresponding to the one of the choices in the list or to press to accept the default selection. All input will be validated against the numbers as presented in the list. If an invalid input is entered, the prompt will be repeated to the user. An input delimiter followed by a space is automatically appended to the prompt.

        The integer returned by this method corresponds to the index of the item in the Vector which the user chose from the list

        Parameters:
        choicesV - a Vector of Strings from which to construct the choice list.
        prompt - the prompt to be shown to the user.
        defaultChoice - the index of the element in the supplied Vector which should be identified as the default.
        Returns:
        an int representing the index of the chosen item in the supplied Vector of Strings.
        Throws:
        PreviousRequestException - if the user replies at the console prompt that they wish to proceed back to the previous step. If this method is called from the executeCustomCode() method of a Custom Code Console Action, it is not necessary to catch the exception unless the action wishes to 'veto' the request and/or perform cleanup prior to allowing the installer to return to a previous step.
        See Also:
        createChoiceList(Vector, int), createChoiceListAndGetValue(String, Vector), createChoiceListAndGetValue(String, String[]), createChoiceListAndGetValue(String, String[], int)
      • createChoiceListAndGetValue

        int createChoiceListAndGetValue​(java.lang.String prompt,
                                        java.lang.String[] choices)
                                 throws PreviousRequestException

        Constructs a numbered vertical list of choices from the array of Strings provided in the parameters to this method. This list is displayed in the console. The index of the option chosen by the user is returned.

        Below the list, the user will be presented with the prompt supplied and will be required to enter a value corresponding to the one of the choices in the list before proceeding (i.e., the user cannot simply press to proceed past the prompt). All input will be validated against the numbers as presented in the list. Until a valid input is entered, the prompt will be repeated to the user. An input delimiter followed by a space is automatically appended to the prompt.

        The integer returned by this method corresponds to the index of the item in the array which the user chose from the list

        Parameters:
        choices - an array of Strings from which to construct the choice list.
        prompt - the prompt to be shown to the user.
        Returns:
        an int representing the index of the chosen item in the supplied array of Strings.
        Throws:
        PreviousRequestException - if the user replies at the console prompt that they wish to proceed back to the previous step. If this method is called from the executeCustomCode() method of a Custom Code Console Action, it is not necessary to catch the exception unless the action wishes to 'veto' the request and/or perform cleanup prior to allowing the installer to return to a previous step.
        See Also:
        createChoiceList(String[]), createChoiceListAndGetValue(String, Vector), createChoiceListAndGetValue(String, Vector, int), createChoiceListAndGetValue(String, String[], int)
      • createChoiceListAndGetValue

        int createChoiceListAndGetValue​(java.lang.String prompt,
                                        java.lang.String[] choices,
                                        int defaultChoice)
                                 throws PreviousRequestException

        Constructs a numbered vertical list of choices from the array of Strings provided in the parameters to this method. This list is displayed in the console. The index of the option chosen by the user is returned.

        Below the list, the user will be presented with the prompt supplied. Because a default value has been supplied the user will have the option to either a value corresponding to the one of the choices in the list or to press to accept the default selection. All input will be validated against the numbers as presented in the list. If an invalid input is entered, the prompt will be repeated to the user. An input delimiter followed by a space is automatically appended to the prompt.

        The integer returned by this method corresponds to the index of the item in the array which the user chose from the list

        Parameters:
        choices - an array of Strings from which to construct the choice list.
        prompt - the prompt to be shown to the user.
        defaultChoice - the index of the element in the supplied String[] which should be identified as the default.
        Returns:
        an int representing the index of the chosen item in the supplied array of Strings.
        Throws:
        PreviousRequestException - if the user replies at the console prompt that they wish to proceed back to the previous step. If this method is called from the executeCustomCode() method of a Custom Code Console Action, it is not necessary to catch the exception unless the action wishes to 'veto' the request and/or perform cleanup prior to allowing the installer to return to a previous step.
        See Also:
        createChoiceList(String[], int), createChoiceListAndGetValue(String, Vector), createChoiceListAndGetValue(String, Vector, int), createChoiceListAndGetValue(String, String[])
      • createChoiceListAndGetMultipleValues

        int[] createChoiceListAndGetMultipleValues​(java.lang.String prompt,
                                                   java.util.Vector choicesV)
                                            throws PreviousRequestException

        Constructs a numbered vertical list of choices from the Vector of Strings provided in the parameters to this method. This list is displayed in the console. The index(es) of the option(s) chosen by the user is returned.

        Below the list, the user will be presented with the prompt supplied and will be required to enter a value(s) corresponding to the one of the choices in the list before proceeding (i.e., the user cannot simply press to proceed past the prompt). The supplied input can consist of a single choice from the list or a comma-separated list of choices. All input will be validated against the numbers as presented in the list. Until a valid input is entered, the prompt will be repeated to the user. An input delimiter followed by a space is automatically appended to the prompt.

        The int[] returned by this method corresponds to the index(es) of the item(s) in the Vector which the user chose from the list

        Parameters:
        choicesV - a Vector of Strings from which to construct the choice list.
        prompt - the prompt to be shown to the user.
        Returns:
        an int[] representing the index(es) of the chosen item(s) in the supplied Vector of Strings.
        Throws:
        PreviousRequestException - if the user replies at the console prompt that they wish to proceed back to the previous step. If this method is called from the executeCustomCode() method of a Custom Code Console Action, it is not necessary to catch the exception unless the action wishes to 'veto' the request and/or perform cleanup prior to allowing the installer to return to a previous step.
        See Also:
        createChoiceList(Vector), createChoiceListAndGetValue(String, Vector), createChoiceListAndGetValue(String, Vector, int), createChoiceListAndGetValue(String, String[]), createChoiceListAndGetValue(String, String[], int)
      • createChoiceListAndGetMultipleValues

        int[] createChoiceListAndGetMultipleValues​(java.lang.String prompt,
                                                   java.lang.String[] choices)
                                            throws PreviousRequestException

        Constructs a numbered vertical list of choices from the array of Strings provided in the parameters to this method. This list is displayed in the console. The index(es) of the option(s) chosen by the user is returned.

        Below the list, the user will be presented with the prompt supplied and will be required to enter a value(s) corresponding to the one of the choices in the list before proceeding (i.e., the user cannot simply press to proceed past the prompt). The supplied input can consist of a single choice from the list or a comma-separated list of choices. All input will be validated against the numbers as presented in the list. Until a valid input is entered, the prompt will be repeated to the user. An input delimiter followed by a space is automatically appended to the prompt.

        The int[] returned by this method corresponds to the index(es) of the item(s) in the array which the user chose from the list

        Parameters:
        choices - an array of Strings from which to construct the choice list.
        prompt - the prompt to be shown to the user.
        Returns:
        an int[] representing the index(es) of the chosen item(s) in the supplied array of Strings.
        Throws:
        PreviousRequestException - if the user replies at the console prompt that they wish to proceed back to the previous step. If this method is called from the executeCustomCode() method of a Custom Code Console Action, it is not necessary to catch the exception unless the action wishes to 'veto' the request and/or perform cleanup prior to allowing the installer to return to a previous step.
        See Also:
        createChoiceList(String[]), createChoiceListAndGetValue(String, Vector), createChoiceListAndGetValue(String, Vector, int), createChoiceListAndGetValue(String, String[]), createChoiceListAndGetValue(String, String[], int)
      • createChoiceListAndGetMultipleValuesWithDefaults

        int[] createChoiceListAndGetMultipleValuesWithDefaults​(java.lang.String prompt,
                                                               java.util.Vector choicesV,
                                                               int[] defaults)
                                                        throws PreviousRequestException

        Constructs a numbered vertical list of choices from the array of Strings provided in the parameters to this method. This list is displayed in the console. The index(es) of the option(s) chosen by the user is returned. This method accepts an integer array that represents default sections.

        Below the list, the user will be presented with the prompt supplied and will be required to enter a value(s) corresponding to the one of the choices in the list before proceeding (i.e., the user cannot simply press to proceed past the prompt). The supplied input can consist of a single choice from the list or a comma-separated list of choices. All input will be validated against the numbers as presented in the list. Until a valid input is entered, the prompt will be repeated to the user. An input delimiter followed by a space is automatically appended to the prompt.

        The int[] returned by this method corresponds to the index(es) of the item(s) in the array which the user chose from the list

        Parameters:
        choicesV - an array of Strings from which to construct the choice list.
        prompt - the prompt to be shown to the user.
        defaults - the default values
        Returns:
        an int[] representing the index(es) of the chosen item(s) in the supplied array of Strings.
        Throws:
        PreviousRequestException - if the user replies at the console prompt that they wish to proceed back to the previous step. If this method is called from the executeCustomCode() method of a Custom Code Console Action, it is not necessary to catch the exception unless the action wishes to 'veto' the request and/or perform cleanup prior to allowing the installer to return to a previous step.
        See Also:
        createChoiceList(String[]), createChoiceListAndGetValue(String, Vector), createChoiceListAndGetValue(String, Vector, int), createChoiceListAndGetValue(String, String[]), createChoiceListAndGetValue(String, String[], int)
      • wprint

        void wprint​(java.lang.String x)

        Prints a String without terminating the line at the end of the String.

        This method behaves as though it invokes PrintStream.print(String) with the exception that Strings beyond the default console width (80 characters) will automatically be wrapped to the next line on the console.

        This method is particularly useful for printing long lines of text on consoles where the line wrapping behavior is unknown, or where you want to avoid having the default line wrapping cut words at unexpected and unwanted places

        Parameters:
        x - the String to be printed.
        See Also:
        wprint(String, int), wprintln(String), wprintln(String, int), wprintlnWithBreaks(String), wprintlnWithBreaks(String, String, int, int)
      • wprint

        void wprint​(java.lang.String x,
                    int consoleWidth)

        Prints a String without terminating the line at the end of the String.

        This method behaves as though it invokes PrintStream.print(String) with the exception that Strings beyond the specified console width will automatically be wrapped to the next line on the console.

        This method is particularly useful for printing long lines of text on consoles where the line wrapping behavior is unknown, or where you want to avoid having the default line wrapping cut words at unexpected and unwanted places

        Parameters:
        x - the String to be printed.
        consoleWidth - the width in characters at which wrapping should occur.
        See Also:
        wprint(String), wprintln(String), wprintln(String, int), wprintlnWithBreaks(String), wprintlnWithBreaks(String, String, int, int)
      • wprintln

        void wprintln​(java.lang.String x)

        Prints a String and then terminates the line.

        This method behaves as though it invokes PrintStream.print(String) and then PrintStream.println() with the exception that Strings beyond the default console width (80 characters) will automatically be wrapped to the next line on the console.

        This method is particularly useful for printing long lines of text on consoles where the line wrapping behavior is unknown, or where you want to avoid having the default line wrapping cut words at unexpected and unwanted places

        Parameters:
        x - the String to be printed.
        See Also:
        wprint(String), wprint(String, int), wprintln(String, int), wprintlnWithBreaks(String), wprintlnWithBreaks(String, String, int, int)
      • wprintln

        void wprintln​(java.lang.String x,
                      int consoleWidth)

        Prints a String and then terminates the line.

        This method behaves as though it invokes PrintStream.print(String) and then PrintStream.println() with the exception that Strings beyond the specified console width will automatically be wrapped to the next line on the console.

        This method is particularly useful for printing long lines of text on consoles where the line wrapping behavior is unknown, or where you want to avoid having the default line wrapping cut words at unexpected and unwanted places

        Parameters:
        x - the String to be printed.
        consoleWidth - the width in characters at which wrapping should occur.
        See Also:
        wprint(String), wprint(String, int), wprintln(String), wprintlnWithBreaks(String), wprintlnWithBreaks(String, String, int, int)
      • wprintlnWithBreaks

        void wprintlnWithBreaks​(java.lang.String text)
                         throws PreviousRequestException

        Prints a String and then terminates the line.

        This method behaves as though it invokes PrintStream.print(String) and then PrintStream.println() with the exception that Strings beyond the default console width (80 characters) will automatically be wrapped to the next line on the console. In addition, at a predefined vertical height (22 lines of text), the output will pause and the user will be prompted with the default enter to continue text prompt. When the user presses the text will continue to be displayed until the vertical limit is again reached, etc.

        This method is particularly useful for printing long text (e.g., a license agreement), where one wants to give the user the opportunity to read each screen of text before proceeding, rather than having the text scroll by in rapid fashion.

        Parameters:
        text - the text String to be printed.
        Throws:
        PreviousRequestException - if the user replies at the console prompt that they wish to proceed back to the previous step. If this method is called from the executeCustomCode() method of a Custom Code Console Action, it is not necessary to catch the exception unless the action wishes to 'veto' the request and/or perform cleanup prior to allowing the installer to return to a previous step.
        See Also:
        wprint(String), wprint(String, int), wprintln(String), wprintln(String, int), wprintlnWithBreaks(String, String, int, int)
      • wprintlnWithBreaks

        void wprintlnWithBreaks​(java.lang.String text,
                                java.lang.String prompt,
                                int width,
                                int height)
                         throws PreviousRequestException

        Prints a String and then terminates the line.

        This method behaves as though it invokes PrintStream.print(String) and then PrintStream.println() with the exception that Strings beyond specified console width will automatically be wrapped to the next line on the console. In addition, at the specified vertical height, the output will pause and the user will be prompted with the supplied prompt. When the user presses the text will continue to be displayed until the vertical limit is again reached, etc.

        This method is particularly useful for printing long text (e.g., a license agreement), where one wants to give the user the oppotunity to read each screen of text before proceeding, rather than having the text scroll by in rapid fashion.

        Parameters:
        text - the text String to be printed.
        prompt - the prompt to be shown to the user.
        width - the width in characters at which wrapping should occur.
        height - the height in lines at which the output should pause and wait for the user.
        Throws:
        PreviousRequestException - if the user replies at the console prompt that they wish to proceed back to the previous step. If this method is called from the executeCustomCode() method of a Custom Code Console Action, it is not necessary to catch the exception unless the action wishes to 'veto' the request and/or perform cleanup prior to allowing the installer to return to a previous step.
        See Also:
        wprint(String), wprint(String, int), wprintln(String), wprintln(String, int), wprintlnWithBreaks(String)
      • wprintlnWithBreaksAndSkipPrompt

        void wprintlnWithBreaksAndSkipPrompt​(java.lang.String text,
                                             java.lang.String prompt,
                                             int width,
                                             int height)
                                      throws PreviousRequestException

        Prints a String and then terminates the line.

        This method behaves as though it invokes PrintStream.print(String) and then PrintStream.println() with the exception that Strings beyond specified console width will automatically be wrapped to the next line on the console. In addition, at the specified vertical height, the output will pause and the user will be prompted with the supplied prompt. When the user presses any text will continue to be displayed until the vertical limit is again reached, etc or if user press '0' it should skip to next panel.

        This method is particularly useful for printing long text (e.g., a license agreement), where one wants to give the user the opportunity to read each screen of text before proceeding, rather than having the text scroll by in rapid fashion.

        Parameters:
        text - the text String to be printed.
        prompt - the prompt to be shown to the user.
        width - the width in characters at which wrapping should occur.
        height - the height in lines at which the output should pause and wait for the user to either Skip by pressing '0' or read further.
        Throws:
        PreviousRequestException - if the user replies at the console prompt that they wish to proceed back to the previous step. If this method is called from the executeCustomCode() method of a Custom Code Console Action, it is not necessary to catch the exception unless the action wishes to 'veto' the request and/or perform cleanup prior to allowing the installer to return to a previous step.
        See Also:
        wprint(String), wprint(String, int), wprintln(String), wprintln(String, int), wprintlnWithBreaks(String)