Bug 7966 Class Creation Dialog generates syntax error
Build 20020115 If you create a class that will require import statements due to the interfaces it implements or the class it extends they will be created within the comment for the class. Here is an example of the comment of the generated class /* import org.eclipse.core.resources.IResourceChangeListener; import org.eclipse.jface.viewers.ITreeContentProvider; * (c) Copyright 2001 MyCorporation. * All Rights Reserved. */ Steps 1) Select the class creation dialog 2) Enter a class name 3) Choose an interface to have it inherit from 4) Hit OK - you will get an error from Eclipse 5) The class will be created - look at its definition
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
fCurrPackage= pack;
		fCanModifyPackage= canBeModified;
		String str= (pack == null) ? "" : pack.getElementName(); 
		fPackageDialogField.setText(str);
		updateEnableState();
	}	
	/**
	 * Returns the encloding type corresponding to the current input.
	 * @return Returns <code>null</code> if enclosing type is not selected or the input could not
	 * be resolved.
	 */
	public IType getEnclosingType() {
		if (isEnclosingTypeSelected()) {
			return fCurrEnclosingType;
		}
		return null;
	}
	/**
	 * Sets the package fragment.
	 * This will update model and the text of the control.
	 * @param canBeModified Selects if the enclosing type can be changed by the user
	 */	
	public void setEnclosingType(IType type, boolean canBeModified) {
		fCurrEnclosingType= type;
		fCanModifyEnclosingType= canBeModified;
		String str= (type == null) ? "" : JavaModelUtil.getFullyQualifiedName(type); 
		fEnclosingTypeDialogField.setText(str);
		updateEnableState();
	}