| java.lang.Object org.eclipse.jdt.internal.codeassist.InternalCompletionProposal org.eclipse.jdt.core.CompletionProposal
CompletionProposal | final public class CompletionProposal extends InternalCompletionProposal (Code) | | Completion proposal.
In typical usage, the user working in a Java code editor issues
a code assist command. This command results in a call to
ICodeAssist.codeComplete(position, completionRequestor)
passing the current position in the source code. The code assist
engine analyzes the code in the buffer, determines what kind of
Java language construct is at that position, and proposes ways
to complete that construct. These proposals are instances of
the class CompletionProposal . These proposals,
perhaps after sorting and filtering, are presented to the user
to make a choice.
The proposal is as follows: insert
the
into the
source file buffer, replacing the characters between
and
. The string
can be arbitrary; for example, it might include not only the
name of a method but a set of parentheses. Moreover, the source
range may include source positions before or after the source
position where ICodeAssist.codeComplete was invoked.
The rest of the information associated with the proposal is
to provide context that may help a user to choose from among
competing proposals.
The completion engine creates instances of this class; it is not intended
to be instantiated or subclassed by clients.
See Also: ICodeAssist.codeComplete(intCompletionRequestor) since: 3.0 |
Field Summary | |
final public static int | ANNOTATION_ATTRIBUTE_REF Completion is a reference to annotation's attribute. | final public static int | ANONYMOUS_CLASS_DECLARATION Completion is a declaration of an anonymous class. | final public static int | FIELD_IMPORT Completion is an import of reference to a static field. | final public static int | FIELD_REF Completion is a reference to a field. | final protected static int | FIRST_KIND First valid completion kind. | final public static int | JAVADOC_BLOCK_TAG Completion is a javadoc block tag. | final public static int | JAVADOC_FIELD_REF Completion is a link reference to a field in a javadoc text. | final public static int | JAVADOC_INLINE_TAG Completion is a javadoc inline tag. | final public static int | JAVADOC_METHOD_REF Completion is a link reference to a method in a javadoc text. | final public static int | JAVADOC_PARAM_REF Completion is a method argument or a class/method type parameter
in javadoc param tag. | final public static int | JAVADOC_TYPE_REF Completion is a link reference to a type in a javadoc text. | final public static int | JAVADOC_VALUE_REF Completion is a value reference to a static field in a javadoc text. | final public static int | KEYWORD Completion is a keyword. | final public static int | LABEL_REF Completion is a reference to a label. | final protected static int | LAST_KIND Last valid completion kind. | final public static int | LOCAL_VARIABLE_REF Completion is a reference to a local variable. | final public static int | METHOD_DECLARATION Completion is a declaration of a method. | final public static int | METHOD_IMPORT Completion is an import of reference to a static method. | final public static int | METHOD_NAME_REFERENCE Completion is a reference to a method name. | final public static int | METHOD_REF Completion is a reference to a method. | final public static int | PACKAGE_REF Completion is a reference to a package. | final public static int | POTENTIAL_METHOD_DECLARATION Completion is a declaration of a new potential method. | final public static int | TYPE_IMPORT Completion is an import of reference to a type. | final public static int | TYPE_REF Completion is a reference to a type. | final public static int | VARIABLE_DECLARATION Completion is a declaration of a variable (locals, parameters,
fields, etc.). |
Constructor Summary | |
| CompletionProposal(int kind, int completionLocation) Creates a basic completion proposal. |
Method Summary | |
public static CompletionProposal | create(int kind, int completionOffset) Creates a basic completion proposal. | public char[][] | findParameterNames(IProgressMonitor monitor) Finds the method parameter names.
This information is relevant to method reference (and
method declaration proposals). | public int | getAccessibility() Returns the accessibility of the proposal. | public int | getAdditionalFlags() Returns the completion flags relevant in the context, or
CompletionFlags.Default if none.
This field is available for the following kinds of
completion proposals:
FIELD_IMPORT - completion flags
of the attribute that is referenced. | public char[] | getCompletion() Returns the proposed sequence of characters to insert into the
source file buffer, replacing the characters at the specified
source range. | public int | getCompletionLocation() Returns the character index in the source file buffer
where source completion was requested (the
offset parameter to
ICodeAssist.codeComplete minus one). | public char[] | getDeclarationKey() Returns the key of the relevant
declaration in the context, or null if none.
This field is available for the following kinds of
completion proposals:
ANONYMOUS_CLASS_DECLARATION - key
of the type that is being subclassed or implemented
METHOD_DECLARATION - key
of the type that declares the method that is being
implemented or overridden
For kinds of completion proposals, this method returns
null . | public char[] | getDeclarationSignature() Returns the type signature or package name of the relevant
declaration in the context, or null if none.
This field is available for the following kinds of
completion proposals:
ANNOTATION_ATTRIBUT_REF - type signature
of the annotation that declares the attribute that is referenced
ANONYMOUS_CLASS_DECLARATION - type signature
of the type that is being subclassed or implemented
FIELD_IMPORT - type signature
of the type that declares the field that is imported
FIELD_REF - type signature
of the type that declares the field that is referenced
METHOD_IMPORT - type signature
of the type that declares the method that is imported
METHOD_REF - type signature
of the type that declares the method that is referenced
METHOD_DECLARATION - type signature
of the type that declares the method that is being
implemented or overridden
PACKAGE_REF - dot-based package
name of the package that is referenced
TYPE_IMPORT - dot-based package
name of the package containing the type that is imported
TYPE_REF - dot-based package
name of the package containing the type that is referenced
POTENTIAL_METHOD_DECLARATION - type signature
of the type that declares the method that is being created
For kinds of completion proposals, this method returns
null . | public int | getFlags() Returns the modifier flags relevant in the context, or
Flags.AccDefault if none. | public char[] | getKey() Returns the key relevant in the context,
or null if none.
This field is available for the following kinds of
completion proposals:
ANONYMOUS_CLASS_DECLARATION - method key
of the constructor that is being invoked, or null if
the declaring type is an interface
METHOD_DECLARATION - method key
of the method that is being implemented or overridden
For kinds of completion proposals, this method returns
null . | public int | getKind() Returns the kind of completion being proposed.
The set of different kinds of completion proposals is
expected to change over time. | public char[] | getName() Returns the simple name of the method, field,
member, or variable relevant in the context, or
null if none.
This field is available for the following kinds of
completion proposals:
ANNOTATION_ATTRIBUT_REF - the name of the attribute
FIELD_IMPORT - the name of the field
FIELD_REF - the name of the field
KEYWORD - the keyword
LABEL_REF - the name of the label
LOCAL_VARIABLE_REF - the name of the local variable
METHOD_IMPORT - the name of the method
METHOD_REF - the name of the method (the type simple name for constructor)
METHOD_DECLARATION - the name of the method (the type simple name for constructor)
VARIABLE_DECLARATION - the name of the variable
POTENTIAL_METHOD_DECLARATION - the name of the method
For kinds of completion proposals, this method returns
null . | public int | getRelevance() Returns the relative relevance rating of this proposal. | public int | getReplaceEnd() Returns the character index of the end of the
subrange in the source file buffer to be replaced
by the completion string. | public int | getReplaceStart() Returns the character index of the start of the
subrange in the source file buffer to be replaced
by the completion string. | public CompletionProposal[] | getRequiredProposals() Returns the required completion proposals. | public char[] | getSignature() Returns the signature of the method or type
relevant in the context, or null if none.
This field is available for the following kinds of
completion proposals:
ANNOTATION_ATTRIBUT_REF - the type signature
of the referenced attribute's type
ANONYMOUS_CLASS_DECLARATION - method signature
of the constructor that is being invoked
FIELD_IMPORT - the type signature
of the referenced field's type
FIELD_REF - the type signature
of the referenced field's type
LOCAL_VARIABLE_REF - the type signature
of the referenced local variable's type
METHOD_IMPORT - method signature
of the method that is imported
METHOD_REF - method signature
of the method that is referenced
METHOD_DECLARATION - method signature
of the method that is being implemented or overridden
TYPE_IMPORT - type signature
of the type that is imported
TYPE_REF - type signature
of the type that is referenced
VARIABLE_DECLARATION - the type signature
of the type of the variable being declared
POTENTIAL_METHOD_DECLARATION - method signature
of the method that is being created
For kinds of completion proposals, this method returns
null . | public int | getTokenEnd() Returns the character index of the end (exclusive) of the subrange
in the source file buffer containing the
relevant token. | public int | getTokenStart() Returns the character index of the start of the
subrange in the source file buffer containing the
relevant token being completed. | public boolean | isConstructor() Returns whether this proposal is a constructor. | public void | setAdditionalFlags(int additionalFlags) Sets the completion flags relevant in the context. | public void | setCompletion(char[] completion) Sets the proposed sequence of characters to insert into the
source file buffer, replacing the characters at the specified
source range. | public void | setDeclarationKey(char[] key) Sets the type or package key of the relevant
declaration in the context, or null if none. | public void | setDeclarationSignature(char[] signature) Sets the type or package signature of the relevant
declaration in the context, or null if none. | public void | setFlags(int flags) Sets the modifier flags relevant in the context. | public void | setKey(char[] key) Sets the key of the method, field type, member type,
relevant in the context, or null if none. | public void | setName(char[] name) Sets the simple name of the method (type simple name for constructor), field,
member, or variable relevant in the context, or
null if none. | public void | setParameterNames(char[][] parameterNames) Sets the method parameter names. | public void | setRelevance(int rating) Sets the relative relevance rating of this proposal. | public void | setReplaceRange(int startIndex, int endIndex) Sets the character indices of the subrange in the
source file buffer to be replaced by the completion
string. | public void | setRequiredProposals(CompletionProposal[] proposals) Sets the list of required completion proposals, or null if none. | public void | setSignature(char[] signature) Sets the signature of the method, field type, member type,
relevant in the context, or null if none. | public void | setTokenRange(int startIndex, int endIndex) Sets the character indices of the subrange in the
source file buffer containing the relevant token being
completed. | public String | toString() |
ANNOTATION_ATTRIBUTE_REF | final public static int ANNOTATION_ATTRIBUTE_REF(Code) | | Completion is a reference to annotation's attribute.
This kind of completion might occur in a context like
"@Annot(attr^=value)" and complete it to
"@Annot(attribute^=value)" .
The following additional context information is available
for this kind of completion proposal at little extra cost:
See Also: CompletionProposal.getKind() since: 3.1 |
ANONYMOUS_CLASS_DECLARATION | final public static int ANONYMOUS_CLASS_DECLARATION(Code) | | Completion is a declaration of an anonymous class.
This kind of completion might occur in a context like
"new List^;" and complete it to
"new List() {}" .
The following additional context information is available
for this kind of completion proposal at little extra cost:
See Also: CompletionProposal.getKind() |
FIELD_IMPORT | final public static int FIELD_IMPORT(Code) | | Completion is an import of reference to a static field.
The following additional context information is available
for this kind of completion proposal at little extra cost:
See Also: CompletionProposal.getKind() since: 3.3 |
FIELD_REF | final public static int FIELD_REF(Code) | | Completion is a reference to a field.
This kind of completion might occur in a context like
"this.ref^ = 0;" and complete it to
"this.refcount = 0;" .
The following additional context information is available
for this kind of completion proposal at little extra cost:
See Also: CompletionProposal.getKind() |
FIRST_KIND | final protected static int FIRST_KIND(Code) | | First valid completion kind.
since: 3.1 |
JAVADOC_BLOCK_TAG | final public static int JAVADOC_BLOCK_TAG(Code) | | Completion is a javadoc block tag.
This kind of completion might occur in a context like
" * @s^ blabla" and complete it to
" * @see blabla" .
The following additional context information is available
for this kind of completion proposal at little extra cost:
See Also: CompletionProposal.getKind() since: 3.2 |
JAVADOC_FIELD_REF | final public static int JAVADOC_FIELD_REF(Code) | | Completion is a link reference to a field in a javadoc text.
This kind of completion might occur in a context like
" * blabla System.o^ blabla" and complete it to
" * blabla {@link System#out } blabla" .
The following additional context information is available
for this kind of completion proposal at little extra cost:
See Also: CompletionProposal.getKind() since: 3.2 |
JAVADOC_INLINE_TAG | final public static int JAVADOC_INLINE_TAG(Code) | | Completion is a javadoc inline tag.
This kind of completion might occur in a context like
" * Insert @l^ Object" and complete it to
" * Insert {@link Object }" .
The following additional context information is available
for this kind of completion proposal at little extra cost:
See Also: CompletionProposal.getKind() since: 3.2 |
JAVADOC_METHOD_REF | final public static int JAVADOC_METHOD_REF(Code) | | Completion is a link reference to a method in a javadoc text.
This kind of completion might occur in a context like
" * blabla Runtime#get^ blabla" and complete it to
" * blabla {@link Runtime#getRuntime() }" .
The following additional context information is available
for this kind of completion proposal at little extra cost:
See Also: CompletionProposal.getKind() since: 3.2 |
JAVADOC_PARAM_REF | final public static int JAVADOC_PARAM_REF(Code) | | Completion is a method argument or a class/method type parameter
in javadoc param tag.
This kind of completion might occur in a context like
" * @param arg^ blabla" and complete it to
" * @param argument blabla" .
or
" * @param <T^ blabla" and complete it to
" * @param <TT> blabla" .
The following additional context information is available
for this kind of completion proposal at little extra cost:
See Also: CompletionProposal.getKind() since: 3.2 |
JAVADOC_TYPE_REF | final public static int JAVADOC_TYPE_REF(Code) | | Completion is a link reference to a type in a javadoc text.
Any kind of type is allowed, including primitive types, reference types,
array types, parameterized types, and type variables.
This kind of completion might occur in a context like
" * blabla Str^ blabla" and complete it to
" * blabla {@link String } blabla" .
The following additional context information is available
for this kind of completion proposal at little extra cost:
See Also: CompletionProposal.getKind() since: 3.2 |
JAVADOC_VALUE_REF | final public static int JAVADOC_VALUE_REF(Code) | | Completion is a value reference to a static field in a javadoc text.
This kind of completion might occur in a context like
" * blabla System.o^ blabla" and complete it to
" * blabla {@value System#out } blabla" .
The following additional context information is available
for this kind of completion proposal at little extra cost:
See Also: CompletionProposal.getKind() since: 3.2 |
KEYWORD | final public static int KEYWORD(Code) | | Completion is a keyword.
This kind of completion might occur in a context like
"public cl^ Foo {}" and complete it to
"public class Foo {}" .
The following additional context information is available
for this kind of completion proposal at little extra cost:
See Also: CompletionProposal.getKind() |
LABEL_REF | final public static int LABEL_REF(Code) | | Completion is a reference to a label.
This kind of completion might occur in a context like
"break lo^;" and complete it to
"break loop;" .
The following additional context information is available
for this kind of completion proposal at little extra cost:
See Also: CompletionProposal.getKind() |
LAST_KIND | final protected static int LAST_KIND(Code) | | Last valid completion kind.
since: 3.1 |
LOCAL_VARIABLE_REF | final public static int LOCAL_VARIABLE_REF(Code) | | Completion is a reference to a local variable.
This kind of completion might occur in a context like
"ke^ = 4;" and complete it to
"keys = 4;" .
The following additional context information is available
for this kind of completion proposal at little extra cost:
See Also: CompletionProposal.getKind() |
METHOD_DECLARATION | final public static int METHOD_DECLARATION(Code) | | Completion is a declaration of a method.
This kind of completion might occur in a context like
"new List() {si^};" and complete it to
"new List() {public int size() {} };" .
The following additional context information is available
for this kind of completion proposal at little extra cost:
See Also: CompletionProposal.getKind() |
METHOD_IMPORT | final public static int METHOD_IMPORT(Code) | | Completion is an import of reference to a static method.
The following additional context information is available
for this kind of completion proposal at little extra cost:
See Also: CompletionProposal.getKind() since: 3.3 |
METHOD_NAME_REFERENCE | final public static int METHOD_NAME_REFERENCE(Code) | | Completion is a reference to a method name.
This kind of completion might occur in a context like
"import p.X.fo^" and complete it to
"import p.X.foo;" .
The following additional context information is available
for this kind of completion proposal at little extra cost:
See Also: CompletionProposal.getKind() since: 3.1 |
METHOD_REF | final public static int METHOD_REF(Code) | | Completion is a reference to a method.
This kind of completion might occur in a context like
"System.out.pr^();" and complete it to
""System.out.println();" .
The following additional context information is available
for this kind of completion proposal at little extra cost:
See Also: CompletionProposal.getKind() |
PACKAGE_REF | final public static int PACKAGE_REF(Code) | | Completion is a reference to a package.
This kind of completion might occur in a context like
"import java.u^.*;" and complete it to
"import java.util.*;" .
The following additional context information is available
for this kind of completion proposal at little extra cost:
See Also: CompletionProposal.getKind() |
POTENTIAL_METHOD_DECLARATION | final public static int POTENTIAL_METHOD_DECLARATION(Code) | | Completion is a declaration of a new potential method.
This kind of completion might occur in a context like
"new List() {si^};" and complete it to
"new List() {public int si() {} };" .
The following additional context information is available
for this kind of completion proposal at little extra cost:
See Also: CompletionProposal.getKind() since: 3.1 |
TYPE_IMPORT | final public static int TYPE_IMPORT(Code) | | Completion is an import of reference to a type.
Only reference to reference types are allowed.
The following additional context information is available
for this kind of completion proposal at little extra cost:
See Also: CompletionProposal.getKind() since: 3.3 |
TYPE_REF | final public static int TYPE_REF(Code) | | Completion is a reference to a type. Any kind of type
is allowed, including primitive types, reference types,
array types, parameterized types, and type variables.
This kind of completion might occur in a context like
"public static Str^ key;" and complete it to
"public static String key;" .
The following additional context information is available
for this kind of completion proposal at little extra cost:
See Also: CompletionProposal.getKind() |
VARIABLE_DECLARATION | final public static int VARIABLE_DECLARATION(Code) | | Completion is a declaration of a variable (locals, parameters,
fields, etc.).
The following additional context information is available
for this kind of completion proposal at little extra cost:
See Also: CompletionProposal.getKind() |
CompletionProposal | CompletionProposal(int kind, int completionLocation)(Code) | | Creates a basic completion proposal. All instance
field have plausible default values unless otherwise noted.
Note that the constructors for this class are internal to the
Java model implementation. Clients cannot directly create
CompletionProposal objects.
Parameters: kind - one of the kind constants declared on this class Parameters: completionLocation - original offset of code completion request |
create | public static CompletionProposal create(int kind, int completionOffset)(Code) | | Creates a basic completion proposal. All instance
field have plausible default values unless otherwise noted.
Note that the constructors for this class are internal to the
Java model implementation. Clients cannot directly create
CompletionProposal objects.
Parameters: kind - one of the kind constants declared on this class Parameters: completionOffset - original offset of code completion request a new completion proposal |
findParameterNames | public char[][] findParameterNames(IProgressMonitor monitor)(Code) | | Finds the method parameter names.
This information is relevant to method reference (and
method declaration proposals). Returns null
if not available or not relevant.
The client must not modify the array returned.
Note that this is an expensive thing to compute, which may require
parsing Java source files, etc. Use sparingly.
Parameters: monitor - the progress monitor, or null if none the parameter names, or null if noneor not available or not relevant |
getAdditionalFlags | public int getAdditionalFlags()(Code) | | Returns the completion flags relevant in the context, or
CompletionFlags.Default if none.
This field is available for the following kinds of
completion proposals:
FIELD_IMPORT - completion flags
of the attribute that is referenced. Completion flags for
this proposal kind can only include CompletionFlags.StaticImport
METHOD_IMPORT - completion flags
of the attribute that is referenced. Completion flags for
this proposal kind can only include CompletionFlags.StaticImport
TYPE_IMPORT - completion flags
of the attribute that is referenced. Completion flags for
this proposal kind can only include CompletionFlags.StaticImport
For other kinds of completion proposals, this method returns
CompletionFlags.Default .
the completion flags, orCompletionFlags.Default if none See Also: CompletionFlags since: 3.3 |
getCompletion | public char[] getCompletion()(Code) | | Returns the proposed sequence of characters to insert into the
source file buffer, replacing the characters at the specified
source range. The string can be arbitrary; for example, it might
include not only the name of a method but a set of parentheses.
The client must not modify the array returned.
the completion string |
getCompletionLocation | public int getCompletionLocation()(Code) | | Returns the character index in the source file buffer
where source completion was requested (the
offset parameter to
ICodeAssist.codeComplete minus one).
character index in source file buffer See Also: ICodeAssist.codeComplete(intCompletionRequestor) |
getDeclarationKey | public char[] getDeclarationKey()(Code) | | Returns the key of the relevant
declaration in the context, or null if none.
This field is available for the following kinds of
completion proposals:
ANONYMOUS_CLASS_DECLARATION - key
of the type that is being subclassed or implemented
METHOD_DECLARATION - key
of the type that declares the method that is being
implemented or overridden
For kinds of completion proposals, this method returns
null . Clients must not modify the array
returned.
a key, or null if none See Also: org.eclipse.jdt.core.dom.ASTParser.createASTs(ICompilationUnit[]String[]org.eclipse.jdt.core.dom.ASTRequestorIProgressMonitor) since: 3.1 |
getDeclarationSignature | public char[] getDeclarationSignature()(Code) | | Returns the type signature or package name of the relevant
declaration in the context, or null if none.
This field is available for the following kinds of
completion proposals:
ANNOTATION_ATTRIBUT_REF - type signature
of the annotation that declares the attribute that is referenced
ANONYMOUS_CLASS_DECLARATION - type signature
of the type that is being subclassed or implemented
FIELD_IMPORT - type signature
of the type that declares the field that is imported
FIELD_REF - type signature
of the type that declares the field that is referenced
METHOD_IMPORT - type signature
of the type that declares the method that is imported
METHOD_REF - type signature
of the type that declares the method that is referenced
METHOD_DECLARATION - type signature
of the type that declares the method that is being
implemented or overridden
PACKAGE_REF - dot-based package
name of the package that is referenced
TYPE_IMPORT - dot-based package
name of the package containing the type that is imported
TYPE_REF - dot-based package
name of the package containing the type that is referenced
POTENTIAL_METHOD_DECLARATION - type signature
of the type that declares the method that is being created
For kinds of completion proposals, this method returns
null . Clients must not modify the array
returned.
a type signature or a package name (dependingon the kind of completion), or null if none See Also: Signature |
getFlags | public int getFlags()(Code) | | Returns the modifier flags relevant in the context, or
Flags.AccDefault if none.
This field is available for the following kinds of
completion proposals:
ANNOTATION_ATTRIBUT_REF - modifier flags
of the attribute that is referenced;
ANONYMOUS_CLASS_DECLARATION - modifier flags
of the constructor that is referenced
FIELD_IMPORT - modifier flags
of the field that is imported.
FIELD_REF - modifier flags
of the field that is referenced;
Flags.AccEnum can be used to recognize
references to enum constants
KEYWORD - modifier flag
corresponding to the modifier keyword
LOCAL_VARIABLE_REF - modifier flags
of the local variable that is referenced
METHOD_IMPORT - modifier flags
of the method that is imported;
METHOD_REF - modifier flags
of the method that is referenced;
Flags.AccAnnotation can be used to recognize
references to annotation type members
METHOD_DECLARATION - modifier flags
for the method that is being implemented or overridden
TYPE_IMPORT - modifier flags
of the type that is imported; Flags.AccInterface
can be used to recognize references to interfaces,
Flags.AccEnum enum types,
and Flags.AccAnnotation annotation types
TYPE_REF - modifier flags
of the type that is referenced; Flags.AccInterface
can be used to recognize references to interfaces,
Flags.AccEnum enum types,
and Flags.AccAnnotation annotation types
VARIABLE_DECLARATION - modifier flags
for the variable being declared
POTENTIAL_METHOD_DECLARATION - modifier flags
for the method that is being created
For other kinds of completion proposals, this method returns
Flags.AccDefault .
the modifier flags, orFlags.AccDefault if none See Also: Flags |
getKind | public int getKind()(Code) | | Returns the kind of completion being proposed.
The set of different kinds of completion proposals is
expected to change over time. It is strongly recommended
that clients do not assume that the kind is one of the
ones they know about, and code defensively for the
possibility of unexpected future growth.
the kind; one of the kind constantsdeclared on this class, or possibly a kind unknownto the caller |
getName | public char[] getName()(Code) | | Returns the simple name of the method, field,
member, or variable relevant in the context, or
null if none.
This field is available for the following kinds of
completion proposals:
ANNOTATION_ATTRIBUT_REF - the name of the attribute
FIELD_IMPORT - the name of the field
FIELD_REF - the name of the field
KEYWORD - the keyword
LABEL_REF - the name of the label
LOCAL_VARIABLE_REF - the name of the local variable
METHOD_IMPORT - the name of the method
METHOD_REF - the name of the method (the type simple name for constructor)
METHOD_DECLARATION - the name of the method (the type simple name for constructor)
VARIABLE_DECLARATION - the name of the variable
POTENTIAL_METHOD_DECLARATION - the name of the method
For kinds of completion proposals, this method returns
null . Clients must not modify the array
returned.
the keyword, field, method, local variable, or membername, or null if none |
getRelevance | public int getRelevance()(Code) | | Returns the relative relevance rating of this proposal.
relevance rating of this proposal; ratings are positive; higher means better |
getReplaceEnd | public int getReplaceEnd()(Code) | | Returns the character index of the end of the
subrange in the source file buffer to be replaced
by the completion string. If the subrange is empty
(getReplaceEnd() == getReplaceStart() ),
the completion string is to be inserted at this
index.
replacement end position (exclusive) |
getReplaceStart | public int getReplaceStart()(Code) | | Returns the character index of the start of the
subrange in the source file buffer to be replaced
by the completion string. If the subrange is empty
(getReplaceEnd() == getReplaceStart() ),
the completion string is to be inserted at this
index.
Note that while the token subrange is precisely
specified, the replacement range is loosely
constrained and may not bear any direct relation
to the original request offset. For example,
it would be possible for a type completion to
propose inserting an import declaration at the
top of the compilation unit; or the completion
might include trailing parentheses and
punctuation for a method completion.
replacement start position (inclusive) |
getRequiredProposals | public CompletionProposal[] getRequiredProposals()(Code) | | Returns the required completion proposals.
The proposal can be apply only if these required completion proposals are also applied.
If the required proposal aren't applied the completion could create completion problems.
This field is available for the following kinds of
completion proposals:
FIELD_REF - The allowed required proposals for this kind are:
TYPE_REF
TYPE_IMPORT
FIELD_IMPORT
METHOD_REF - The allowed required proposals for this kind are:
TYPE_REF
TYPE_IMPORT
METHOD_IMPORT
Other kinds of required proposals will be returned in the future, therefore clients of this
API must allow with
CompletionRequestor.setAllowsRequiredProposals(intintboolean)
only kinds which are in this list to avoid unexpected results in the future.
A required completion proposal cannot have required completion proposals.
the required completion proposals, or null if none. See Also: CompletionRequestor.setAllowsRequiredProposals(intintboolean) since: 3.3 |
getSignature | public char[] getSignature()(Code) | | Returns the signature of the method or type
relevant in the context, or null if none.
This field is available for the following kinds of
completion proposals:
ANNOTATION_ATTRIBUT_REF - the type signature
of the referenced attribute's type
ANONYMOUS_CLASS_DECLARATION - method signature
of the constructor that is being invoked
FIELD_IMPORT - the type signature
of the referenced field's type
FIELD_REF - the type signature
of the referenced field's type
LOCAL_VARIABLE_REF - the type signature
of the referenced local variable's type
METHOD_IMPORT - method signature
of the method that is imported
METHOD_REF - method signature
of the method that is referenced
METHOD_DECLARATION - method signature
of the method that is being implemented or overridden
TYPE_IMPORT - type signature
of the type that is imported
TYPE_REF - type signature
of the type that is referenced
VARIABLE_DECLARATION - the type signature
of the type of the variable being declared
POTENTIAL_METHOD_DECLARATION - method signature
of the method that is being created
For kinds of completion proposals, this method returns
null . Clients must not modify the array
returned.
the signature, or null if none See Also: Signature |
getTokenEnd | public int getTokenEnd()(Code) | | Returns the character index of the end (exclusive) of the subrange
in the source file buffer containing the
relevant token. When there is no relevant token, the
range is empty
(getEndToken() == getStartToken() ).
character index of token end position (exclusive) |
getTokenStart | public int getTokenStart()(Code) | | Returns the character index of the start of the
subrange in the source file buffer containing the
relevant token being completed. This
token is either the identifier or Java language keyword
under, or immediately preceding, the original request
offset. If the original request offset is not within
or immediately after an identifier or keyword, then the
position returned is original request offset and the
token range is empty.
character index of token start position (inclusive) |
isConstructor | public boolean isConstructor()(Code) | | Returns whether this proposal is a constructor.
This field is available for the following kinds of
completion proposals:
METHOD_REF - return true
if the referenced method is a constructor
METHOD_DECLARATION - return true
if the declared method is a constructor
For kinds of completion proposals, this method returns
false .
true if the proposal is a constructor. since: 3.1 |
setAdditionalFlags | public void setAdditionalFlags(int additionalFlags)(Code) | | Sets the completion flags relevant in the context.
If not set, defaults to none.
The completion engine creates instances of this class and sets
its properties; this method is not intended to be used by other clients.
Parameters: additionalFlags - the completion flags, orCompletionFlags.Default if none since: 3.3 |
setCompletion | public void setCompletion(char[] completion)(Code) | | Sets the proposed sequence of characters to insert into the
source file buffer, replacing the characters at the specified
source range. The string can be arbitrary; for example, it might
include not only the name of a method but a set of parentheses.
If not set, defaults to an empty character array.
The completion engine creates instances of this class and sets
its properties; this method is not intended to be used by other clients.
Parameters: completion - the completion string |
setDeclarationKey | public void setDeclarationKey(char[] key)(Code) | | Sets the type or package key of the relevant
declaration in the context, or null if none.
If not set, defaults to none.
The completion engine creates instances of this class and sets
its properties; this method is not intended to be used by other clients.
Parameters: key - the type or package key, ornull if none since: 3.1 |
setDeclarationSignature | public void setDeclarationSignature(char[] signature)(Code) | | Sets the type or package signature of the relevant
declaration in the context, or null if none.
If not set, defaults to none.
The completion engine creates instances of this class and sets
its properties; this method is not intended to be used by other clients.
Parameters: signature - the type or package signature, ornull if none |
setFlags | public void setFlags(int flags)(Code) | | Sets the modifier flags relevant in the context.
If not set, defaults to none.
The completion engine creates instances of this class and sets
its properties; this method is not intended to be used by other clients.
Parameters: flags - the modifier flags, orFlags.AccDefault if none |
setKey | public void setKey(char[] key)(Code) | | Sets the key of the method, field type, member type,
relevant in the context, or null if none.
If not set, defaults to none.
The completion engine creates instances of this class and sets
its properties; this method is not intended to be used by other clients.
Parameters: key - the key, or null if none since: 3.1 |
setName | public void setName(char[] name)(Code) | | Sets the simple name of the method (type simple name for constructor), field,
member, or variable relevant in the context, or
null if none.
If not set, defaults to none.
The completion engine creates instances of this class and sets
its properties; this method is not intended to be used by other clients.
Parameters: name - the keyword, field, method, local variable,or member name, or null if none |
setParameterNames | public void setParameterNames(char[][] parameterNames)(Code) | | Sets the method parameter names.
This information is relevant to method reference (and
method declaration proposals).
The completion engine creates instances of this class and sets
its properties; this method is not intended to be used by other clients.
Parameters: parameterNames - the parameter names, or null if none |
setRelevance | public void setRelevance(int rating)(Code) | | Sets the relative relevance rating of this proposal.
If not set, defaults to the lowest possible rating (1).
The completion engine creates instances of this class and sets
its properties; this method is not intended to be used by other clients.
Parameters: rating - relevance rating of this proposal; ratings are positive; higher means better |
setReplaceRange | public void setReplaceRange(int startIndex, int endIndex)(Code) | | Sets the character indices of the subrange in the
source file buffer to be replaced by the completion
string. If the subrange is empty
(startIndex == endIndex ),
the completion string is to be inserted at this
index.
If not set, defaults to empty subrange at [0,0).
The completion engine creates instances of this class and sets
its properties; this method is not intended to be used by other clients.
Parameters: startIndex - character index of replacement start position (inclusive) Parameters: endIndex - character index of replacement end position (exclusive) |
setRequiredProposals | public void setRequiredProposals(CompletionProposal[] proposals)(Code) | | Sets the list of required completion proposals, or null if none.
If not set, defaults to none.
The completion engine creates instances of this class and sets
its properties; this method is not intended to be used by other clients.
Parameters: proposals - the list of required completion proposals, ornull if none since: 3.3 |
setSignature | public void setSignature(char[] signature)(Code) | | Sets the signature of the method, field type, member type,
relevant in the context, or null if none.
If not set, defaults to none.
The completion engine creates instances of this class and sets
its properties; this method is not intended to be used by other clients.
Parameters: signature - the signature, or null if none |
setTokenRange | public void setTokenRange(int startIndex, int endIndex)(Code) | | Sets the character indices of the subrange in the
source file buffer containing the relevant token being
completed. This token is either the identifier or
Java language keyword under, or immediately preceding,
the original request offset. If the original request
offset is not within or immediately after an identifier
or keyword, then the source range begins at original
request offset and is empty.
If not set, defaults to empty subrange at [0,0).
Parameters: startIndex - character index of token start position (inclusive) Parameters: endIndex - character index of token end position (exclusive) |
|
|