Class AutoCompleter

java.lang.Object
com.adventure.commands.AutoCompleter

public class AutoCompleter extends Object
Singleton that predicts text when pressing tab
  • Method Details

    • getInstance

      public static AutoCompleter getInstance()
      Instance getter for the singleton
      Returns:
      current instance
    • loadCompleter

      public void loadCompleter(String newInput, String previousInput)
      Gets all possible commands from the initial command inserted by the user
      Parameters:
      newInput - String The input just inserted
      previousInput - String The partial command found in the input field
    • operate

      public void operate(javafx.beans.property.StringProperty output, javafx.beans.property.StringProperty input, AutoCompleter.direction dir)
      Obtain and set the input and output Strings
      Parameters:
      output - TextArea of the output prompt
      input - TextFiled for the input prompt
      dir - Direction to follow when selecting the next prediction
    • incrementCounter

      public void incrementCounter()
      Increment the number of times the 'tab' key has been pressed
    • decrementCounter

      public void decrementCounter()
      Decrement the number of times the 'tab' key has been pressed