Schnittstelle ICodeAssist
- Alle bekannten Unterschnittstellen:
IClassFile
,ICompilationUnit
,IModularClassFile
,IOrdinaryClassFile
,ITypeRoot
- Alle bekannten Implementierungsklassen:
AbstractClassFile
,AssistCompilationUnit
,ClassFile
,ClassFileWorkingCopy
,CompilationUnit
,ModularClassFile
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoid
codeComplete
(int offset, CompletionRequestor requestor) Performs code completion at the given offset position in this compilation unit, reporting results to the given completion requestor.void
codeComplete
(int offset, CompletionRequestor requestor, WorkingCopyOwner owner) Performs code completion at the given offset position in this compilation unit, reporting results to the given completion requestor.void
codeComplete
(int offset, CompletionRequestor requestor, WorkingCopyOwner owner, org.eclipse.core.runtime.IProgressMonitor monitor) Performs code completion at the given offset position in this compilation unit, reporting results to the given completion requestor.void
codeComplete
(int offset, CompletionRequestor requestor, org.eclipse.core.runtime.IProgressMonitor monitor) Performs code completion at the given offset position in this compilation unit, reporting results to the given completion requestor.void
codeComplete
(int offset, ICodeCompletionRequestor requestor) Veraltet.void
codeComplete
(int offset, ICompletionRequestor requestor) Veraltet.UsecodeComplete(int, CompletionRequestor)
instead.void
codeComplete
(int offset, ICompletionRequestor requestor, WorkingCopyOwner owner) Veraltet.codeSelect
(int offset, int length) Returns the Java elements corresponding to the given selected text in this compilation unit.codeSelect
(int offset, int length, WorkingCopyOwner owner) Returns the Java elements corresponding to the given selected text in this compilation unit.
-
Methodendetails
-
codeComplete
Veraltet.UsecodeComplete(int, ICompletionRequestor)
instead.Performs code completion at the given offset position in this compilation unit, reporting results to the given completion requestor. Theoffset
is the 0-based index of the character, after which code assist is desired. Anoffset
of -1 indicates to code assist at the beginning of this compilation unit.- Parameter:
offset
- the given offset positionrequestor
- the given completion requestor- Löst aus:
JavaModelException
- if code assist could not be performed. Reasons include:- This Java element does not exist (ELEMENT_DOES_NOT_EXIST)
- The position specified is Ungültige Eingabe: "<" -1 or is greater than this compilation unit's source length (INDEX_OUT_OF_BOUNDS)
IllegalArgumentException
- ifrequestor
isnull
-
codeComplete
Veraltet.UsecodeComplete(int, CompletionRequestor)
instead.Performs code completion at the given offset position in this compilation unit, reporting results to the given completion requestor. Theoffset
is the 0-based index of the character, after which code assist is desired. Anoffset
of -1 indicates to code assist at the beginning of this compilation unit.- Parameter:
offset
- the given offset positionrequestor
- the given completion requestor- Löst aus:
JavaModelException
- if code assist could not be performed. Reasons include:- This Java element does not exist (ELEMENT_DOES_NOT_EXIST)
- The position specified is Ungültige Eingabe: "<" -1 or is greater than this compilation unit's source length (INDEX_OUT_OF_BOUNDS)
IllegalArgumentException
- ifrequestor
isnull
- Seit:
- 2.0
-
codeComplete
Performs code completion at the given offset position in this compilation unit, reporting results to the given completion requestor. Theoffset
is the 0-based index of the character, after which code assist is desired. Anoffset
of -1 indicates to code assist at the beginning of this compilation unit.- Parameter:
offset
- the given offset positionrequestor
- the given completion requestor- Löst aus:
JavaModelException
- if code assist could not be performed. Reasons include:- This Java element does not exist (ELEMENT_DOES_NOT_EXIST)
- The position specified is Ungültige Eingabe: "<" -1 or is greater than this compilation unit's source length (INDEX_OUT_OF_BOUNDS)
IllegalArgumentException
- ifrequestor
isnull
- Seit:
- 3.0
-
codeComplete
void codeComplete(int offset, CompletionRequestor requestor, org.eclipse.core.runtime.IProgressMonitor monitor) throws JavaModelException Performs code completion at the given offset position in this compilation unit, reporting results to the given completion requestor. Theoffset
is the 0-based index of the character, after which code assist is desired. Anoffset
of -1 indicates to code assist at the beginning of this compilation unit.If
IProgressMonitor
is notnull
then some proposals which can be very long to compute are proposed. To avoid that the code assist operation take too much time aIProgressMonitor
which automatically cancel the code assist operation when a specified amount of time is reached could be used.new IProgressMonitor() { private final static int TIMEOUT = 500; //ms private long endTime; public void beginTask(String name, int totalWork) { fEndTime= System.currentTimeMillis() + TIMEOUT; } public boolean isCanceled() { return endTime Ungültige Eingabe: "<"= System.currentTimeMillis(); } ... };
- Parameter:
offset
- the given offset positionrequestor
- the given completion requestormonitor
- the progress monitor used to report progress- Löst aus:
JavaModelException
- if code assist could not be performed. Reasons include:- This Java element does not exist (ELEMENT_DOES_NOT_EXIST)
- The position specified is Ungültige Eingabe: "<" -1 or is greater than this compilation unit's source length (INDEX_OUT_OF_BOUNDS)
IllegalArgumentException
- ifrequestor
isnull
- Seit:
- 3.5
-
codeComplete
void codeComplete(int offset, ICompletionRequestor requestor, WorkingCopyOwner owner) throws JavaModelException Veraltet.Performs code completion at the given offset position in this compilation unit, reporting results to the given completion requestor. Theoffset
is the 0-based index of the character, after which code assist is desired. Anoffset
of -1 indicates to code assist at the beginning of this compilation unit. It considers types in the working copies with the given owner first. In other words, the owner's working copies will take precedence over their original compilation units in the workspace.Note that if a working copy is empty, it will be as if the original compilation unit had been deleted.
- Parameter:
offset
- the given offset positionrequestor
- the given completion requestorowner
- the owner of working copies that take precedence over their original compilation units- Löst aus:
JavaModelException
- if code assist could not be performed. Reasons include:- This Java element does not exist (ELEMENT_DOES_NOT_EXIST)
- The position specified is Ungültige Eingabe: "<" -1 or is greater than this compilation unit's source length (INDEX_OUT_OF_BOUNDS)
IllegalArgumentException
- ifrequestor
isnull
- Seit:
- 3.0
-
codeComplete
void codeComplete(int offset, CompletionRequestor requestor, WorkingCopyOwner owner) throws JavaModelException Performs code completion at the given offset position in this compilation unit, reporting results to the given completion requestor. Theoffset
is the 0-based index of the character, after which code assist is desired. Anoffset
of -1 indicates to code assist at the beginning of this compilation unit. It considers types in the working copies with the given owner first. In other words, the owner's working copies will take precedence over their original compilation units in the workspace.Note that if a working copy is empty, it will be as if the original compilation unit had been deleted.
- Parameter:
offset
- the given offset positionrequestor
- the given completion requestorowner
- the owner of working copies that take precedence over their original compilation units- Löst aus:
JavaModelException
- if code assist could not be performed. Reasons include:- This Java element does not exist (ELEMENT_DOES_NOT_EXIST)
- The position specified is Ungültige Eingabe: "<" -1 or is greater than this compilation unit's source length (INDEX_OUT_OF_BOUNDS)
IllegalArgumentException
- ifrequestor
isnull
- Seit:
- 3.0
-
codeComplete
void codeComplete(int offset, CompletionRequestor requestor, WorkingCopyOwner owner, org.eclipse.core.runtime.IProgressMonitor monitor) throws JavaModelException Performs code completion at the given offset position in this compilation unit, reporting results to the given completion requestor. Theoffset
is the 0-based index of the character, after which code assist is desired. Anoffset
of -1 indicates to code assist at the beginning of this compilation unit. It considers types in the working copies with the given owner first. In other words, the owner's working copies will take precedence over their original compilation units in the workspace.Note that if a working copy is empty, it will be as if the original compilation unit had been deleted.
If
IProgressMonitor
is notnull
then some proposals which can be very long to compute are proposed. To avoid that the code assist operation take too much time aIProgressMonitor
which automatically cancel the code assist operation when a specified amount of time is reached could be used.new IProgressMonitor() { private final static int TIMEOUT = 500; //ms private long endTime; public void beginTask(String name, int totalWork) { fEndTime= System.currentTimeMillis() + TIMEOUT; } public boolean isCanceled() { return endTime Ungültige Eingabe: "<"= System.currentTimeMillis(); } ... };
- Parameter:
offset
- the given offset positionrequestor
- the given completion requestorowner
- the owner of working copies that take precedence over their original compilation unitsmonitor
- the progress monitor used to report progress- Löst aus:
JavaModelException
- if code assist could not be performed. Reasons include:- This Java element does not exist (ELEMENT_DOES_NOT_EXIST)
- The position specified is Ungültige Eingabe: "<" -1 or is greater than this compilation unit's source length (INDEX_OUT_OF_BOUNDS)
IllegalArgumentException
- ifrequestor
isnull
- Seit:
- 3.5
-
codeSelect
Returns the Java elements corresponding to the given selected text in this compilation unit. Theoffset
is the 0-based index of the first selected character. Thelength
is the number of selected characters.Note that if the
length
is 0 and theoffset
is inside an identifier or the index just after an identifier then this identifier is considered as the selection.- Parameter:
offset
- the given offset positionlength
- the number of selected characters- Gibt zurück:
- the Java elements corresponding to the given selected text
- Löst aus:
JavaModelException
- if code resolve could not be performed. Reasons include:- This Java element does not exist (ELEMENT_DOES_NOT_EXIST)
- The range specified is not within this element's source range (INDEX_OUT_OF_BOUNDS)
-
codeSelect
Returns the Java elements corresponding to the given selected text in this compilation unit. Theoffset
is the 0-based index of the first selected character. Thelength
is the number of selected characters. It considers types in the working copies with the given owner first. In other words, the owner's working copies will take precedence over their original compilation units in the workspace.Note that if the
length
is 0 and theoffset
is inside an identifier or the index just after an identifier then this identifier is considered as the selection.Note that if a working copy is empty, it will be as if the original compilation unit had been deleted.
- Parameter:
offset
- the given offset positionlength
- the number of selected charactersowner
- the owner of working copies that take precedence over their original compilation units- Gibt zurück:
- the Java elements corresponding to the given selected text
- Löst aus:
JavaModelException
- if code resolve could not be performed. Reasons include:- This Java element does not exist (ELEMENT_DOES_NOT_EXIST)
- The range specified is not within this element's source range (INDEX_OUT_OF_BOUNDS)
- Seit:
- 3.0
-
codeComplete(int, ICompletionRequestor)
instead.