public class MakeVoidQuickFix extends java.lang.Object implements LocalQuickFix
EMPTY_ARRAY| Constructor and Description |
|---|
MakeVoidQuickFix(ProblemDescriptionsProcessor processor) |
| Modifier and Type | Method and Description |
|---|---|
void |
applyFix(Project project,
ProblemDescriptor descriptor)
Called to apply the fix.
|
PsiElement |
getElementToMakeWritable(PsiFile currentFile)
Controls whether this intention/fix is going to modify the current file.
|
java.lang.String |
getFamilyName() |
boolean |
startInWriteAction()
Indicate whether this action should be invoked inside write action.
|
public MakeVoidQuickFix(ProblemDescriptionsProcessor processor)
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 - Projectdescriptor - problem reported by the tool which provided this quick fix actionpublic boolean startInWriteAction()
WriteActionAwarefalse if e.g. modal dialog is shown inside the action.
If false is returned the action itself is responsible for starting write action
when needed, by calling Application.runWriteAction(Runnable).startInWriteAction in interface WriteActionAwaretrue if the action requires a write action (default), false otherwise.public PsiElement getElementToMakeWritable(PsiFile currentFile)
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 FileModifiercurrentFile - the same file where intention would be invoked (for LocalQuickFix it would be the containing file of ProblemDescriptor.getPsiElement())