LPEX
4.4.0

com.ibm.lpex.alef.contentassist
Interface ICompletionProposalExtension


public interface ICompletionProposalExtension

Extends ICompletionProposal with the following functions:

This is the LPEX version of org.eclipse.jface.text.contentassist.ICompletionProposalExtension. It has different apply() and isValidFor() methods.


Method Summary
 void apply(ITextViewer textViewer, char trigger, int offset)
          Apply the proposed completion to the document of the specified LpexTextViewer.
 int getContextInformationPosition()
          Return 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()
          Return the characters which trigger the application of this completion proposal.
 boolean isValidFor(ITextViewer textViewer, LpexDocumentLocation location)
          Return whether this completion proposal is valid for the given position in the given document.
 

Method Detail

apply

void apply(ITextViewer textViewer,
           char trigger,
           int offset)
Apply the proposed completion to the document of the specified LpexTextViewer. The insertion has been triggered by entering the given character at the given document location. This method assumes that isValidFor(ITextViewer, com.ibm.lpex.core.LpexDocumentLocation) returns true if called for location.

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

isValidFor

boolean isValidFor(ITextViewer textViewer,
                   LpexDocumentLocation location)
Return whether this completion proposal is valid for the given position in the given document.

Parameters:
textViewer - the LpexTextViewer whose document the proposal is tested for
location - document location at which the trigger has been activated
Returns:
true iff valid

getTriggerCharacters

char[] getTriggerCharacters()
Return 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 via Enter is possible

getContextInformationPosition

int getContextInformationPosition()
Return 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

LPEX
4.4.0

Copyright � 2016 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.