jline

Class FileNameCompletor

public class FileNameCompletor extends Object implements Completor

A file name completor takes the buffer and issues a list of potential completions.

This completor tries to behave as similar as possible to bash's file name completion (using GNU readline) with the following exceptions:

TODO

Author: Marc Prud'hommeaux

Method Summary
intcomplete(String buf, int cursor, List candidates)
intmatchFiles(String buffer, String translated, File[] entries, List candidates)
Match the specified buffer to the array of entries and enter the matches into the list of candidates.
protected voidsortFileNames(List fileNames)

Method Detail

complete

public int complete(String buf, int cursor, List candidates)

matchFiles

public int matchFiles(String buffer, String translated, File[] entries, List candidates)
Match the specified buffer to the array of entries and enter the matches into the list of candidates. This method can be overridden in a subclass that wants to do more sophisticated file name completion.

Parameters: buffer the untranslated buffer translated the buffer with common characters replaced entries the list of files to match candidates the list of candidates to populate

Returns: the offset of the match

sortFileNames

protected void sortFileNames(List fileNames)
Copyright © 2002-2010 null. All Rights Reserved.