Class AbstractExternalQuickfixProvider

  • Direct Known Subclasses:

    public abstract class AbstractExternalQuickfixProvider
    extends Object
    Class for expanding mechanism of quickfixes in Built-in language
    This class contains some useful method for creating different quickfixes.
    Implementation of this class should contains some special public method with special annotation Fix. Each this method providing quickfix for validation issue with code equals to argument of annotation Fix
    Example of implementation:
     public class FooQuickfix
       extends AbstractExternalQuickfixProvider
         public void doFooQickfix(final Issue issue, IssueResolutionAcceptor acceptor)
             acceptor.accept(issue, "fooQuickfixTitle", "fooQuickfixExtensionTitle", imagesOfFooQuickfix, new ExternalQuickfixModification<ModelObject>(issue, ModelObject.class,
                 new Function<ModelObject, TextEdit>()
                     public TextEdit apply(ModelObject method)
                         //foo qiuckfix action for creating text changes
    • Constructor Detail

      • AbstractExternalQuickfixProvider

        public AbstractExternalQuickfixProvider()
    • Method Detail

      • getTextViewer

        protected org.eclipse.jface.text.ITextViewer getTextViewer​(org.eclipse.xtext.ui.editor.model.edit.IModificationContext context)
        Gets ITextViewer from IModificationContext
        context - actual IModificationContext of quickfix, can't be null
        ITextViewer from IModificationContext or null it there is no implementation of ITextViewer for this IModificationContext
      • selectAndReveal

        protected void selectAndReveal​(org.eclipse.jface.text.ITextViewer viewer,
                                       int posStart,
                                       int length)
        Selects and reveals some text from ITextViewer
        viewer - actual ITextViewer, can't be null
        posStart - start position of selecting and revealing text in ITextViewer
        length - length of selecting and revealing area