程序包 jline
类 FileNameCompletor
java.lang.Object
jline.FileNameCompletor
- 所有已实现的接口:
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:
- Candidates that are directories will end with "/"
- Wildcard regular expressions are not evaluated or replaced
- The "~" character can be used to represent the user's home, but it cannot complete to other users' homes, since java does not provide any way of determining that easily
TODO
- Handle files with spaces in them
- Have an option for file type color highlighting
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明int
Populates candidates with a list of possible completions for the buffer.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.protected void
sortFileNames
(List fileNames)
-
构造器详细资料
-
FileNameCompletor
public FileNameCompletor()
-
-
方法详细资料
-
complete
从接口复制的说明:Completor
Populates candidates with a list of possible completions for the buffer. The candidates list will not be sorted before being displayed to the user: thus, the complete method should sort theList
before returning. -
sortFileNames
-
matchFiles
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.- 参数:
buffer
- the untranslated buffertranslated
- the buffer with common characters replacedentries
- the list of files to matchcandidates
- the list of candidates to populate- 返回:
- the offset of the match
-