Eclipse JDT
2.0

org.eclipse.jdt.core
Interface ICodeAssist

All Known Subinterfaces:
IClassFile, ICompilationUnit

public interface ICodeAssist

Common protocol for Java elements that support source code assist and code resolve.

This interface is not intended to be implemented by clients.


Method Summary
 void codeComplete(int offset, ICodeCompletionRequestor requestor)
          Deprecated. - use codeComplete(int, ICompletionRequestor) instead
 void codeComplete(int offset, ICompletionRequestor requestor)
          Performs code completion at the given offset position in this compilation unit, reporting results to the given completion requestor.
 IJavaElement[] codeSelect(int offset, int length)
          Performs code selection on the given selected text in this compilation unit, reporting results to the given selection requestor.
 

Method Detail

codeComplete

public void codeComplete(int offset,
                         ICompletionRequestor requestor)
                  throws JavaModelException
Performs code completion at the given offset position in this compilation unit, reporting results to the given completion requestor. The offset is the 0-based index of the character, after which code assist is desired. An offset of -1 indicates to code assist at the beginning of this compilation unit.

Parameters:
offset - the given offset position
requestor - the given completion requestor
Throws:
JavaModelException - if code assist could not be performed. Reasons include:
  • This Java element does not exist (ELEMENT_DOES_NOT_EXIST)
  • The position specified is < -1 or is greater than this compilation unit's source length (INDEX_OUT_OF_BOUNDS)
IllegalArgumentException - if requestor is null
Since:
2.0

codeSelect

public IJavaElement[] codeSelect(int offset,
                                 int length)
                          throws JavaModelException
Performs code selection on the given selected text in this compilation unit, reporting results to the given selection requestor. The offset is the 0-based index of the first selected character. The length is the number of selected characters.

Parameters:
offset - the given offset position
length - the number of selected characters
Throws:
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)

  • codeComplete

    public void codeComplete(int offset,
                             ICodeCompletionRequestor requestor)
                      throws JavaModelException
    Deprecated. - use codeComplete(int, ICompletionRequestor) instead

    Performs code completion at the given offset position in this compilation unit, reporting results to the given completion requestor. The offset is the 0-based index of the character, after which code assist is desired. An offset of -1 indicates to code assist at the beginning of this compilation unit.

    Parameters:
    offset - the given offset position
    requestor - the given completion requestor
    Throws:
    JavaModelException - if code assist could not be performed. Reasons include:
    • This Java element does not exist (ELEMENT_DOES_NOT_EXIST)
    • The position specified is < -1 or is greater than this compilation unit's source length (INDEX_OUT_OF_BOUNDS)
    IllegalArgumentException - if requestor is null

    Eclipse JDT
    2.0

    Copyright (c) IBM Corp. and others 2000, 2002. All Rights Reserved.