protected class CreateElementActionBase.MyInputValidator extends ElementCreator implements InputValidator
Constructor and Description |
---|
MyInputValidator(Project project,
PsiDirectory directory) |
Modifier and Type | Method and Description |
---|---|
boolean |
canClose(java.lang.String inputString)
This method is invoked just before message dialog is closed with OK code.
|
boolean |
checkInput(java.lang.String inputString)
Checks whether the
inputString is valid. |
PsiElement[] |
create(java.lang.String newName) |
java.lang.String |
getActionName(java.lang.String newName) |
PsiElement[] |
getCreatedElements() |
PsiDirectory |
getDirectory() |
boolean |
startInWriteAction()
Indicate whether this action should be invoked inside write action.
|
getErrorMessage, tryCreate
public MyInputValidator(Project project, PsiDirectory directory)
public PsiDirectory getDirectory()
public boolean checkInput(java.lang.String inputString)
InputValidator
inputString
is valid. It is invoked each time
input changes.checkInput
in interface InputValidator
inputString
- the input to checkpublic PsiElement[] create(java.lang.String newName) throws java.lang.Exception
create
in class ElementCreator
java.lang.Exception
public boolean startInWriteAction()
WriteActionAware
false
if e.g. 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 WriteActionAware
true
if the action requires a write action (default), false
otherwise.public java.lang.String getActionName(java.lang.String newName)
getActionName
in class ElementCreator
public boolean canClose(java.lang.String inputString)
InputValidator
false
is returned then then the message dialog will not be closed.canClose
in interface InputValidator
inputString
- the input to checkpublic final PsiElement[] getCreatedElements()