IType type= (IType) dialog.getFirstResult(); fNewImport.setText(JavaModelUtil.getFullyQualifiedName(type));
IType type= (IType) dialog.getFirstResult(); if (type != null) fNewImport.setText(JavaModelUtil.getFullyQualifiedName(type));
	private void browseForClassToImport(){		IPackageFragmentRoot root= getPackageFragmentRoot(getCu());		if (root == null)			return;		IJavaSearchScope scope= SearchEngine.createJavaSearchScope(new IJavaElement[]{root.getJavaProject()});		TypeSelectionDialog dialog= new TypeSelectionDialog(getShell(), getWizard().getContainer(), IJavaSearchConstants.CLASS, scope);		dialog.setTitle(NLSUIMessages.getString("wizardPage2.Class_Selection")); //$NON-NLS-1$		dialog.setMessage(NLSUIMessages.getString("wizardPage2.Choose_the_type_to_import")); //$NON-NLS-1$		dialog.setUpperListLabel(NLSUIMessages.getString("wizardPage2.Matching_classes")); //$NON-NLS-1$		String guessTypeName= fNewImport.getText().substring(fNewImport.getText().lastIndexOf(".") + 1); //$NON-NLS-1$		dialog.setFilter(guessTypeName);		if (dialog.open() == dialog.OK) {			IType type= (IType) dialog.getFirstResult();				fNewImport.setText(JavaModelUtil.getFullyQualifiedName(type));			}	}