Package com._1c.g5.v8.dt.bsl.ui.quickfix
Class AbstractExternalQuickfixProvider
- java.lang.Object
-
- com._1c.g5.v8.dt.bsl.ui.quickfix.AbstractExternalQuickfixProvider
-
- Direct Known Subclasses:
FormAndCommandExportMethodQuickfix
,StringLiteralAnnotationQuickfixProvider
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 annotationFix
. Each this method providing quickfix for validation issue with code equals to argument of annotationFix
Example of implementation:public class FooQuickfix extends AbstractExternalQuickfixProvider { @Fix(FooValidationIssueCode) public void doFooQickfix(final Issue issue, IssueResolutionAcceptor acceptor) { acceptor.accept(issue, "fooQuickfixTitle", "fooQuickfixExtensionTitle", imagesOfFooQuickfix, new ExternalQuickfixModification<ModelObject>(issue, ModelObject.class, new Function<ModelObject, TextEdit>() { @Override public TextEdit apply(ModelObject method) { //foo qiuckfix action for creating text changes } })); } }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
AbstractExternalQuickfixProvider.ExternalQuickfixModification<E extends org.eclipse.emf.ecore.EObject>
Deprecated.Use com._1c.g5.v8.dt.internal.bsl.ui.qfix.ExternalQuickfixModification instead
-
Constructor Summary
Constructors Constructor Description AbstractExternalQuickfixProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.eclipse.jface.text.ITextViewer
getTextViewer(org.eclipse.xtext.ui.editor.model.edit.IModificationContext context)
GetsITextViewer
fromIModificationContext
protected void
selectAndReveal(org.eclipse.jface.text.ITextViewer viewer, int posStart, int length)
Selects and reveals some text fromITextViewer
-
-
-
Method Detail
-
getTextViewer
protected org.eclipse.jface.text.ITextViewer getTextViewer(org.eclipse.xtext.ui.editor.model.edit.IModificationContext context)
GetsITextViewer
fromIModificationContext
- Parameters:
context
- actualIModificationContext
of quickfix, can't benull
- Returns:
ITextViewer
fromIModificationContext
ornull
it there is no implementation ofITextViewer
for thisIModificationContext
-
selectAndReveal
protected void selectAndReveal(org.eclipse.jface.text.ITextViewer viewer, int posStart, int length)
Selects and reveals some text fromITextViewer
- Parameters:
viewer
- actualITextViewer
, can't benull
posStart
- start position of selecting and revealing text inITextViewer
length
- length of selecting and revealing area
-
-