public class AddSingleMemberStaticImportAction extends BaseElementAtCaretIntentionAction
Modifier and Type | Class and Description |
---|---|
static class |
AddSingleMemberStaticImportAction.ImportAvailability |
EMPTY_ARRAY
Constructor and Description |
---|
AddSingleMemberStaticImportAction() |
Modifier and Type | Method and Description |
---|---|
static void |
bindAllClassRefs(PsiFile file,
PsiElement resolved,
java.lang.String referenceName,
PsiClass resolvedClass) |
java.lang.String |
getFamilyName()
Returns the name of the family of intentions.
|
static AddSingleMemberStaticImportAction.ImportAvailability |
getStaticImportClass(PsiElement element)
Allows to check if it's possible to perform static import for the target element.
|
void |
invoke(Project project,
Editor editor,
PsiElement element)
Invokes intention action for the element under cursor.
|
static void |
invoke(PsiFile file,
PsiElement element) |
boolean |
isAvailable(Project project,
Editor editor,
PsiElement element)
Checks whether this intention is available at a caret offset in file.
|
checkFile, invoke, isAvailable
canModify, getText, setText, startInWriteAction, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getElementToMakeWritable
public java.lang.String getFamilyName()
IntentionAction
IntentionManager.registerIntentionAndMetaData(IntentionAction, String...)
public static AddSingleMemberStaticImportAction.ImportAvailability getStaticImportClass(PsiElement element)
element
- target element that is static import candidatenull
otherwisepublic boolean isAvailable(Project project, Editor editor, PsiElement element)
BaseElementAtCaretIntentionAction
true
, a light bulb for this intention is shown.isAvailable
in class BaseElementAtCaretIntentionAction
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 static void invoke(PsiFile file, PsiElement element)
public static void bindAllClassRefs(PsiFile file, PsiElement resolved, java.lang.String referenceName, PsiClass resolvedClass)
public void invoke(Project project, Editor editor, PsiElement element) throws IncorrectOperationException
BaseElementAtCaretIntentionAction
invoke
in class BaseElementAtCaretIntentionAction
project
- the project in which the file is opened.editor
- the editor for the file.element
- the element under cursor.IncorrectOperationException
- On errors.