jline.console.completer
Class CandidateListCompletionHandler

java.lang.Object
  extended by jline.console.completer.CandidateListCompletionHandler
All Implemented Interfaces:
CompletionHandler

public class CandidateListCompletionHandler
extends java.lang.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.

Since:
2.3
Author:
Marc Prud'hommeaux, Jason Dillon

Constructor Summary
CandidateListCompletionHandler()
           
 
Method Summary
 boolean complete(ConsoleReader reader, java.util.List<java.lang.CharSequence> candidates, int pos)
           
static void printCandidates(ConsoleReader reader, java.util.Collection<java.lang.CharSequence> candidates)
          Print out the candidates.
static void setBuffer(ConsoleReader reader, java.lang.CharSequence 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

complete

public boolean complete(ConsoleReader reader,
                        java.util.List<java.lang.CharSequence> candidates,
                        int pos)
                 throws java.io.IOException
Specified by:
complete in interface CompletionHandler
Throws:
java.io.IOException

setBuffer

public static void setBuffer(ConsoleReader reader,
                             java.lang.CharSequence value,
                             int offset)
                      throws java.io.IOException
Throws:
java.io.IOException

printCandidates

public static void printCandidates(ConsoleReader reader,
                                   java.util.Collection<java.lang.CharSequence> candidates)
                            throws java.io.IOException
Print out the candidates. If the size of the candidates is greater than the ConsoleReader.getAutoprintThreshold(), they prompt with a warning.

Parameters:
candidates - the list of candidates to print
Throws:
java.io.IOException


Copyright © 2008-2011 Sonatype. All Rights Reserved.