*/
private final class Validator implements Observer {
public void update(Observable o, Object arg) {
final IWorkspace workspace = JavaPlugin.getWorkspace();
final String name = null;// fNameGroup.getName();
// check whether the project name field is empty
if ((name == null) || (name.length() == 0)) {
setErrorMessage(null);
setMessage("Enter a project name.");
setPageComplete(false);
return;
}
// check whether the project name is valid
@SuppressWarnings("unused")
final IStatus nameStatus = workspace.validateName(name, IResource.PROJECT);
if (!nameStatus.isOK()) {
setErrorMessage(nameStatus.getMessage());
setPageComplete(false);
return;
}
// check whether project already exists
final IProject handle = workspace.getRoot().getProject(name);
if (handle.exists()) {
setErrorMessage("A project with this name already exists.");
setPageComplete(false);
return;
}