Bug 34156 new class wizard defaults to wrong project
20030307 1. new workspace 2. import org.apache.ant project as binary. 3. switch to java perspective. 4. use new project button to create project zzz 5. use new class button. Notice that the source holder is org.apache.ant. The gray-lighted element in the package explorer is zzz
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/wizards/NewContainerWizardPage.java
}
			
			if (part instanceof IViewPartInputProvider) {
				Object elem= ((IViewPartInputProvider)part).getViewPartInput();
				if (elem instanceof IJavaElement) {
					jelem= (IJavaElement) elem;
				}
			}
		}
		if (jelem == null || jelem.getElementType() == IJavaElement.JAVA_MODEL) {
			IProject[] projects= getWorkspaceRoot().getProjects();
			if (projects.length > 0) {
				jelem= JavaCore.create(projects[0]);
			}
		}
		return jelem;
	}
	
	/**
	 * Returns the recommended maximum width for text fields (in pixels). This
	 * method requires that createContent has been called before this method is
	 * call. Subclasses may override to change the maximum width for text 
	 * fields.
	 * 
	 * @return the recommended maximum width for text fields.
	 */
	protected int getMaxFieldWidth() {
		return convertWidthInCharsToPixels(40);
	}