Eclipse Platform
2.0

org.eclipse.jface.text.contentassist
Interface ICompletionProposalExtension


public interface ICompletionProposalExtension

Extension interface to ICompletionProposal. Add the following functions:

* @since 2.0


Method Summary
 void apply(IDocument document, char trigger, int offset)
          Applies the proposed completion to the given document.
 int getContextInformationPosition()
          Returns the position to which the computed context information refers to or -1 if no context information can be provided by this completion proposal.
 char[] getTriggerCharacters()
          Returns the characters which trigger the application of this completion proposal.
 boolean isValidFor(IDocument document, int offset)
          Returns whether this completion proposal is valid for the given position in the given document.
 

Method Detail

apply

public void apply(IDocument document,
                  char trigger,
                  int offset)
Applies the proposed completion to the given document. The insertion has been triggered by entering the given character at the given offset. This method assumes that isValidFor returns true if called for offset.

Parameters:
document - the document into which to insert the proposed completion
trigger - the trigger to apply the completion
offset - the offset at which the trigger has been activated

isValidFor

public boolean isValidFor(IDocument document,
                          int offset)
Returns whether this completion proposal is valid for the given position in the given document.

Parameters:
document - the document for which the proposal is tested
offset - the offset for which the proposal is tested

getTriggerCharacters

public char[] getTriggerCharacters()
Returns the characters which trigger the application of this completion proposal.

Returns:
the completion characters for this completion proposal or null if no completion other than the new line character is possible

getContextInformationPosition

public int getContextInformationPosition()
Returns the position to which the computed context information refers to or -1 if no context information can be provided by this completion proposal.

Returns:
the position to which the context information refers to or -1 for no information

Eclipse Platform
2.0

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