jline
Class CandidateListCompletionHandler
java.lang.Objectjline.CandidateListCompletionHandler
- CompletionHandler
public class CandidateListCompletionHandler
extends java.lang.Object
A
CompletionHandler that deals with multiple distinct completions
by outputting the complete list of possibilities to the console. This
mimics the behavior of the
readline
library.
TODO:
- handle quotes and escaped quotes
- enable automatic escaping of whitespace
eagerNewlines
private boolean eagerNewlines
loc
private static ResourceBundle loc
getUnambiguousCompletions
private final String getUnambiguousCompletions(List candidates)
Returns a root that matches all the String elements
of the specified List, or null if there are
no commalities. For example, if the list contains
foobar, foobaz, foobuz, the
method will return foob.
printCandidates
public static final void printCandidates(ConsoleReader reader,
Collection candidates,
boolean eagerNewlines)
throws IOException Print out the candidates. If the size of the candidates
is greated than the getAutoprintThreshhold,
they prompt with aq warning.
candidates - the list of candidates to print
setAlwaysIncludeNewline
public void setAlwaysIncludeNewline(boolean eagerNewlines)
setBuffer
public static void setBuffer(ConsoleReader reader,
String value,
int offset)
throws IOException
startsWith
private final boolean startsWith(String starts,
String[] candidates)- true is all the elements of candidates
start with starts