Bug 18163 Add Import should ignore leading/trailing whitespace
It often happens to me that I have selected i.e. "Node " instead of "Node" because I made my selection by using "Shift + Ctrl + Right". When I then use Ctrl+M (Add Import) nothing happens because of the trailing whitespace within the selection.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/AddImportOnSelectionAction.java
}
		
						
	private TypeInfo selectResult(TypeInfo[] results, String containerName, Shell shell) {
		int nResults= results.length;
		
		if (nResults == 0) {
			return null;
		} else if (nResults == 1) {
			return results[0];
		}
		
		if (containerName.length() != 0) {
			for (int i= 0; i < nResults; i++) {
				TypeInfo curr= (TypeInfo) results[i];
				if (containerName.equals(curr.getTypeContainerName())) {
					return curr;
				}
			}
		}		
		ElementListSelectionDialog dialog= new ElementListSelectionDialog(getShell(), new TypeInfoLabelProvider(TypeInfoLabelProvider.SHOW_FULLYQUALIFIED));
		dialog.setTitle(JavaEditorMessages.getString("AddImportOnSelection.dialog.title")); 
		dialog.setMessage(JavaEditorMessages.getString("AddImportOnSelection.dialog.message")); 
		dialog.setElements(results);
		if (dialog.open() == dialog.OK) {
			return (TypeInfo) dialog.getFirstResult();
		}
		return null;
	}
}