Bug 6009 New class wizard doesn't get context right for nested classes
Build 20011106. - with a .java file open in the editor, - click the new class button - check "Enclosing Type" - the field is blank - it should default to the current type in the editor
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
}		
		
		if (!isEnclosingTypeSelected()) {
			IPackageFragment pack= getPackageFragment();
			if (pack != null) {
				ICompilationUnit cu= pack.getCompilationUnit(typeName + ".java"); 
				if (cu.exists()) {
					status.setError(NewWizardMessages.getString("TypePage.error.TypeNameExists")); 
					return status;
				}
			}
		} else {
			IType type= getEnclosingType();
			if (type != null) {
				IType member= type.getType(typeName);
				if (member.exists()) {
					status.setError(NewWizardMessages.getString("TypePage.error.TypeNameExists")); 
					return status;
				}
			}
		}
		return status;
	}
	
	/**
	 * Called when the superclass name has changed.
	 * The method validates the superclass name and returns the status of the validation.
	 * Can be extended to add more validation
	 */