public class ShowIntentionActionsHandler extends java.lang.Object implements CodeInsightActionHandler
Constructor and Description |
---|
ShowIntentionActionsHandler() |
Modifier and Type | Method and Description |
---|---|
static boolean |
availableFor(PsiFile psiFile,
Editor editor,
IntentionAction action) |
static ShowIntentionsPass.IntentionsInfo |
calcIntentions(Project project,
Editor editor,
PsiFile file) |
static boolean |
chooseActionAndInvoke(PsiFile hostFile,
Editor hostEditor,
IntentionAction action,
java.lang.String commandName) |
static Pair<PsiFile,Editor> |
chooseBetweenHostAndInjected(PsiFile hostFile,
Editor hostEditor,
PsiFile injectedFile,
PairProcessor<? super PsiFile,? super Editor> predicate) |
static Pair<PsiFile,Editor> |
chooseFileForAction(PsiFile hostFile,
Editor hostEditor,
IntentionAction action) |
void |
invoke(Project project,
Editor editor,
PsiFile file) |
void |
invoke(Project project,
Editor editor,
PsiFile file,
boolean showFeedbackOnEmptyMenu) |
protected void |
showIntentionHint(Project project,
Editor editor,
PsiFile file,
ShowIntentionsPass.IntentionsInfo intentions,
boolean showFeedbackOnEmptyMenu) |
boolean |
startInWriteAction()
Indicate whether this action should be invoked inside write action.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getElementToMakeWritable
public void invoke(Project project, Editor editor, PsiFile file)
invoke
in interface CodeInsightActionHandler
public void invoke(Project project, Editor editor, PsiFile file, boolean showFeedbackOnEmptyMenu)
protected void showIntentionHint(Project project, Editor editor, PsiFile file, ShowIntentionsPass.IntentionsInfo intentions, boolean showFeedbackOnEmptyMenu)
public static ShowIntentionsPass.IntentionsInfo calcIntentions(Project project, Editor editor, PsiFile file)
public boolean startInWriteAction()
WriteActionAware
false
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 WriteActionAware
true
if the action requires a write action (default), false
otherwise.public static boolean availableFor(PsiFile psiFile, Editor editor, IntentionAction action)
public static Pair<PsiFile,Editor> chooseBetweenHostAndInjected(PsiFile hostFile, Editor hostEditor, PsiFile injectedFile, PairProcessor<? super PsiFile,? super Editor> predicate)
public static boolean chooseActionAndInvoke(PsiFile hostFile, Editor hostEditor, IntentionAction action, java.lang.String commandName)