public abstract class BaseConvertToLocalQuickFix<V extends PsiVariable> extends java.lang.Object implements LocalQuickFix
FieldCanBeLocalInspection
Modifier and Type | Field and Description |
---|---|
protected static Logger |
LOG |
EMPTY_ARRAY
Constructor and Description |
---|
BaseConvertToLocalQuickFix() |
Modifier and Type | Method and Description |
---|---|
protected PsiElement |
applyChanges(Project project,
java.lang.String localName,
PsiExpression initializer,
V variable,
java.util.Collection<? extends PsiReference> references,
boolean delete,
NotNullFunction<? super PsiDeclarationStatement,? extends PsiElement> action) |
void |
applyFix(Project project,
ProblemDescriptor descriptor)
Called to apply the fix.
|
protected void |
beforeDelete(Project project,
V variable,
PsiElement newDeclaration) |
protected void |
deleteSourceVariable(Project project,
V variable,
PsiElement newDeclaration) |
java.lang.String |
getFamilyName() |
protected abstract V |
getVariable(ProblemDescriptor descriptor) |
protected java.util.List<PsiElement> |
moveDeclaration(Project project,
V variable) |
protected PsiElement |
moveDeclaration(Project project,
V variable,
java.util.Collection<? extends PsiReference> references,
boolean delete) |
protected PsiElement |
moveDeclaration(PsiElementFactory elementFactory,
java.lang.String localName,
V variable,
PsiExpression initializer,
NotNullFunction<? super PsiDeclarationStatement,? extends PsiElement> action,
java.util.Collection<? extends PsiReference> references) |
protected static void |
positionCaretToDeclaration(Project project,
PsiFile psiFile,
PsiElement declaration) |
protected abstract java.lang.String |
suggestLocalName(Project project,
V variable,
PsiCodeBlock scope) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getElementToMakeWritable
startInWriteAction
protected static final Logger LOG
public final java.lang.String getFamilyName()
getFamilyName
in interface QuickFix<ProblemDescriptor>
QuickFix.getName()
.public final void applyFix(Project project, ProblemDescriptor descriptor)
QuickFix
Please call com.intellij.profile.codeInspection.ProjectInspectionProfileManager#fireProfileChanged()
if inspection profile is changed as result of fix.
applyFix
in interface QuickFix<ProblemDescriptor>
project
- Project
descriptor
- problem reported by the tool which provided this quick fix actionprotected abstract V getVariable(ProblemDescriptor descriptor)
protected static void positionCaretToDeclaration(Project project, PsiFile psiFile, PsiElement declaration)
protected void beforeDelete(Project project, V variable, PsiElement newDeclaration)
protected java.util.List<PsiElement> moveDeclaration(Project project, V variable)
protected PsiElement moveDeclaration(Project project, V variable, java.util.Collection<? extends PsiReference> references, boolean delete)
protected PsiElement applyChanges(Project project, java.lang.String localName, PsiExpression initializer, V variable, java.util.Collection<? extends PsiReference> references, boolean delete, NotNullFunction<? super PsiDeclarationStatement,? extends PsiElement> action)
protected void deleteSourceVariable(Project project, V variable, PsiElement newDeclaration)
protected PsiElement moveDeclaration(PsiElementFactory elementFactory, java.lang.String localName, V variable, PsiExpression initializer, NotNullFunction<? super PsiDeclarationStatement,? extends PsiElement> action, java.util.Collection<? extends PsiReference> references)
protected abstract java.lang.String suggestLocalName(Project project, V variable, PsiCodeBlock scope)