Interface ICompletionProposalExtension2
- All Known Implementing Classes:
- TemplateProposal
public interface ICompletionProposalExtension2
Extends 
ICompletionProposal
 with the following functions:
 - handling of trigger characters with modifiers
- visual indication for selection of a proposal
- Since:
- 2.1
- 
Method SummaryModifier and TypeMethodDescriptionvoidapply(ITextViewer viewer, char trigger, int stateMask, int offset) Applies the proposed completion to the given document.voidselected(ITextViewer viewer, boolean smartToggle) Called when the proposal is selected.voidunselected(ITextViewer viewer) Called when the proposal is unselected.booleanvalidate(IDocument document, int offset, DocumentEvent event) Requests the proposal to be validated with respect to the document event.
- 
Method Details- 
applyApplies the proposed completion to the given document. The insertion has been triggered by entering the given character with a modifier at the given offset. This method assumes thatvalidate(IDocument, int, DocumentEvent)returnstrueif called foroffset.- Parameters:
- viewer- the text viewer into which to insert the proposed completion
- trigger- the trigger to apply the completion
- stateMask- the state mask of the modifiers
- offset- the offset at which the trigger has been activated
 
- 
selectedCalled when the proposal is selected.- Parameters:
- viewer- the text viewer.
- smartToggle- the smart toggle key was pressed
 
- 
unselectedCalled when the proposal is unselected.- Parameters:
- viewer- the text viewer.
 
- 
validateRequests the proposal to be validated with respect to the document event. If the proposal cannot be validated, the methods returnsfalse. If the document event wasnull, only the caret offset was changed, but not the document. This method replacesICompletionProposalExtension.isValidFor(IDocument, int)- Parameters:
- document- the document
- offset- the caret offset
- event- the document event, may be- null
- Returns:
- boolean
 
 
-