|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.jdt.internal.codeassist.impl.Engine
org.eclipse.jdt.internal.codeassist.SelectionEngine
public final class SelectionEngine
The selection engine is intended to infer the nature of a selected name in some source code. This name can be qualified. Selection is resolving context using a name environment (no need to search), assuming the source where selection occurred is correct and will not perform any completion attempt. If this was the desired behavior, a call to the CompletionEngine should be performed instead.
Field Summary | |
---|---|
static boolean |
DEBUG
|
static boolean |
PERF
|
Fields inherited from class org.eclipse.jdt.internal.codeassist.impl.Engine |
---|
compilerOptions, currentPackageName, discouragedReferenceIsError, forbiddenReferenceIsError, importCacheCount, importCachesInitialized, importsCache, lookupEnvironment, nameEnvironment, onDemandImportCacheCount, onDemandImportsCache, options |
Constructor Summary | |
---|---|
SelectionEngine(SearchableEnvironment nameEnvironment,
ISelectionRequestor requestor,
java.util.Map settings)
The SelectionEngine is responsible for computing the selected object. |
Method Summary | |
---|---|
void |
acceptPackage(char[] packageName)
One result of the search consists of a new package. |
void |
acceptType(char[] packageName,
char[] simpleTypeName,
char[][] enclosingTypeNames,
int modifiers,
AccessRestriction accessRestriction)
One result of the search consists of a new type. |
AssistParser |
getParser()
|
void |
select(ICompilationUnit sourceUnit,
int selectionSourceStart,
int selectionSourceEnd)
Ask the engine to compute the selection at the specified position of the given compilation unit. |
void |
selectType(char[] typeName,
IType context)
Asks the engine to compute the selection of the given type from the given context |
Methods inherited from class org.eclipse.jdt.internal.codeassist.impl.Engine |
---|
accept, accept, accept, getSignature, getSignature, getTypeSignature, initializeImportCaches |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static boolean DEBUG
public static boolean PERF
Constructor Detail |
---|
public SelectionEngine(SearchableEnvironment nameEnvironment, ISelectionRequestor requestor, java.util.Map settings)
nameEnvironment
- org.eclipse.jdt.internal.core.SearchableEnvironment
used to resolve type/package references and search for types/packages
based on partial names.requestor
- org.eclipse.jdt.internal.codeassist.ISelectionRequestor
since the engine might produce answers of various forms, the engine
is associated with a requestor able to accept all possible completions.settings
- java.util.Map
set of options used to configure the code assist engine.Method Detail |
---|
public void acceptType(char[] packageName, char[] simpleTypeName, char[][] enclosingTypeNames, int modifiers, AccessRestriction accessRestriction)
ISearchRequestor
acceptType
in interface ISearchRequestor
public void acceptPackage(char[] packageName)
acceptPackage
in interface ISearchRequestor
packageName
- char[]
NOTE - All package names are presented in their readable form:
Package names are in the form "a.b.c".
The default package is represented by an empty array.public AssistParser getParser()
getParser
in class Engine
public void select(ICompilationUnit sourceUnit, int selectionSourceStart, int selectionSourceEnd)
sourceUnit
- org.eclipse.jdt.internal.compiler.env.ICompilationUnit
the source of the current compilation unit.selectionSourceStart
- intselectionSourceEnd
- int
a range in the source where the selection is.public void selectType(char[] typeName, IType context) throws JavaModelException
typeName
- char[]
a type name which is to be resolved in the context of a compilation unit.
NOTE: the type name is supposed to be correctly reduced (no whitespaces, no unicodes left)context
- org.eclipse.jdt.core.IType
the context in which code assist is invoked.
JavaModelException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |