Class CompletionProposal

  • All Implemented Interfaces:
    ICompletionProposal

    public final class CompletionProposal
    extends java.lang.Object
    implements ICompletionProposal
    The standard implementation of the ICompletionProposal interface.
    • Constructor Summary

      Constructors 
      Constructor Description
      CompletionProposal​(java.lang.String replacementString, int replacementOffset, int replacementLength, int cursorPosition)
      Creates a new completion proposal based on the provided information.
      CompletionProposal​(java.lang.String replacementString, int replacementOffset, int replacementLength, int cursorPosition, Image image, java.lang.String displayString, IContextInformation contextInformation, java.lang.String additionalProposalInfo)
      Creates a new completion proposal.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void apply​(IDocument document)
      Inserts the proposed completion into the given document.
      java.lang.String getAdditionalProposalInfo()
      Returns optional additional information about the proposal.
      IContextInformation getContextInformation()
      Returns optional context information associated with this proposal.
      java.lang.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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CompletionProposal

        public CompletionProposal​(java.lang.String replacementString,
                                  int replacementOffset,
                                  int replacementLength,
                                  int cursorPosition)
        Creates a new completion proposal based on the provided information. The replacement string is considered being the display string too. All remaining fields are set to null.
        Parameters:
        replacementString - the actual string to be inserted into the document
        replacementOffset - the offset of the text to be replaced
        replacementLength - the length of the text to be replaced
        cursorPosition - the position of the cursor following the insert relative to replacementOffset
      • CompletionProposal

        public CompletionProposal​(java.lang.String replacementString,
                                  int replacementOffset,
                                  int replacementLength,
                                  int cursorPosition,
                                  Image image,
                                  java.lang.String displayString,
                                  IContextInformation contextInformation,
                                  java.lang.String additionalProposalInfo)
        Creates a new completion proposal. All fields are initialized based on the provided information.
        Parameters:
        replacementString - the actual string to be inserted into the document
        replacementOffset - the offset of the text to be replaced
        replacementLength - the length of the text to be replaced
        cursorPosition - the position of the cursor following the insert relative to replacementOffset
        image - the image to display for this proposal
        displayString - the string to be displayed for the proposal
        contextInformation - the context information associated with this proposal
        additionalProposalInfo - the additional information associated with this proposal