Java Doc for CompletionProposal.java in  » IDE-Eclipse » jdt » org » eclipse » jdt » core » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » IDE Eclipse » jdt » org.eclipse.jdt.core 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


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  intANNOTATION_ATTRIBUTE_REF
     Completion is a reference to annotation's attribute.
final public static  intANONYMOUS_CLASS_DECLARATION
     Completion is a declaration of an anonymous class.
final public static  intFIELD_IMPORT
     Completion is an import of reference to a static field.
final public static  intFIELD_REF
     Completion is a reference to a field.
final protected static  intFIRST_KIND
     First valid completion kind.
final public static  intJAVADOC_BLOCK_TAG
     Completion is a javadoc block tag.
final public static  intJAVADOC_FIELD_REF
     Completion is a link reference to a field in a javadoc text.
final public static  intJAVADOC_INLINE_TAG
     Completion is a javadoc inline tag.
final public static  intJAVADOC_METHOD_REF
     Completion is a link reference to a method in a javadoc text.
final public static  intJAVADOC_PARAM_REF
     Completion is a method argument or a class/method type parameter in javadoc param tag.
final public static  intJAVADOC_TYPE_REF
     Completion is a link reference to a type in a javadoc text.
final public static  intJAVADOC_VALUE_REF
     Completion is a value reference to a static field in a javadoc text.
final public static  intKEYWORD
     Completion is a keyword.
final public static  intLABEL_REF
     Completion is a reference to a label.
final protected static  intLAST_KIND
     Last valid completion kind.
final public static  intLOCAL_VARIABLE_REF
     Completion is a reference to a local variable.
final public static  intMETHOD_DECLARATION
     Completion is a declaration of a method.
final public static  intMETHOD_IMPORT
     Completion is an import of reference to a static method.
final public static  intMETHOD_NAME_REFERENCE
     Completion is a reference to a method name.
final public static  intMETHOD_REF
     Completion is a reference to a method.
final public static  intPACKAGE_REF
     Completion is a reference to a package.
final public static  intPOTENTIAL_METHOD_DECLARATION
     Completion is a declaration of a new potential method.
final public static  intTYPE_IMPORT
     Completion is an import of reference to a type.
final public static  intTYPE_REF
     Completion is a reference to a type.
final public static  intVARIABLE_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  CompletionProposalcreate(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  intgetAccessibility()
     Returns the accessibility of the proposal.
public  intgetAdditionalFlags()
     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  intgetCompletionLocation()
     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  intgetFlags()
     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  intgetKind()
     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  intgetRelevance()
     Returns the relative relevance rating of this proposal.
public  intgetReplaceEnd()
     Returns the character index of the end of the subrange in the source file buffer to be replaced by the completion string.
public  intgetReplaceStart()
     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  intgetTokenEnd()
     Returns the character index of the end (exclusive) of the subrange in the source file buffer containing the relevant token.
public  intgetTokenStart()
     Returns the character index of the start of the subrange in the source file buffer containing the relevant token being completed.
public  booleanisConstructor()
     Returns whether this proposal is a constructor.
public  voidsetAdditionalFlags(int additionalFlags)
     Sets the completion flags relevant in the context.
public  voidsetCompletion(char[] completion)
     Sets the proposed sequence of characters to insert into the source file buffer, replacing the characters at the specified source range.
public  voidsetDeclarationKey(char[] key)
     Sets the type or package key of the relevant declaration in the context, or null if none.
public  voidsetDeclarationSignature(char[] signature)
     Sets the type or package signature of the relevant declaration in the context, or null if none.
public  voidsetFlags(int flags)
     Sets the modifier flags relevant in the context.
public  voidsetKey(char[] key)
     Sets the key of the method, field type, member type, relevant in the context, or null if none.
public  voidsetName(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  voidsetParameterNames(char[][] parameterNames)
     Sets the method parameter names.
public  voidsetRelevance(int rating)
     Sets the relative relevance rating of this proposal.
public  voidsetReplaceRange(int startIndex, int endIndex)
     Sets the character indices of the subrange in the source file buffer to be replaced by the completion string.
public  voidsetRequiredProposals(CompletionProposal[] proposals)
     Sets the list of required completion proposals, or null if none.
public  voidsetSignature(char[] signature)
     Sets the signature of the method, field type, member type, relevant in the context, or null if none.
public  voidsetTokenRange(int startIndex, int endIndex)
     Sets the character indices of the subrange in the source file buffer containing the relevant token being completed.
public  StringtoString()
    

Field Detail
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()




Constructor Detail
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




Method Detail
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



getAccessibility
public int getAccessibility()(Code)
Returns the accessibility of the proposal.

This field is available for the following kinds of completion proposals:

  • TYPE_REF - accessibility of the type
For these kinds of completion proposals, this method returns IAccessRule.K_ACCESSIBLE or IAccessRule.K_DISCOURAGED or IAccessRule.K_NON_ACCESSIBLE . By default this method return IAccessRule.K_ACCESSIBLE .


See Also:   IAccessRule the accessibility of the proposal
since:
   3.1



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



getKey
public char[] getKey()(Code)
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. Clients must not modify the array returned.

the 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



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)



toString
public String toString()(Code)



Fields inherited from org.eclipse.jdt.internal.codeassist.InternalCompletionProposal
protected int accessibility(Code)(Java Doc)
protected CompletionEngine completionEngine(Code)(Java Doc)
protected char[] declarationPackageName(Code)(Java Doc)
protected char[] declarationTypeName(Code)(Java Doc)
protected boolean isConstructor(Code)(Java Doc)
protected NameLookup nameLookup(Code)(Java Doc)
protected char[] originalSignature(Code)(Java Doc)
protected char[] packageName(Code)(Java Doc)
protected char[][] parameterPackageNames(Code)(Java Doc)
protected char[][] parameterTypeNames(Code)(Java Doc)
protected char[] typeName(Code)(Java Doc)

Methods inherited from org.eclipse.jdt.internal.codeassist.InternalCompletionProposal
protected char[][] createDefaultParameterNames(int length)(Code)(Java Doc)
protected char[][] findMethodParameterNames(char[] declaringTypePackageName, char[] declaringTypeName, char[] selector, char[][] paramTypeNames)(Code)(Java Doc)
protected char[] getDeclarationPackageName()(Code)(Java Doc)
protected char[] getDeclarationTypeName()(Code)(Java Doc)
protected char[] getPackageName()(Code)(Java Doc)
protected char[][] getParameterPackageNames()(Code)(Java Doc)
protected char[][] getParameterTypeNames()(Code)(Java Doc)
protected char[] getTypeName()(Code)(Java Doc)
protected void setAccessibility(int kind)(Code)(Java Doc)
protected void setDeclarationPackageName(char[] declarationPackageName)(Code)(Java Doc)
protected void setDeclarationTypeName(char[] declarationTypeName)(Code)(Java Doc)
protected void setIsContructor(boolean isConstructor)(Code)(Java Doc)
public void setOriginalSignature(char[] originalSignature)(Code)(Java Doc)
protected void setPackageName(char[] packageName)(Code)(Java Doc)
protected void setParameterPackageNames(char[][] parameterPackageNames)(Code)(Java Doc)
protected void setParameterTypeNames(char[][] parameterTypeNames)(Code)(Java Doc)
protected void setTypeName(char[] typeName)(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.