public abstract class CreateFromUsageBaseFix extends BaseIntentionAction
EMPTY_ARRAY| Constructor and Description |
|---|
CreateFromUsageBaseFix() |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
canBeTargetClass(PsiClass psiClass) |
protected void |
chooseTargetClass(Project project,
Editor editor,
java.util.function.Consumer<PsiClass> createInClass) |
protected java.util.List<PsiClass> |
filterTargetClasses(PsiElement element,
Project project) |
protected abstract PsiElement |
getElement() |
protected java.util.List<PsiClass> |
getTargetClasses(PsiElement element) |
static PsiSubstitutor |
getTargetSubstitutor(PsiElement element) |
protected java.lang.String |
getVisibility(PsiClass parentClass,
PsiClass targetClass) |
protected boolean |
isAllowOuterTargetClass() |
boolean |
isAvailable(Project project,
Editor editor,
PsiFile file)
Checks whether this intention is available at a caret offset in the file.
|
protected abstract boolean |
isAvailableImpl(int offset) |
protected abstract boolean |
isValidElement(PsiElement result) |
static Editor |
positionCursor(Project project,
PsiFile targetFile,
PsiElement element) |
static void |
setupGenericParameters(PsiClass targetClass,
PsiJavaCodeReferenceElement ref) |
protected void |
setupVisibility(PsiClass parentClass,
PsiClass targetClass,
PsiModifierList list) |
static boolean |
shouldCreateStaticMember(PsiReferenceExpression ref,
PsiClass targetClass) |
boolean |
startInWriteAction()
Indicate whether this action should be invoked inside write action.
|
static void |
startTemplate(Editor editor,
Template template,
Project project) |
protected static void |
startTemplate(Editor editor,
Template template,
Project project,
TemplateEditingListener listener) |
static void |
startTemplate(Editor editor,
Template template,
Project project,
TemplateEditingListener listener,
java.lang.String commandName) |
canModify, getText, setText, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetFamilyName, invokegetElementToMakeWritablepublic 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 abstract boolean isAvailableImpl(int offset)
protected abstract boolean isValidElement(PsiElement result)
protected void chooseTargetClass(Project project, Editor editor, java.util.function.Consumer<PsiClass> createInClass)
protected java.util.List<PsiClass> filterTargetClasses(PsiElement element, Project project)
protected abstract PsiElement getElement()
public static Editor positionCursor(Project project, PsiFile targetFile, PsiElement element)
protected void setupVisibility(PsiClass parentClass, PsiClass targetClass, PsiModifierList list) throws IncorrectOperationException
IncorrectOperationExceptionpublic static boolean shouldCreateStaticMember(PsiReferenceExpression ref, PsiClass targetClass)
public static PsiSubstitutor getTargetSubstitutor(PsiElement element)
protected boolean isAllowOuterTargetClass()
protected java.util.List<PsiClass> getTargetClasses(PsiElement element)
protected boolean canBeTargetClass(PsiClass psiClass)
protected static void startTemplate(Editor editor, Template template, Project project, TemplateEditingListener listener)
public static void startTemplate(Editor editor, Template template, Project project, TemplateEditingListener listener, java.lang.String commandName)
public boolean startInWriteAction()
IntentionActionfalse if, e.g., a 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 IntentionActionstartInWriteAction in interface WriteActionAwarestartInWriteAction in class BaseIntentionActiontrue if the intention requires a write action, false otherwise.public static void setupGenericParameters(PsiClass targetClass, PsiJavaCodeReferenceElement ref)