org.objectweb.jac.aspects.gui.swing
Class CompletionEngine
java.lang.Object
|
+--org.objectweb.jac.aspects.gui.swing.CompletionEngine
- Direct Known Subclasses:
- DefaultCompletionEngine, MethodBodyCompletionEngine
- public abstract class CompletionEngine
- extends Object
This class must be subclassed to implement specific completion
engines for code editors.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BACKWARD
public static final int BACKWARD
- See Also:
- Constant Field Values
FORWARD
public static final int FORWARD
- See Also:
- Constant Field Values
baseWords
protected List baseWords
CompletionEngine
public CompletionEngine()
getContextualChoices
public abstract List getContextualChoices(String text,
int position,
String writtenText)
- Returns the list of the words that are potential completions for
a given context. Implement this methods for specific language
editors.
- Parameters:
text
- the editor's full textposition
- the cursor positionwrittenText
- the already written text
- Returns:
- a list of strings which must not contain duplicates
getProposal
public String getProposal(String text,
int position,
String writtenText,
String currentProposal,
int direction)
- Returns a proposal from a current text's state.
- Parameters:
text
- the editor's full textposition
- the cursor positionwrittenText
- the already written text of the
completionable word if anycurrentProposal
- the proposal that is currently made to
the user ("" if none)direction
- BACKWARD || FORWARD
- Returns:
- the proposed completion, starting with writtenText
runAutomaticCompletion
public abstract void runAutomaticCompletion(SHEditor editor,
String text,
int position,
char c)
isAutomaticCompletionChar
public abstract boolean isAutomaticCompletionChar(char c)
getBaseWords
public List getBaseWords()
addBaseWord
public void addBaseWord(String baseWord)
addBaseWords
public void addBaseWords(Collection baseWords)
clearBaseWords
public void clearBaseWords()