public class CreateTestAction extends PsiElementBaseIntentionAction
EMPTY_ARRAY| Constructor and Description |
|---|
CreateTestAction() |
| Modifier and Type | Method and Description |
|---|---|
protected static void |
checkForTestRoots(Module srcModule,
java.util.Set<? super VirtualFile> testFolders)
Deprecated.
use
computeTestRoots(Module) instead |
protected static java.util.List<VirtualFile> |
computeTestRoots(Module mainModule) |
protected CreateTestDialog |
createTestDialog(Project project,
Module srcModule,
PsiClass srcClass,
PsiPackage srcPackage) |
protected static PsiClass |
getContainingClass(PsiElement element) |
java.lang.String |
getFamilyName()
Returns the name of the family of intentions.
|
java.lang.String |
getText()
Returns text to be shown in the list of available actions, if this action
is available.
|
void |
invoke(Project project,
Editor editor,
PsiElement element)
Invokes intention action for the element under caret.
|
boolean |
isAvailable(Project project,
Editor editor,
PsiElement element)
Checks whether this intention is available at a caret offset in file.
|
static boolean |
isAvailableForElement(PsiElement element) |
boolean |
startInWriteAction()
Indicate whether this action should be invoked inside write action.
|
static Module |
suggestModuleForTests(Project project,
Module productionModule) |
checkFile, invoke, isAvailablecanModify, setText, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetElementToMakeWritablepublic java.lang.String getText()
IntentionActiongetText in interface IntentionActiongetText in class BaseIntentionActionIntentionAction.isAvailable(Project, Editor, PsiFile)public java.lang.String getFamilyName()
IntentionActionIntentionManager.registerIntentionAndMetaData(IntentionAction, String...)public boolean isAvailable(Project project, Editor editor, PsiElement element)
PsiElementBaseIntentionActionisAvailable in class PsiElementBaseIntentionActionproject - 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 boolean isAvailableForElement(PsiElement element)
public void invoke(Project project, Editor editor, PsiElement element) throws IncorrectOperationException
PsiElementBaseIntentionActioninvoke in class PsiElementBaseIntentionActionproject - the project in which the file is opened.editor - the editor for the file.element - the element under cursor.IncorrectOperationExceptionpublic static Module suggestModuleForTests(Project project, Module productionModule)
protected CreateTestDialog createTestDialog(Project project, Module srcModule, PsiClass srcClass, PsiPackage srcPackage)
protected static java.util.List<VirtualFile> computeTestRoots(Module mainModule)
@Deprecated protected static void checkForTestRoots(Module srcModule, java.util.Set<? super VirtualFile> testFolders)
computeTestRoots(Module) insteadprotected static PsiClass getContainingClass(PsiElement element)
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.