});
}
private StatusInfo filenameChanged() {
StatusInfo status = new StatusInfo();
if (!fileNameField.equals("") && getScriptFolder().getSourceModule(fileNameField.getText()).exists()) { //$NON-NLS-1$
status.setError("The specified class already exists");
return status;
}
int dotIndex = fileNameField.getText().lastIndexOf('.');
if ((fileNameField.getText().length() == 0 || dotIndex == 0) && fileNameField.getText().length() > 0) {
status.setError(PHPUIMessages.PHPFileCreationWizardPage_15);
return status;
}
if (dotIndex != -1) {
String fileNameWithoutExtention = fileNameField.getText().substring(0, dotIndex);
for (int i = 0; i < fileNameWithoutExtention.length(); i++) {
char ch = fileNameWithoutExtention.charAt(i);
if (!(Character.isJavaIdentifierPart(ch) || ch == '.' || ch == '-')) {
status.setError(PHPUIMessages.PHPFileCreationWizardPage_16); //$NON-NLS-1$
return status;
}
}
}
return status;