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
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
Example of implementation:
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
{
@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 ClassesModifier and TypeClassDescriptionprotected static classAbstractExternalQuickfixProvider.ExternalQuickfixModification<E extends org.eclipse.emf.ecore.EObject>Deprecated.Use com._1c.g5.v8.dt.internal.bsl.ui.qfix.ExternalQuickfixModification instead -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected org.eclipse.jface.text.ITextViewergetTextViewer(org.eclipse.xtext.ui.editor.model.edit.IModificationContext context) GetsITextViewerfromIModificationContextprotected voidselectAndReveal(org.eclipse.jface.text.ITextViewer viewer, int posStart, int length) Selects and reveals some text fromITextViewer
-
Constructor Details
-
AbstractExternalQuickfixProvider
public AbstractExternalQuickfixProvider()
-
-
Method Details
-
getTextViewer
protected org.eclipse.jface.text.ITextViewer getTextViewer(org.eclipse.xtext.ui.editor.model.edit.IModificationContext context) GetsITextViewerfromIModificationContext- Parameters:
context- actualIModificationContextof quickfix, can't benull- Returns:
ITextViewerfromIModificationContextornullit there is no implementation ofITextViewerfor 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 benullposStart- start position of selecting and revealing text inITextViewerlength- length of selecting and revealing area
-