Interface IContentAssistant
- All Superinterfaces:
- ITextViewerLifecycle
- All Known Subinterfaces:
- ISubjectControlContentAssistant
- All Known Implementing Classes:
- ContentAssistant,- SubjectControlContentAssistant
An 
IContentAssistant provides support on interactive content completion. The content
 assistant is a ITextViewer add-on. Its purpose is to propose,
 display, and insert completions of the content of the text viewer's document at the viewer's
 cursor position. In addition to handle completions, a content assistant can also be requested to
 provide context information. Context information is shown in a tool tip like popup. As it is not
 always possible to determine the exact context at a given document offset, a content assistant
 displays the possible contexts and requests the user to choose the one whose information should
 be displayed.
 
 A content assistant has a list of
 IContentAssistProcessor objects each of which is
 registered for a particular document content type. The content assistant uses the processors to
 react on the request of completing documents or presenting context information.
 
 In order to provide backward compatibility for clients of IContentAssistant,
 extension interfaces are used to provide a means of evolution. The following extension interfaces
 exist:
 
- IContentAssistantExtensionsince version 3.0 introducing the following functions:- handle documents with multiple partitions
- insertion of common completion prefixes
 
- IContentAssistantExtension2since version 3.2 introducing the following functions:- repeated invocation (cycling) mode
- completion listeners
- a local status line for the completion popup
- control over the behavior when no proposals are available
 
- IContentAssistantExtension3since version 3.2 introducing the following function:- a key-sequence to listen for in repeated invocation mode
 
- IContentAssistantExtension4since version 3.4 introducing the following function:- allows to get a handler for the given command identifier
 
 The interface can be implemented by clients. By default, clients use
 ContentAssistant as the standard implementer of this
 interface.
 
- See Also:
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intContext info will be shown above the location it has been requested for without hiding the location.static final intContext info will be shown below the location it has been requested for without hiding the location.static final intThe context info list will overlay the list of completion proposals.static final intThe completion proposal list will be removed before the context info list will be shown.static final intThe context info list will be presented without hiding or overlapping the completion proposal list.
- 
Method SummaryModifier and TypeMethodDescriptiongetContentAssistProcessor(String contentType) Returns the content assist processor to be used for the given content type.voidinstall(ITextViewer textViewer) Installs content assist support on the given text viewer.Shows context information for the content at the viewer's cursor position.Shows all possible completions of the content at the viewer's cursor position.voidUninstalls content assist support from the text viewer it has previously be installed on.
- 
Field Details- 
PROPOSAL_OVERLAYstatic final int PROPOSAL_OVERLAYThe context info list will overlay the list of completion proposals.- See Also:
 
- 
PROPOSAL_REMOVEstatic final int PROPOSAL_REMOVEThe completion proposal list will be removed before the context info list will be shown.- See Also:
 
- 
PROPOSAL_STACKEDstatic final int PROPOSAL_STACKEDThe context info list will be presented without hiding or overlapping the completion proposal list.- See Also:
 
- 
CONTEXT_INFO_ABOVEstatic final int CONTEXT_INFO_ABOVEContext info will be shown above the location it has been requested for without hiding the location.- See Also:
 
- 
CONTEXT_INFO_BELOWstatic final int CONTEXT_INFO_BELOWContext info will be shown below the location it has been requested for without hiding the location.- See Also:
 
 
- 
- 
Method Details- 
installInstalls content assist support on the given text viewer.- Specified by:
- installin interface- ITextViewerLifecycle
- Parameters:
- textViewer- the text viewer on which content assist will work
 
- 
uninstallvoid uninstall()Uninstalls content assist support from the text viewer it has previously be installed on.- Specified by:
- uninstallin interface- ITextViewerLifecycle
 
- 
showPossibleCompletionsString showPossibleCompletions()Shows all possible completions of the content at the viewer's cursor position.- Returns:
- an optional error message if no proposals can be computed
 
- 
showContextInformationString showContextInformation()Shows context information for the content at the viewer's cursor position.- Returns:
- an optional error message if no context information can be computed
 
- 
getContentAssistProcessorReturns the content assist processor to be used for the given content type.- Parameters:
- contentType- the type of the content for which this content assistant is to be requested
- Returns:
- an instance content assist processor or
         nullif none exists for the specified content type
 
 
-