JAC project
AOPSYS
CEDRIC & LIP6 labs

org.objectweb.jac.aspects.gui.swing
Class DefaultCompletionEngine

java.lang.Object
  |
  +--org.objectweb.jac.aspects.gui.swing.CompletionEngine
        |
        +--org.objectweb.jac.aspects.gui.swing.DefaultCompletionEngine

public class DefaultCompletionEngine
extends CompletionEngine

This class implements a default completion engines for editors. It is non contextual (i.e. the proposed completions are always the same and are the ones defined by addBaseWord.


Field Summary
 
Fields inherited from class org.objectweb.jac.aspects.gui.swing.CompletionEngine
BACKWARD, baseWords, FORWARD
 
Constructor Summary
DefaultCompletionEngine()
           
 
Method Summary
 List getContextualChoices(String text, int position, String writtenText)
          In the default completion engine, this method only returns base words (i.e.
 boolean isAutomaticCompletionChar(char c)
          This method always returns false (no automatic completion is supported).
 void runAutomaticCompletion(SHEditor editor, String text, int position, char c)
          Do nothing (anyway it is never called because isAutomaticCompletionChar always returns false).
 
Methods inherited from class org.objectweb.jac.aspects.gui.swing.CompletionEngine
addBaseWord, addBaseWords, clearBaseWords, getBaseWords, getProposal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultCompletionEngine

public DefaultCompletionEngine()
Method Detail

getContextualChoices

public List getContextualChoices(String text,
                                 int position,
                                 String writtenText)
In the default completion engine, this method only returns base words (i.e. non-contextual words).

Specified by:
getContextualChoices in class CompletionEngine
Parameters:
text - the editor's full text
position - the cursor position
writtenText - the already written text
Returns:
a list of strings which must not contain duplicates

isAutomaticCompletionChar

public boolean isAutomaticCompletionChar(char c)
This method always returns false (no automatic completion is supported).

Specified by:
isAutomaticCompletionChar in class CompletionEngine

runAutomaticCompletion

public void runAutomaticCompletion(SHEditor editor,
                                   String text,
                                   int position,
                                   char c)
Do nothing (anyway it is never called because isAutomaticCompletionChar always returns false).

Specified by:
runAutomaticCompletion in class CompletionEngine

Contact JAC development team:
Renaud Pawlak
Lionel Seinturier
Laurent Martelli