Bug 22994 Choose Package subdialog of New Class dialog crashes if source dir is not on java build path [dialogs]
There is no code for checking whether given IPackageFragmentRoot exists. Simmilar problem is in Choose Source Dir dialog - it allows you to select project even if it is not a source folder.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/wizards/NewContainerWizardPage.java
* 
	 */ 
	public IPackageFragmentRoot getPackageFragmentRoot() {
		return fCurrRoot;
	}
	/**
	 * Returns the current text of source folder text field.
	 * 
	 * @return the text of the source folder text field
	 */ 	
	public String getPackageFragmentRootText() {
		return fContainerDialogField.getText();
	}
	
	
	/**
	 * Sets the current source folder (model and text field) to the given package
	 * fragment root.
	 * 
	 * @param canBeModified if <code>false</code> the source folder field can 
	 * not be changed by the user. If <code>true</code> the field is editable
	 */ 
	public void setPackageFragmentRoot(IPackageFragmentRoot root, boolean canBeModified) {
		fCurrRoot= root;
		String str= (root == null) ? "" : root.getPath().makeRelative().toString(); 
		fContainerDialogField.setText(str);
		fContainerDialogField.setEnabled(canBeModified);
	}