import com.android.ide.eclipse.adt.internal.resources.manager.ResourceManager;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jdt.core.JavaConventions;
import org.eclipse.jface.dialogs.IInputValidator;
import java.util.HashSet;
}
}
+ String level = "1.5"; //$NON-NLS-1$
+ IStatus validIdentifier = JavaConventions.validateIdentifier(newText, level, level);
+ if (!validIdentifier.isOK()) {
+ return String.format("%1$s is not a valid name (reserved Java keyword)", newText);
+ }
+
if (mExisting != null && mExisting.contains(newText)) {
return String.format("%1$s already exists", newText);
}