try { if (fValidator != null) { List jElements= new ArrayList(); for (int i= 0; i < selection.length; i++) { IType type= selection[i].getType(); if (type != null) { jElements.add(type); } else { status= new Status(IStatus.ERROR, JavaPlugin.getPluginId(), IStatus.ERROR, Messages.format(JavaUIMessages.TypeSelectionDialog_error_type_doesnot_exist, selection[i].getFullyQualifiedName()), null); break; }
if (fValidator != null) { List jElements= new ArrayList(); for (int i= 0; i < selection.length; i++) { IType type= selection[i].getType(); if (type != null) { jElements.add(type); } else { status= new Status(IStatus.ERROR, JavaPlugin.getPluginId(), IStatus.ERROR, Messages.format(JavaUIMessages.TypeSelectionDialog_error_type_doesnot_exist, selection[i].getFullyQualifiedName()), null); break;
	protected void handleWidgetSelected(TypeNameMatch[] selection) {		IStatus status= null;		if (selection.length == 0) {	    	status= new Status(IStatus.ERROR, JavaPlugin.getPluginId(), IStatus.ERROR, "",null); //$NON-NLS-1$	    } else {		    try {				if (fValidator != null) {					List jElements= new ArrayList();					for (int i= 0; i < selection.length; i++) {						IType type= selection[i].getType();						if (type != null) {							jElements.add(type);						} else {				    		status= new Status(IStatus.ERROR, JavaPlugin.getPluginId(), IStatus.ERROR,				    			Messages.format(JavaUIMessages.TypeSelectionDialog_error_type_doesnot_exist, selection[i].getFullyQualifiedName()),				    			null);				    		break;						}					}					if (status == null) {						status= fValidator.validate(jElements.toArray());					}				} else {					status= new Status(IStatus.OK, JavaPlugin.getPluginId(), IStatus.OK, "",null); //$NON-NLS-1$				}			} catch (JavaModelException e) {	    		status= new Status(IStatus.ERROR, JavaPlugin.getPluginId(), IStatus.ERROR, 	    			e.getStatus().getMessage(), null);			}	    }    	updateStatus(status);	}