Class PositionBasedCompletionProposal

  • All Implemented Interfaces:
    IPositionBasedCompletionProposal, Comparable<org.eclipse.xtext.ui.editor.contentassist.ConfigurableCompletionProposal>, org.eclipse.jface.text.contentassist.ICompletionProposal, org.eclipse.jface.text.contentassist.ICompletionProposalExtension, org.eclipse.jface.text.contentassist.ICompletionProposalExtension2, org.eclipse.jface.text.contentassist.ICompletionProposalExtension3, org.eclipse.jface.text.contentassist.ICompletionProposalExtension4, org.eclipse.jface.text.contentassist.ICompletionProposalExtension5, org.eclipse.jface.text.contentassist.ICompletionProposalExtension6

    public class PositionBasedCompletionProposal
    extends org.eclipse.xtext.ui.editor.contentassist.ConfigurableCompletionProposal
    implements IPositionBasedCompletionProposal
    Default implementation of IPositionBasedCompletionProposal
    • Nested Class Summary

      • Nested classes/interfaces inherited from class org.eclipse.xtext.ui.editor.contentassist.ConfigurableCompletionProposal

        org.eclipse.xtext.ui.editor.contentassist.ConfigurableCompletionProposal.ExitPolicy, org.eclipse.xtext.ui.editor.contentassist.ConfigurableCompletionProposal.IReplacementTextApplier
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected org.eclipse.jface.text.link.ProposalPosition position
      The position to apply proposal
    • Constructor Summary

      Constructors 
      Constructor Description
      PositionBasedCompletionProposal​(String replacementString, int replacementOffset, int cursorPosition, boolean useFuzzySearch)
      Creates new instance of this with given text to replace on apply(IDocument) and cursor position to set after
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void apply​(org.eclipse.jface.text.IDocument document)  
      void apply​(org.eclipse.jface.text.ITextViewer viewer, char trigger, int stateMask, int offset)  
      String getAdditionalProposalInfo()  
      org.eclipse.jface.text.contentassist.IContextInformation getContextInformation()  
      String getDisplayString()  
      org.eclipse.swt.graphics.Image getImage()  
      org.eclipse.swt.graphics.Point getSelection​(org.eclipse.jface.text.IDocument document)  
      StyledString getStyledDisplayString()  
      void selected​(org.eclipse.jface.text.ITextViewer viewer, boolean smartToggle)  
      void setPosition​(org.eclipse.jface.text.link.ProposalPosition position)
      Sets the position of proposal to the given one
      void unselected​(org.eclipse.jface.text.ITextViewer viewer)  
      boolean validate​(org.eclipse.jface.text.IDocument document, int offset, org.eclipse.jface.text.DocumentEvent event)  
      • Methods inherited from class org.eclipse.xtext.ui.editor.contentassist.ConfigurableCompletionProposal

        apply, compareTo, equals, getAdditionalData, getAdditionalProposalInfo, getContextInformationPosition, getCursorPosition, getInformationControlCreator, getMatcher, getPrefixCompletionStart, getPrefixCompletionText, getPriority, getReplaceContextLength, getReplacementLength, getReplacementOffset, getReplacementString, getSelectionLength, getSelectionStart, getTextApplier, getTriggerCharacters, hashCode, isAutoInsertable, isLinkedMode, isValidFor, setAdditionalData, setAdditionalProposalInfo, setAutoInsertable, setContextInformation, setCursorPosition, setDisplayString, setDisplayString, setHover, setImage, setMatcher, setPriority, setProposalContextResource, setReplaceContextLength, setReplacementLength, setReplacementOffset, setReplacementString, setSelectionLength, setSelectionStart, setSimpleLinkedMode, setTextApplier, setTriggerCharacters, setUpLinkedMode, shiftOffset, toString
    • Field Detail

      • position

        protected org.eclipse.jface.text.link.ProposalPosition position
        The position to apply proposal
    • Constructor Detail

      • PositionBasedCompletionProposal

        public PositionBasedCompletionProposal​(String replacementString,
                                               int replacementOffset,
                                               int cursorPosition,
                                               boolean useFuzzySearch)
        Creates new instance of this with given text to replace on apply(IDocument) and cursor position to set after
        Parameters:
        replacementString - The string to replace with, cannot be null
        cursorPosition - The position of the cursor after apply(IDocument)
    • Method Detail

      • apply

        public void apply​(org.eclipse.jface.text.IDocument document)
        Specified by:
        apply in interface org.eclipse.jface.text.contentassist.ICompletionProposal
        Overrides:
        apply in class org.eclipse.xtext.ui.editor.contentassist.ConfigurableCompletionProposal
      • getSelection

        public org.eclipse.swt.graphics.Point getSelection​(org.eclipse.jface.text.IDocument document)
        Specified by:
        getSelection in interface org.eclipse.jface.text.contentassist.ICompletionProposal
        Overrides:
        getSelection in class org.eclipse.xtext.ui.editor.contentassist.ConfigurableCompletionProposal
      • getAdditionalProposalInfo

        public String getAdditionalProposalInfo()
        Specified by:
        getAdditionalProposalInfo in interface org.eclipse.jface.text.contentassist.ICompletionProposal
        Overrides:
        getAdditionalProposalInfo in class org.eclipse.xtext.ui.editor.contentassist.ConfigurableCompletionProposal
      • getDisplayString

        public String getDisplayString()
        Specified by:
        getDisplayString in interface org.eclipse.jface.text.contentassist.ICompletionProposal
        Overrides:
        getDisplayString in class org.eclipse.xtext.ui.editor.contentassist.ConfigurableCompletionProposal
      • getImage

        public org.eclipse.swt.graphics.Image getImage()
        Specified by:
        getImage in interface org.eclipse.jface.text.contentassist.ICompletionProposal
        Overrides:
        getImage in class org.eclipse.xtext.ui.editor.contentassist.ConfigurableCompletionProposal
      • getContextInformation

        public org.eclipse.jface.text.contentassist.IContextInformation getContextInformation()
        Specified by:
        getContextInformation in interface org.eclipse.jface.text.contentassist.ICompletionProposal
        Overrides:
        getContextInformation in class org.eclipse.xtext.ui.editor.contentassist.ConfigurableCompletionProposal
      • apply

        public void apply​(org.eclipse.jface.text.ITextViewer viewer,
                          char trigger,
                          int stateMask,
                          int offset)
        Specified by:
        apply in interface org.eclipse.jface.text.contentassist.ICompletionProposalExtension2
        Overrides:
        apply in class org.eclipse.xtext.ui.editor.contentassist.ConfigurableCompletionProposal
      • selected

        public void selected​(org.eclipse.jface.text.ITextViewer viewer,
                             boolean smartToggle)
        Specified by:
        selected in interface org.eclipse.jface.text.contentassist.ICompletionProposalExtension2
        Overrides:
        selected in class org.eclipse.xtext.ui.editor.contentassist.ConfigurableCompletionProposal
      • unselected

        public void unselected​(org.eclipse.jface.text.ITextViewer viewer)
        Specified by:
        unselected in interface org.eclipse.jface.text.contentassist.ICompletionProposalExtension2
        Overrides:
        unselected in class org.eclipse.xtext.ui.editor.contentassist.ConfigurableCompletionProposal
      • getStyledDisplayString

        public StyledString getStyledDisplayString()
        Specified by:
        getStyledDisplayString in interface org.eclipse.jface.text.contentassist.ICompletionProposalExtension6
        Overrides:
        getStyledDisplayString in class org.eclipse.xtext.ui.editor.contentassist.ConfigurableCompletionProposal
      • validate

        public boolean validate​(org.eclipse.jface.text.IDocument document,
                                int offset,
                                org.eclipse.jface.text.DocumentEvent event)
        Specified by:
        validate in interface org.eclipse.jface.text.contentassist.ICompletionProposalExtension2
        Overrides:
        validate in class org.eclipse.xtext.ui.editor.contentassist.ConfigurableCompletionProposal