Bug 4978 Completion list not ordered as expected
Type "fo" and press ctrl-space The best matches are the "for" templates but they are at the end of the list
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/TemplatePreferencePage.java
fTableViewer.refresh();
			fTableViewer.setAllChecked(false);
			fTableViewer.setCheckedElements(getEnabledTemplates());									
		} catch (IOException e) {			
			JavaPlugin.log(e);
			MessageDialog.openError(getShell(), TemplateMessages.getString("TemplatePreferencePage.error.import"), e.getMessage()); 			
		}
	}
	
	private void exportAll() {
		export(TemplateSet.getInstance());	
	}
	private void export() {
		IStructuredSelection selection= (IStructuredSelection) fTableViewer.getSelection();
		Object[] templates= selection.toArray();
		
		TemplateSet templateSet= new TemplateSet();
		for (int i= 0; i != templates.length; i++)
			templateSet.add((Template) templates[i]);
		
		export(templateSet);	
	}
	
	private void export(TemplateSet templateSet) {
		FileDialog dialog= new FileDialog(getShell(), SWT.SAVE);
		dialog.setText(TemplateMessages.getFormattedString("TemplatePreferencePage.export.title", new Integer(templateSet.getTemplates().length))); 
		dialog.setFilterExtensions(new String[] {TemplateMessages.getString("TemplatePreferencePage.export.extension")}); 
		dialog.setFileName(TemplateMessages.getString("TemplatePreferencePage.export.filename")); 
		String path= dialog.open();