public abstract class BaseElementAtCaretIntentionAction extends BaseIntentionAction
EMPTY_ARRAY| Constructor and Description |
|---|
BaseElementAtCaretIntentionAction() |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
checkFile(PsiFile file) |
abstract void |
invoke(Project project,
Editor editor,
PsiElement element)
Invokes intention action for the element under cursor.
|
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, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetFamilyNamegetElementToMakeWritablepublic final boolean isAvailable(Project project, Editor editor, PsiFile file)
IntentionActionproject - 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.protected boolean checkFile(PsiFile file)
public abstract boolean isAvailable(Project project, Editor editor, PsiElement element)
true, a light bulb for this intention is shown.project - the project in which the availability is checked.editor - the editor in which the intention will be invoked.element - the element under caret.public final void invoke(Project project, Editor editor, PsiFile file) throws IncorrectOperationException
IntentionActionIntentionAction.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.IncorrectOperationExceptionpublic 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 - On errors.