LPEX
4.4.0

com.ibm.lpex.alef.contentassist
Interface IContentAssistant

All Known Implementing Classes:
ContentAssistant

public interface IContentAssistant

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 handling completions, a content assistant can also be requested to provide context information. Context information is shown in a tooltip-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 (see LpexCommonParser.getLanguage(LpexDocumentLocation)). The content assistant uses the processors to react on the request of completing documents or presenting context information.

The interface can be implemented by clients. By default, clients use ContentAssistant as the standard implementer of this interface.

This is the LPEX version of org.eclipse.jface.text.contentassist.IContentAssistant. It refers to LPEX content-assist classes.

See Also:
IContentAssistProcessor

Field Summary
static int CONTEXT_INFO_ABOVE
          Context info will be shown above the location it has been requested for, without hiding the location.
static int CONTEXT_INFO_BELOW
          Context info will be shown below the location it has been requested for, without hiding the location.
static int PROPOSAL_OVERLAY
          The context info list will overlay the list of completion proposals.
static int PROPOSAL_REMOVE
          The completion proposal list will be removed before the context info list will be shown.
static int PROPOSAL_STACKED
          The context info list will be presented without hiding or overlapping the completion proposal list.
 
Method Summary
 IContentAssistProcessor getContentAssistProcessor(String contentType)
          Returns the content assist processor to be used for the given content type.
 void install(ITextViewer textViewer)
          Install content-assist support on the given LpexTextViewer.
 String showContextInformation()
          Shows context information for the content at the viewer's cursor position.
 String showPossibleCompletions()
          Show all possible completions of the content at the viewer's cursor position.
 void uninstall()
          Uninstall content-assist support from the text viewer it was previously installed on.
 

Field Detail

PROPOSAL_OVERLAY

static final int PROPOSAL_OVERLAY
The context info list will overlay the list of completion proposals.

See Also:
Constant Field Values

PROPOSAL_REMOVE

static final int PROPOSAL_REMOVE
The completion proposal list will be removed before the context info list will be shown.

See Also:
Constant Field Values

PROPOSAL_STACKED

static final int PROPOSAL_STACKED
The context info list will be presented without hiding or overlapping the completion proposal list.

See Also:
Constant Field Values

CONTEXT_INFO_ABOVE

static final int CONTEXT_INFO_ABOVE
Context info will be shown above the location it has been requested for, without hiding the location.

See Also:
Constant Field Values

CONTEXT_INFO_BELOW

static final int CONTEXT_INFO_BELOW
Context info will be shown below the location it has been requested for, without hiding the location.

See Also:
Constant Field Values
Method Detail

install

void install(ITextViewer textViewer)
Install content-assist support on the given LpexTextViewer.

Parameters:
textViewer - the LpexTextViewer on which content assist will work

uninstall

void uninstall()
Uninstall content-assist support from the text viewer it was previously installed on.


showPossibleCompletions

String showPossibleCompletions()
Show all possible completions of the content at the viewer's cursor position.

Returns:
an optional error message if no proposals can be computed

showContextInformation

String 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

getContentAssistProcessor

IContentAssistProcessor getContentAssistProcessor(String contentType)
Returns 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 null if none exists for the specified content type
See Also:
LpexCommonParser.getLanguage(LpexDocumentLocation)

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.