public abstract class PsiElementBaseIntentionAction extends BaseIntentionAction
BaseElementAtCaretIntentionAction
EMPTY_ARRAY
Constructor and Description |
---|
PsiElementBaseIntentionAction() |
Modifier and Type | Method and Description |
---|---|
boolean |
checkFile(PsiFile file)
Check whether this intention available in file.
|
abstract void |
invoke(Project project,
Editor editor,
PsiElement element)
Invokes intention action for the element under caret.
|
void |
invoke(Project project,
Editor editor,
PsiFile file)
Called when user invokes intention.
|
abstract boolean |
isAvailable(Project project,
Editor editor,
PsiElement element)
Checks whether this intention is available at a caret offset in file.
|
boolean |
isAvailable(Project project,
Editor editor,
PsiFile file)
Checks whether this intention is available at a caret offset in the file.
|
canModify, getText, setText, startInWriteAction, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getFamilyName
getElementToMakeWritable
public final void invoke(Project project, Editor editor, PsiFile file) throws IncorrectOperationException
IntentionAction
IntentionAction.startInWriteAction()
returns true
, this method is also called
inside write action.project
- the project in which the intention is invoked.editor
- the editor in which the intention is invoked.file
- the file open in the editor.IncorrectOperationException
public boolean checkFile(PsiFile file)
public abstract void invoke(Project project, Editor editor, PsiElement element) throws IncorrectOperationException
project
- the project in which the file is opened.editor
- the editor for the file.element
- the element under cursor.IncorrectOperationException
public final boolean isAvailable(Project project, Editor editor, PsiFile file)
IntentionAction
project
- the project in which the availability is checked.editor
- the editor in which the intention will be invoked.file
- the file open in the editor.true
if the intention is available, false
otherwise.public abstract boolean isAvailable(Project project, Editor editor, PsiElement element)
project
- the project in which the availability is checked.editor
- the editor in which the intention will be invoked.element
- the element under caret.