@Override protected void doOKAction() { final String errorString = myComponent.canCreateAllFilesForAllLocales(); if (errorString != null) { Messages.showErrorDialog(getContentPanel(), errorString); } else { final List<PsiFile> createFiles = myComponent.createPropertiesFiles(); myCreatedFiles = createFiles.toArray(new PsiElement[createFiles.size()]); super.doOKAction(); } }
@Nullable @Override protected ValidationInfo doValidate() { for (String fileName : myComponent.getFileNamesToCreate()) { if (!PathUtil.isValidFileName(fileName)) { return new ValidationInfo( String.format("File name for properties file '%s' is invalid", fileName)); } else { if (myDirectory.findFile(fileName) != null) { return new ValidationInfo(String.format("File with name '%s' already exist", fileName)); } } } return null; }
@Nullable @Override protected JComponent createCenterPanel() { return myComponent.getPanel(); }