public class CreateClassFromNewFix extends CreateFromUsageBaseFix
EMPTY_ARRAY| Constructor and Description |
|---|
CreateClassFromNewFix(PsiNewExpression newExpression) |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
canBeTargetClass(PsiClass psiClass) |
protected PsiElement |
getElement() |
java.lang.String |
getFamilyName()
Returns the name of the family of intentions.
|
protected PsiNewExpression |
getNewExpression() |
protected static PsiJavaCodeReferenceElement |
getReferenceElement(PsiNewExpression expression) |
protected java.lang.String |
getText(java.lang.String varName) |
void |
invoke(Project project,
Editor editor,
PsiFile file)
Called when user invokes intention.
|
protected boolean |
isAllowOuterTargetClass() |
protected boolean |
isAvailableImpl(int offset) |
protected boolean |
isValidElement(PsiElement element) |
protected boolean |
rejectQualifier(PsiExpression qualifier) |
protected void |
setupClassFromNewExpression(PsiClass psiClass,
PsiNewExpression newExpression) |
static PsiMethod |
setupSuperCall(PsiClass targetClass,
PsiMethod constructor,
TemplateBuilderImpl templateBuilder) |
chooseTargetClass, filterTargetClasses, getTargetClasses, getTargetSubstitutor, getVisibility, isAvailable, positionCursor, setupGenericParameters, setupVisibility, shouldCreateStaticMember, startInWriteAction, startTemplate, startTemplate, startTemplatecanModify, getText, setText, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetElementToMakeWritablepublic CreateClassFromNewFix(PsiNewExpression newExpression)
protected PsiNewExpression getNewExpression()
public void invoke(Project project, Editor editor, PsiFile file)
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.protected void setupClassFromNewExpression(PsiClass psiClass, PsiNewExpression newExpression)
public static PsiMethod setupSuperCall(PsiClass targetClass, PsiMethod constructor, TemplateBuilderImpl templateBuilder) throws IncorrectOperationException
IncorrectOperationExceptionprotected PsiElement getElement()
getElement in class CreateFromUsageBaseFixprotected boolean isAllowOuterTargetClass()
isAllowOuterTargetClass in class CreateFromUsageBaseFixprotected boolean isValidElement(PsiElement element)
isValidElement in class CreateFromUsageBaseFixprotected boolean isAvailableImpl(int offset)
isAvailableImpl in class CreateFromUsageBaseFixprotected boolean rejectQualifier(PsiExpression qualifier)
protected java.lang.String getText(java.lang.String varName)
protected static PsiJavaCodeReferenceElement getReferenceElement(PsiNewExpression expression)
public java.lang.String getFamilyName()
IntentionActionIntentionManager.registerIntentionAndMetaData(IntentionAction, String...)protected boolean canBeTargetClass(PsiClass psiClass)
canBeTargetClass in class CreateFromUsageBaseFix