| java.lang.Object org.eclipse.ui.internal.texteditor.HippieCompletionEngine
HippieCompletionEngine | final public class HippieCompletionEngine (Code) | | This class contains the hippie completion engine methods that actually
compute the possible completions.
This engine is used by the org.eclipse.ui.texteditor.HippieCompleteAction .
TODO: Sort by editor type
TODO: Provide history option
since: 3.1 author: Genady Beryozkin, me@genady.org |
Method Summary | |
public List | getCompletionsBackwards(IDocument document, CharSequence prefix, int firstPosition) Search for possible completions in the backward direction. | public List | getCompletionsForward(IDocument document, CharSequence prefix, int firstPosition, boolean currentWordLast) Return the list of completion suggestions that correspond to the
provided prefix.
Parameters: document - the document to be scanned Parameters: prefix - the prefix to search for Parameters: firstPosition - the initial position in the document thatthe search will start from. | public String | getPrefixString(IDocument doc, int pos) Returns the text between the provided position and the preceding word boundary.
Parameters: doc - the document that will be scanned. Parameters: pos - the caret position. | public List | makeUnique(List suggestions) Remove duplicate suggestions (excluding the prefix), leaving the closest
to list head.
Parameters: suggestions - a list of suggestions (String). |
HippieCompletionEngine | public HippieCompletionEngine()(Code) | | Creates a new engine.
|
getCompletionsBackwards | public List getCompletionsBackwards(IDocument document, CharSequence prefix, int firstPosition) throws BadLocationException(Code) | | Search for possible completions in the backward direction. If there
is a possible completion that begins before firstPosition
but ends after that position, it will not be included in the results.
Parameters: document - the document to be scanned Parameters: prefix - the completion prefix Parameters: firstPosition - the caret position a List of possible completions (Strings)from the caret position to the beginning of the document.The empty suggestion is not included in the results. throws: BadLocationException - if any error occurs |
getCompletionsForward | public List getCompletionsForward(IDocument document, CharSequence prefix, int firstPosition, boolean currentWordLast) throws BadLocationException(Code) | | Return the list of completion suggestions that correspond to the
provided prefix.
Parameters: document - the document to be scanned Parameters: prefix - the prefix to search for Parameters: firstPosition - the initial position in the document thatthe search will start from. In order to search from thebeginning of the document use firstPosition=0 . Parameters: currentWordLast - if true the word at caret positionshould be that last completion. true is goodfor searching in the currently open document and false is good for searching in other documents. a List of possible completions (as Strings),excluding the common prefix throws: BadLocationException - if there is some error scanning thedocument. |
getPrefixString | public String getPrefixString(IDocument doc, int pos) throws BadLocationException(Code) | | Returns the text between the provided position and the preceding word boundary.
Parameters: doc - the document that will be scanned. Parameters: pos - the caret position. the text if found, or null. throws: BadLocationException - if an error occurs. since: 3.2 |
makeUnique | public List makeUnique(List suggestions)(Code) | | Remove duplicate suggestions (excluding the prefix), leaving the closest
to list head.
Parameters: suggestions - a list of suggestions (String). a list of unique completion suggestions. |
|
|