Eclipse Platform
2.0

org.eclipse.jface.text.contentassist
Interface ICompletionProposal

All Known Implementing Classes:
CompletionProposal

public interface ICompletionProposal

The interface of completion proposals generated by content assist processors. A completion proposal contains information used to present the proposed completion to the user, to insert the completion should the user select it, and to present context information for the choosen completion once it has been inserted.

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

See Also:
IContentAssistProcessor

Method Summary
 void apply(IDocument document)
          Inserts the proposed completion into the given document.
 String getAdditionalProposalInfo()
          Returns optional additional information about the proposal.
 IContextInformation getContextInformation()
          Returns optional context information associated with this proposal.
 String getDisplayString()
          Returns the string to be displayed in the list of completion proposals.
 Image getImage()
          Returns the image to be displayed in the list of completion proposals.
 Point getSelection(IDocument document)
          Returns the new selection after the proposal has been applied to the given document in absolute document coordinates.
 

Method Detail

apply

public void apply(IDocument document)
Inserts the proposed completion into the given document.

Parameters:
document - the document into which to insert the proposed completion

getSelection

public Point getSelection(IDocument document)
Returns the new selection after the proposal has been applied to the given document in absolute document coordinates. If it returns null, no new selection is set.

Parameters:
document - the document into which the proposed completion has been inserted
Returns:
the new selection in absolute document coordinates

getAdditionalProposalInfo

public String getAdditionalProposalInfo()
Returns optional additional information about the proposal. The additional information will be presented to assist the user in deciding if the selected proposal is the desired choice.

Returns:
the additional information or null

getDisplayString

public String getDisplayString()
Returns the string to be displayed in the list of completion proposals.

Returns:
the string to be displayed

getImage

public Image getImage()
Returns the image to be displayed in the list of completion proposals. The image would typically be shown to the left of the display string.

Returns:
the image to be shown or null if no image is desired

getContextInformation

public IContextInformation getContextInformation()
Returns optional context information associated with this proposal. The context information will automatically be shown if the proposal has been applied.

Returns:
the context information for this proposal or null

Eclipse Platform
2.0

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