Class FileLineGetter

This is a line getter that customizes the tab completion to fill in file names separated by spaces, like a command line thing.

class FileLineGetter
  : LineGetter ;

Fields

NameTypeDescription
searchDirectory stringYou can set this property to tell it where to search for the files to complete.
autoSuggest boolTurn on auto suggest if you want a greyed thing of what tab would be able to fill in as you type.
background Color.
prompt stringSet this if you want a prompt to be drawn with the line. It does NOT support color in string.
regularForeground Color.
suggestionForeground ColorYou can customize the colors here. You should set these after construction, but before calling startGettingLine or getline.

Methods

NameDescription
addChar (ch) Adds a character at the current position in the line. You can call this too if you hook events for hotkeys or something. You'll probably want to call redraw() after adding chars.
addString (s) .
deleteChar () Deletes the character at the current position in the line. You'll probably want to call redraw() after deleting chars.
deleteToEndOfLine ()
dispose () Call this before letting LineGetter die so it can do any necessary cleanup and save the updated history to a file.
getline (input) One-call shop for the main workhorse If you already have a RealTimeConsoleInput ready to go, you should pass a pointer to yours here. Otherwise, LineGetter will make its own.
historyFileDirectory () Override this to change the directory where history files are stored
historyFilter (candidate) Override this if you don't want all lines added to the history. You can return null to not add it at all, or you can transform it.
loadSettingsAndHistoryFromFile () You may override this to do nothing
saveSettingsAndHistoryToFile () You may override this to do nothing
startGettingLine () Starts getting a new line. Call workOnLine and finishGettingLine afterward.
workOnLine (e) for integrating into another event loop you can pass individual events to this and the line getter will work on it
showTabCompleteList (list) Override this to provide a custom display of the tab completion list
tabComplete (candidate) Override this to provide tab completion. You may use the candidate argument to filter the list, but you don't have to (LineGetter will do it for you on the values you return).