|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.jac.aspects.gui.swing.CompletionEngine
org.objectweb.jac.ide.swing.MethodBodyCompletionEngine
This class implements a completion engine for method bodies Java editors of the UMLAF IDE.
Field Summary |
Fields inherited from class org.objectweb.jac.aspects.gui.swing.CompletionEngine |
BACKWARD, baseWords, FORWARD |
Constructor Summary | |
MethodBodyCompletionEngine(Method method,
SHEditor editor)
Creates a completion engine for a given method. |
Method Summary | |
List |
buildClassWords(Class c)
Get all the accessible words in the context of a given IDE class (fields,methods). |
List |
buildThisWords()
Builds the list of method and field names that are directly accessible within the class of the method and the parameters of the method, as well as the names of the types of those fields. |
List |
buildTypeWords(Type type)
Get all the accessible words in the context of a given type. |
List |
getContextualChoices(String text,
int position,
String writtenText)
Get the contextual possible choices. |
boolean |
isAutomaticCompletionChar(char c)
Returns true if c=='(' . |
void |
runAutomaticCompletion(SHEditor editor,
String text,
int position,
char c)
Help the programmer to write useful control structure such as for or while . |
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 |
public MethodBodyCompletionEngine(Method method, SHEditor editor)
Method Detail |
public List getContextualChoices(String text, int position, String writtenText)
Supported contextual completions are like
class_typed_symbol.{methods}
. In the long term, any
typed expression should be supported even if it is not that
important in clean developments (because of the Demeter's
Law!!).
getContextualChoices
in class CompletionEngine
text
- the editor's full textposition
- the cursor positionwrittenText
- the already written text
public List buildThisWords()
public List buildTypeWords(Type type)
If type is an internal IDE class, all the method plus the generated methods (getters, setters, adders, removers, clearers) are returned. If type is an external library class, all the public methods are returned.
buildClassWords(Class)
public List buildClassWords(Class c)
c
- the class for which to get accessible wordspublic boolean isAutomaticCompletionChar(char c)
c=='('
.
isAutomaticCompletionChar
in class CompletionEngine
public void runAutomaticCompletion(SHEditor editor, String text, int position, char c)
for
or while
.
runAutomaticCompletion
in class CompletionEngine
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |