public static class ExternalAnnotatorInspectionVisitor.LocalQuickFixBackedByIntentionAction extends java.lang.Object implements LocalQuickFix, Iconable
Iconable.IconFlags, Iconable.LastComputedIcon
EMPTY_ARRAY
ICON_FLAG_IGNORE_MASK, ICON_FLAG_OPEN, ICON_FLAG_READ_STATUS, ICON_FLAG_VISIBILITY
Constructor and Description |
---|
LocalQuickFixBackedByIntentionAction(IntentionAction action) |
Modifier and Type | Method and Description |
---|---|
void |
applyFix(Project project,
ProblemDescriptor descriptor)
Called to apply the fix.
|
boolean |
equals(java.lang.Object o) |
PsiElement |
getElementToMakeWritable(PsiFile file)
Controls whether this intention/fix is going to modify the current file.
|
java.lang.String |
getFamilyName() |
javax.swing.Icon |
getIcon(int flags) |
java.lang.String |
getName() |
int |
hashCode() |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
startInWriteAction
public LocalQuickFixBackedByIntentionAction(IntentionAction action)
public java.lang.String getName()
getName
in interface QuickFix<ProblemDescriptor>
public java.lang.String getFamilyName()
getFamilyName
in interface QuickFix<ProblemDescriptor>
QuickFix.getName()
.public 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 actionpublic PsiElement getElementToMakeWritable(PsiFile file)
FileModifier
@NotNull
, and the current file is read-only,
it will be made writable (honoring version control integration) before the intention/fix is invoked.
By default, as a heuristic, returns the same as WriteActionAware.startInWriteAction()
.
If the action is going to modify multiple files, or the set of the files is unknown in advance, please
don't bother overriding this method, return false
from WriteActionAware.startInWriteAction()
, and call FileModificationService
methods in the implementation, and take write actions yourself as needed.getElementToMakeWritable
in interface FileModifier
file
- the same file where intention would be invoked (for LocalQuickFix
it would be the containing file of ProblemDescriptor.getPsiElement()
)public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object