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, tryCreatepublic MyInputValidator(Project project, PsiDirectory directory)
public PsiDirectory getDirectory()
public boolean checkInput(java.lang.String inputString)
InputValidatorinputString is valid. It is invoked each time
input changes.checkInput in interface InputValidatorinputString - the input to checkpublic PsiElement[] create(java.lang.String newName) throws java.lang.Exception
create in class ElementCreatorjava.lang.Exceptionpublic boolean startInWriteAction()
WriteActionAwarefalse 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 WriteActionAwaretrue if the action requires a write action (default), false otherwise.public java.lang.String getActionName(java.lang.String newName)
getActionName in class ElementCreatorpublic boolean canClose(java.lang.String inputString)
InputValidatorfalse is returned then then the message dialog will not be closed.canClose in interface InputValidatorinputString - the input to checkpublic final PsiElement[] getCreatedElements()