jline
Class CandidateListCompletionHandler

java.lang.Object
  extended byjline.CandidateListCompletionHandler
All Implemented Interfaces:
CompletionHandler

public class CandidateListCompletionHandler
extends Object
implements CompletionHandler

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:

Author:
Marc Prud'hommeaux

Constructor Summary
CandidateListCompletionHandler()
           
 
Method Summary
 boolean complete(ConsoleReader reader, List candidates, int pos)
           
static void printCandidates(ConsoleReader reader, Collection candidates, boolean eagerNewlines)
          Print out the candidates.
 void setAlwaysIncludeNewline(boolean eagerNewlines)
           
static void setBuffer(ConsoleReader reader, String value, int offset)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CandidateListCompletionHandler

public CandidateListCompletionHandler()
Method Detail

setAlwaysIncludeNewline

public void setAlwaysIncludeNewline(boolean eagerNewlines)

complete

public boolean complete(ConsoleReader reader,
                        List candidates,
                        int pos)
                 throws IOException
Specified by:
complete in interface CompletionHandler
Throws:
IOException

setBuffer

public static void setBuffer(ConsoleReader reader,
                             String value,
                             int offset)
                      throws IOException
Throws:
IOException

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.

Parameters:
candidates - the list of candidates to print
Throws:
IOException


Copyright 2002-2008. All Rights Reserved.