Interface Console

  • All Known Implementing Classes:
    Basic

    public interface Console
    Interface for classes that allow the user to interact in the terminal.
    Version:
    $Revision$
    Author:
    FracPete (fracpete at waikato dot ac dot nz)
    • Method Detail

      • enterMultiLineValue

        String enterMultiLineValue​(String msg)
        Lets the user enter a multi-line value.
        Parameters:
        msg - the message to output before reading the input
        Returns:
        the entered value, null if cancelled or failed to read input
      • enterValue

        String enterValue​(String msg)
        Lets the user enter a value.
        Parameters:
        msg - the message to output before reading the input
        Returns:
        the entered value, null if cancelled or failed to read input
      • enterValue

        String enterValue​(String msg,
                          String initial)
        Lets the user enter a value.
        Parameters:
        msg - the message to output before reading the input
        initial - the initial value, ignored if empty or null
        Returns:
        the entered value, null if cancelled or failed to read input
      • enterMultipleValues

        String[] enterMultipleValues​(String msg)
        Lets the user enter multiple values. Empty string terminates the loop.
        Parameters:
        msg - the message to output before reading the input
        Returns:
        the entered value, null if cancelled or failed to read input
      • enterPassword

        BasePassword enterPassword​(String msg)
        Lets the user enter a password.
        Parameters:
        msg - the message to output before reading the input
        Returns:
        the entered value, null if cancelled or failed to read input
      • selectOption

        String selectOption​(String msg,
                            String[] options)
        Lets the user select from a number of choices.
        Parameters:
        msg - the message to output before reading the input
        options - the options to choose from
        Returns:
        the selected option, null if cancelled or failed to read input
      • selectOption

        String selectOption​(String msg,
                            String[] options,
                            String initial)
        Lets the user select from a number of choices.
        Parameters:
        msg - the message to output before reading the input
        options - the options to choose from
        initial - the initial selection (selected if just hitting enter), null or empty string to ignore
        Returns:
        the selected option, null if cancelled or failed to read input
      • selectDirectory

        PlaceholderDirectory selectDirectory​(String msg,
                                             PlaceholderDirectory initial)
        Lets the user select a directory.
        Parameters:
        msg - the message to output
        initial - the initial directory
        Returns:
        the directory, null if cancelled
      • selectFiles

        PlaceholderFile[] selectFiles​(String msg,
                                      PlaceholderFile... initial)
        Lets the user select files.
        Parameters:
        msg - the message to output
        initial - the initial files
        Returns:
        the directory, null if cancelled
      • printlnOut

        void printlnOut​(String msg)
        Outputs the message.
        Parameters:
        msg - the message to output
      • printlnErr

        void printlnErr​(String msg)
        Outputs the error message.
        Parameters:
        msg - the error message to output