mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
invoke on PsiFile made final
This commit is contained in:
+3
-4
@@ -90,10 +90,9 @@ public class RemoveRedundantElseAction extends PsiElementBaseIntentionAction {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invoke(@NotNull Project project, Editor editor, PsiFile file) throws IncorrectOperationException {
|
||||
if (!CodeInsightUtilBase.prepareFileForWrite(file)) return;
|
||||
PsiElement elementAt = file.findElementAt(editor.getCaretModel().getOffset());
|
||||
PsiIfStatement ifStatement = (PsiIfStatement)elementAt.getParent();
|
||||
public void invoke(@NotNull Project project, Editor editor, @NotNull PsiElement element) throws IncorrectOperationException {
|
||||
if (!CodeInsightUtilBase.preparePsiElementForWrite(element)) return;
|
||||
PsiIfStatement ifStatement = (PsiIfStatement)element.getParent();
|
||||
LOG.assertTrue(ifStatement != null && ifStatement.getElseBranch() != null);
|
||||
PsiStatement elseBranch = ifStatement.getElseBranch();
|
||||
if (elseBranch instanceof PsiBlockStatement) {
|
||||
|
||||
+4
-4
@@ -113,12 +113,12 @@ public class SurroundWithArrayFix extends PsiElementBaseIntentionAction {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invoke(@NotNull final Project project, final Editor editor, final PsiFile file) throws IncorrectOperationException {
|
||||
if (!CodeInsightUtilBase.prepareFileForWrite(file)) return;
|
||||
public void invoke(@NotNull Project project, Editor editor, @NotNull PsiElement element) throws IncorrectOperationException {
|
||||
if (!CodeInsightUtilBase.preparePsiElementForWrite(element)) return;
|
||||
final PsiElementFactory elementFactory = JavaPsiFacade.getInstance(project).getElementFactory();
|
||||
final PsiExpression expression = getExpression(file.findElementAt(editor.getCaretModel().getOffset()));
|
||||
final PsiExpression expression = getExpression(element);
|
||||
assert expression != null;
|
||||
final PsiExpression toReplace = elementFactory.createExpressionFromText(getArrayCreation(expression), file);
|
||||
final PsiExpression toReplace = elementFactory.createExpressionFromText(getArrayCreation(expression), element);
|
||||
JavaCodeStyleManager.getInstance(project).shortenClassReferences(expression.replace(toReplace));
|
||||
}
|
||||
|
||||
|
||||
+3
-4
@@ -160,11 +160,10 @@ public class AddOnDemandStaticImportAction extends PsiElementBaseIntentionAction
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void invoke(@NotNull final Project project, final Editor editor, PsiFile file) throws IncorrectOperationException {
|
||||
PsiElement element = file.findElementAt(editor.getCaretModel().getOffset());
|
||||
invoke(project, file, editor, element);
|
||||
public void invoke(@NotNull Project project, Editor editor, @NotNull PsiElement element) throws IncorrectOperationException {
|
||||
invoke(project, element.getContainingFile(), editor, element);
|
||||
}
|
||||
|
||||
private static boolean isParameterizedReference(final PsiJavaCodeReferenceElement expression) {
|
||||
|
||||
+3
-4
@@ -202,10 +202,9 @@ public class AddSingleMemberStaticImportAction extends PsiElementBaseIntentionAc
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void invoke(@NotNull final Project project, final Editor editor, PsiFile file) throws IncorrectOperationException {
|
||||
PsiElement element = file.findElementAt(editor.getCaretModel().getOffset());
|
||||
invoke(file, element);
|
||||
public void invoke(@NotNull Project project, Editor editor, @NotNull PsiElement element) throws IncorrectOperationException {
|
||||
invoke(element.getContainingFile(), element);
|
||||
}
|
||||
}
|
||||
|
||||
+6
-10
@@ -67,16 +67,17 @@ public abstract class BaseMoveInitializerToMethodAction extends PsiElementBaseIn
|
||||
@NotNull
|
||||
protected abstract Collection<String> getUnsuitableModifiers();
|
||||
|
||||
@Override
|
||||
public final void invoke(@NotNull Project project, Editor editor, PsiFile file) throws IncorrectOperationException {
|
||||
if (!CodeInsightUtilBase.prepareFileForWrite(file)) return;
|
||||
|
||||
final PsiField field = getFieldAtCaret(editor, file);
|
||||
@Override
|
||||
public void invoke(@NotNull Project project, Editor editor, @NotNull PsiElement element) throws IncorrectOperationException {
|
||||
if (!CodeInsightUtilBase.preparePsiElementForWrite(element)) return;
|
||||
|
||||
final PsiField field = PsiTreeUtil.getParentOfType(element, PsiField.class);
|
||||
assert field != null;
|
||||
final PsiClass aClass = field.getContainingClass();
|
||||
if (aClass == null) return;
|
||||
|
||||
final Collection<PsiMethod> methodsToAddInitialization = getOrCreateMethods(project, editor, file, aClass);
|
||||
final Collection<PsiMethod> methodsToAddInitialization = getOrCreateMethods(project, editor, element.getContainingFile(), aClass);
|
||||
|
||||
|
||||
final List<PsiExpressionStatement> assignments = addFieldAssignments(field, methodsToAddInitialization);
|
||||
@@ -117,11 +118,6 @@ public abstract class BaseMoveInitializerToMethodAction extends PsiElementBaseIn
|
||||
@NotNull
|
||||
protected abstract Collection<PsiMethod> getOrCreateMethods(@NotNull Project project, @NotNull Editor editor, PsiFile file, @NotNull PsiClass aClass);
|
||||
|
||||
@Nullable
|
||||
private static PsiField getFieldAtCaret(@NotNull Editor editor, @NotNull PsiFile file) {
|
||||
final int offset = editor.getCaretModel().getOffset();
|
||||
return PsiTreeUtil.getParentOfType(file.findElementAt(offset), PsiField.class);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static PsiExpressionStatement addAssignment(@NotNull PsiCodeBlock codeBlock, @NotNull PsiField field) throws IncorrectOperationException {
|
||||
|
||||
@@ -30,16 +30,6 @@ import javax.swing.*;
|
||||
* @author Danila Ponomarenko
|
||||
*/
|
||||
public abstract class BaseRefactoringAction extends PsiElementBaseIntentionAction implements RefactoringAction{
|
||||
@Override
|
||||
public final boolean isAvailable(@NotNull Project project, Editor editor, PsiFile file) {
|
||||
return super.isAvailable(project, editor, file);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void invoke(@NotNull Project project, Editor editor, PsiFile file) throws IncorrectOperationException {
|
||||
super.invoke(project, editor, file);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final boolean isAvailable(@NotNull Project project, Editor editor, @NotNull PsiElement element) {
|
||||
return !(element instanceof SyntheticElement) && isAvailableOverride(project, editor, element);
|
||||
|
||||
+3
-3
@@ -110,9 +110,9 @@ public class ColorChooserIntentionAction extends PsiElementBaseIntentionAction {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invoke(@NotNull final Project project, final Editor editor, final PsiFile file) throws IncorrectOperationException {
|
||||
if (!CodeInsightUtilBase.prepareFileForWrite(file)) return;
|
||||
PsiElement element = file.findElementAt(editor.getCaretModel().getOffset());
|
||||
public void invoke(@NotNull Project project, Editor editor, @NotNull PsiElement element) throws IncorrectOperationException {
|
||||
if (!CodeInsightUtilBase.preparePsiElementForWrite(element)) return;
|
||||
|
||||
final JComponent editorComponent = editor.getComponent();
|
||||
if (isInsideDecodeOrGetColorMethod(element)) {
|
||||
invokeForMethodParam(editorComponent, element);
|
||||
|
||||
+3
-7
@@ -15,10 +15,8 @@
|
||||
*/
|
||||
package com.intellij.codeInsight.intention.impl;
|
||||
|
||||
import com.intellij.codeInsight.intention.PsiElementBaseIntentionAction;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.psi.PsiReference;
|
||||
import com.intellij.psi.impl.source.resolve.reference.impl.PsiMultiReference;
|
||||
@@ -32,18 +30,16 @@ import org.jetbrains.annotations.Nullable;
|
||||
/**
|
||||
* @author spleaner
|
||||
*/
|
||||
public class ConvertAbsolutePathToRelativeIntentionAction extends PsiElementBaseIntentionAction {
|
||||
public class ConvertAbsolutePathToRelativeIntentionAction extends BaseIntentionAction {
|
||||
|
||||
protected boolean isConvertToRelative() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAvailable(@NotNull Project project, Editor editor, @NotNull PsiElement element) {
|
||||
final PsiFile containingFile = element.getContainingFile();
|
||||
if (containingFile == null) return false;
|
||||
public boolean isAvailable(@NotNull Project project, Editor editor, PsiFile file) {
|
||||
|
||||
final PsiReference reference = containingFile.findReferenceAt(editor.getCaretModel().getOffset());
|
||||
final PsiReference reference = file.findReferenceAt(editor.getCaretModel().getOffset());
|
||||
final FileReference fileReference = reference == null ? null : findFileReference(reference);
|
||||
|
||||
if (fileReference != null) {
|
||||
|
||||
+3
-8
@@ -65,16 +65,12 @@ public class ExpandStaticImportAction extends PsiElementBaseIntentionAction {
|
||||
}
|
||||
|
||||
public void invoke(final Project project, final PsiFile file, final Editor editor, PsiElement element) {
|
||||
if (!CodeInsightUtilBase.prepareFileForWrite(file)) return;
|
||||
if (!CodeInsightUtilBase.preparePsiElementForWrite(element)) return;
|
||||
|
||||
final PsiJavaCodeReferenceElement refExpr = (PsiJavaCodeReferenceElement)element.getParent();
|
||||
|
||||
final PsiImportStaticStatement staticImport = (PsiImportStaticStatement)refExpr.advancedResolve(true).getCurrentFileResolveScope();
|
||||
|
||||
|
||||
final List<PsiJavaCodeReferenceElement> expressionToExpand = collectReferencesThrough(file, refExpr, staticImport);
|
||||
|
||||
|
||||
if (expressionToExpand.isEmpty()) {
|
||||
expand(refExpr, staticImport);
|
||||
staticImport.delete();
|
||||
@@ -109,8 +105,7 @@ public class ExpandStaticImportAction extends PsiElementBaseIntentionAction {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invoke(@NotNull final Project project, final Editor editor, PsiFile file) throws IncorrectOperationException {
|
||||
PsiElement element = file.findElementAt(editor.getCaretModel().getOffset());
|
||||
invoke(project, file, editor, element);
|
||||
public void invoke(@NotNull Project project, Editor editor, @NotNull PsiElement element) throws IncorrectOperationException {
|
||||
invoke(project, element.getContainingFile(), editor, element);
|
||||
}
|
||||
}
|
||||
|
||||
+3
-4
@@ -80,11 +80,10 @@ public class InvertIfConditionAction extends PsiElementBaseIntentionAction {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invoke(@NotNull Project project, Editor editor, PsiFile file) throws IncorrectOperationException {
|
||||
if (!CodeInsightUtilBase.prepareFileForWrite(file)) return;
|
||||
public void invoke(@NotNull Project project, Editor editor, @NotNull PsiElement element) throws IncorrectOperationException {
|
||||
if (!CodeInsightUtilBase.preparePsiElementForWrite(element)) return;
|
||||
|
||||
PsiIfStatement ifStatement = PsiTreeUtil.getParentOfType(file.findElementAt(
|
||||
editor.getCaretModel().getOffset()), PsiIfStatement.class);
|
||||
PsiIfStatement ifStatement = PsiTreeUtil.getParentOfType(element, PsiIfStatement.class);
|
||||
|
||||
LOG.assertTrue(ifStatement != null);
|
||||
PsiElement block = findCodeBlock(ifStatement);
|
||||
|
||||
+1
-4
@@ -93,10 +93,7 @@ public class MakeTypeGenericAction extends PsiElementBaseIntentionAction {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invoke(@NotNull Project project, Editor editor, PsiFile file) throws IncorrectOperationException {
|
||||
final CaretModel caretModel = editor.getCaretModel();
|
||||
final int position = caretModel.getOffset();
|
||||
final PsiElement element = file.findElementAt(position);
|
||||
public void invoke(@NotNull Project project, Editor editor, @NotNull PsiElement element) throws IncorrectOperationException {
|
||||
Pair<PsiVariable, PsiType> pair = findVariable(element);
|
||||
if (pair == null) return;
|
||||
PsiVariable variable = pair.getFirst();
|
||||
|
||||
+23
-25
@@ -64,7 +64,7 @@ public class SplitDeclarationAction extends PsiElementBaseIntentionAction {
|
||||
PsiElement nextField = field.getNextSibling();
|
||||
while (nextField != null && !(nextField instanceof PsiField)) nextField = nextField.getNextSibling();
|
||||
|
||||
if (nextField != null && ((PsiField) nextField).getTypeElement() == typeElement) return true;
|
||||
if (nextField != null && ((PsiField)nextField).getTypeElement() == typeElement) return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -74,11 +74,12 @@ public class SplitDeclarationAction extends PsiElementBaseIntentionAction {
|
||||
if (declaredElements.length == 0) return false;
|
||||
if (!(declaredElements[0] instanceof PsiLocalVariable)) return false;
|
||||
if (declaredElements.length == 1) {
|
||||
PsiLocalVariable var = (PsiLocalVariable) declaredElements[0];
|
||||
PsiLocalVariable var = (PsiLocalVariable)declaredElements[0];
|
||||
if (var.getInitializer() == null) return false;
|
||||
setText(CodeInsightBundle.message("intention.split.declaration.assignment.text"));
|
||||
return true;
|
||||
} else if (declaredElements.length > 1) {
|
||||
}
|
||||
else if (declaredElements.length > 1) {
|
||||
if (decl.getParent() instanceof PsiForStatement) return false;
|
||||
|
||||
setText(CodeInsightBundle.message("intention.split.declaration.text"));
|
||||
@@ -89,23 +90,17 @@ public class SplitDeclarationAction extends PsiElementBaseIntentionAction {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invoke(@NotNull Project project, Editor editor, PsiFile file) throws IncorrectOperationException {
|
||||
if (!CodeInsightUtilBase.prepareFileForWrite(file)) return;
|
||||
public void invoke(@NotNull Project project, Editor editor, @NotNull PsiElement element) throws IncorrectOperationException {
|
||||
if (!CodeInsightUtilBase.preparePsiElementForWrite(element)) return;
|
||||
|
||||
PsiManager psiManager = PsiManager.getInstance(project);
|
||||
int offset = editor.getCaretModel().getOffset();
|
||||
|
||||
PsiElement token = file.findElementAt(offset);
|
||||
PsiDeclarationStatement decl = PsiTreeUtil.getParentOfType(
|
||||
token,
|
||||
PsiDeclarationStatement.class
|
||||
);
|
||||
final PsiDeclarationStatement decl = PsiTreeUtil.getParentOfType(element, PsiDeclarationStatement.class);
|
||||
|
||||
final PsiManager psiManager = PsiManager.getInstance(project);
|
||||
if (decl != null) {
|
||||
invokeOnDeclarationStatement(decl, psiManager, project);
|
||||
}
|
||||
else {
|
||||
PsiField field = PsiTreeUtil.getParentOfType(token, PsiField.class);
|
||||
PsiField field = PsiTreeUtil.getParentOfType(element, PsiField.class);
|
||||
if (field != null) {
|
||||
field.normalizeDeclaration();
|
||||
}
|
||||
@@ -113,19 +108,19 @@ public class SplitDeclarationAction extends PsiElementBaseIntentionAction {
|
||||
}
|
||||
|
||||
private static void invokeOnDeclarationStatement(PsiDeclarationStatement decl, PsiManager psiManager,
|
||||
Project project) throws IncorrectOperationException {
|
||||
Project project) throws IncorrectOperationException {
|
||||
if (decl.getDeclaredElements().length == 1) {
|
||||
PsiLocalVariable var = (PsiLocalVariable) decl.getDeclaredElements()[0];
|
||||
PsiLocalVariable var = (PsiLocalVariable)decl.getDeclaredElements()[0];
|
||||
var.normalizeDeclaration();
|
||||
PsiExpressionStatement statement = (PsiExpressionStatement) JavaPsiFacade.getInstance(psiManager.getProject()).getElementFactory()
|
||||
.createStatementFromText(var.getName() + "=xxx;", null);
|
||||
statement = (PsiExpressionStatement) CodeStyleManager.getInstance(project).reformat(statement);
|
||||
PsiAssignmentExpression assignment = (PsiAssignmentExpression) statement.getExpression();
|
||||
PsiExpressionStatement statement = (PsiExpressionStatement)JavaPsiFacade.getInstance(psiManager.getProject()).getElementFactory()
|
||||
.createStatementFromText(var.getName() + "=xxx;", null);
|
||||
statement = (PsiExpressionStatement)CodeStyleManager.getInstance(project).reformat(statement);
|
||||
PsiAssignmentExpression assignment = (PsiAssignmentExpression)statement.getExpression();
|
||||
PsiExpression initializer = var.getInitializer();
|
||||
PsiExpression rExpression;
|
||||
if (initializer instanceof PsiArrayInitializerExpression) {
|
||||
rExpression = JavaPsiFacade.getInstance(psiManager.getProject()).getElementFactory().createExpressionFromText(
|
||||
"new " + var.getTypeElement().getText() + " " + initializer.getText(), null
|
||||
"new " + var.getTypeElement().getText() + " " + initializer.getText(), null
|
||||
);
|
||||
}
|
||||
else {
|
||||
@@ -157,14 +152,17 @@ public class SplitDeclarationAction extends PsiElementBaseIntentionAction {
|
||||
codeBlock.add(varDeclStatement);
|
||||
codeBlock.add(block);
|
||||
block.replace(blockStatement);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
parent.addBefore(varDeclStatement, block);
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
block.addAfter(statement, decl);
|
||||
}
|
||||
} else {
|
||||
((PsiLocalVariable) decl.getDeclaredElements()[0]).normalizeDeclaration();
|
||||
}
|
||||
else {
|
||||
((PsiLocalVariable)decl.getDeclaredElements()[0]).normalizeDeclaration();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,14 +72,11 @@ public class SplitIfAction extends PsiElementBaseIntentionAction {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invoke(@NotNull Project project, Editor editor, PsiFile file) {
|
||||
|
||||
public void invoke(@NotNull Project project, Editor editor, @NotNull PsiElement element) throws IncorrectOperationException {
|
||||
try {
|
||||
if (!CodeInsightUtilBase.prepareFileForWrite(file)) { return; }
|
||||
if (!CodeInsightUtilBase.preparePsiElementForWrite(element)) return;
|
||||
|
||||
int offset = editor.getCaretModel().getOffset();
|
||||
|
||||
PsiJavaToken token = (PsiJavaToken)file.findElementAt(offset);
|
||||
PsiJavaToken token = (PsiJavaToken)element;
|
||||
LOG.assertTrue(token.getTokenType() == JavaTokenType.ANDAND || token.getTokenType() == JavaTokenType.OROR);
|
||||
|
||||
PsiPolyadicExpression expression = (PsiPolyadicExpression)token.getParent();
|
||||
|
||||
+9
-4
@@ -19,6 +19,7 @@ import com.intellij.codeInsight.ChangeContextUtil;
|
||||
import com.intellij.codeInsight.CodeInsightUtilBase;
|
||||
import com.intellij.codeInsight.TargetElementUtilBase;
|
||||
import com.intellij.codeInsight.intention.PsiElementBaseIntentionAction;
|
||||
import com.intellij.codeInsight.intention.impl.BaseIntentionAction;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.application.Result;
|
||||
import com.intellij.openapi.command.WriteCommandAction;
|
||||
@@ -41,8 +42,8 @@ import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class ReplaceImplementsWithStaticImportAction extends PsiElementBaseIntentionAction {
|
||||
private static final Logger LOG = Logger.getInstance("#" + ReplaceImplementsWithStaticImportAction.class.getName());
|
||||
public class ReplaceImplementsWithStaticImportAction extends BaseIntentionAction {
|
||||
private static final Logger LOG = Logger.getInstance(ReplaceImplementsWithStaticImportAction.class);
|
||||
@NonNls private static final String FIND_CONSTANT_FIELD_USAGES = "Find constant field usages...";
|
||||
|
||||
@NotNull
|
||||
@@ -55,8 +56,11 @@ public class ReplaceImplementsWithStaticImportAction extends PsiElementBaseInten
|
||||
return getText();
|
||||
}
|
||||
|
||||
public boolean isAvailable(@NotNull Project project, Editor editor, @NotNull PsiElement element) {
|
||||
if (!(element.getContainingFile() instanceof PsiJavaFile)) return false;
|
||||
@Override
|
||||
public boolean isAvailable(@NotNull Project project, Editor editor, PsiFile file) {
|
||||
if (!(file instanceof PsiJavaFile)) return false;
|
||||
|
||||
final PsiElement element = file.findElementAt(editor.getCaretModel().getOffset());
|
||||
if (element instanceof PsiIdentifier) {
|
||||
final PsiElement parent = element.getParent();
|
||||
if (parent instanceof PsiClass) {
|
||||
@@ -99,6 +103,7 @@ public class ReplaceImplementsWithStaticImportAction extends PsiElementBaseInten
|
||||
return targetClass.getAllFields().length > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invoke(@NotNull final Project project, final Editor editor, final PsiFile file) throws IncorrectOperationException {
|
||||
if (!CodeInsightUtilBase.preparePsiElementForWrite(file)) return;
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
package com.intellij.testIntegration.createTest;
|
||||
|
||||
import com.intellij.codeInsight.CodeInsightBundle;
|
||||
import com.intellij.codeInsight.CodeInsightUtilBase;
|
||||
import com.intellij.codeInsight.intention.PsiElementBaseIntentionAction;
|
||||
import com.intellij.openapi.command.CommandProcessor;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
@@ -87,15 +88,15 @@ public class CreateTestAction extends PsiElementBaseIntentionAction {
|
||||
return rm.getFileIndex().isInTestSourceContent(f);
|
||||
}
|
||||
|
||||
public void invoke(@NotNull final Project project, final Editor editor, PsiFile file) throws IncorrectOperationException {
|
||||
PsiElement element = file.findElementAt(editor.getCaretModel().getOffset());
|
||||
|
||||
final Module srcModule = ModuleUtil.findModuleForPsiElement(file);
|
||||
@Override
|
||||
public void invoke(final @NotNull Project project, Editor editor, @NotNull PsiElement element) throws IncorrectOperationException {
|
||||
if (!CodeInsightUtilBase.preparePsiElementForWrite(element)) return;
|
||||
final Module srcModule = ModuleUtil.findModuleForPsiElement(element);
|
||||
final PsiClass srcClass = getContainingClass(element);
|
||||
|
||||
if (srcClass == null) return;
|
||||
|
||||
PsiDirectory srcDir = file.getContainingDirectory();
|
||||
PsiDirectory srcDir = element.getContainingFile().getContainingDirectory();
|
||||
PsiPackage srcPackage = JavaDirectoryService.getInstance().getPackage(srcDir);
|
||||
|
||||
final CreateTestDialog d = new CreateTestDialog(project,
|
||||
|
||||
Reference in New Issue
Block a user