public class MethodUpHandler extends java.lang.Object implements CodeInsightActionHandler
Constructor and Description |
---|
MethodUpHandler() |
Modifier and Type | Method and Description |
---|---|
PsiElement |
getElementToMakeWritable(PsiFile currentFile)
Controls whether this intention/fix is going to modify the current file.
|
void |
invoke(Project project,
Editor editor,
PsiFile file) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
startInWriteAction
public void invoke(Project project, Editor editor, PsiFile file)
invoke
in interface CodeInsightActionHandler
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 FileModifier
currentFile
- the same file where intention would be invoked (for LocalQuickFix
it would be the containing file of ProblemDescriptor.getPsiElement()
)