Bug 123985 [code templates] Code template preference page wrongly computes selection
I20060110-1026 Steps to reproduce: - Goto code template preference page - Select tree nodes "Code", "New Java files" and "Class body" - Press Export... -> File dialog with caption "Exporting 12 Code Template(s)" appears -> Caption should be "Export Templates" as in other places -> Only 10 templates should be exported
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CodeTemplateBlock.java
}
		}
	}
	
	private void exportAll() {
		export(fTemplateStore.getTemplateData());	
	}
	
	private void export(List selected) {
		List datas= new ArrayList();
		for (int i= 0; i < selected.size(); i++) {
			Object curr= selected.get(i);
			if (curr instanceof TemplatePersistenceData) {
				datas.add(curr);
			} else {
				TemplatePersistenceData[] cat= getTemplateOfCategory(curr == COMMENT_NODE);
				datas.addAll(Arrays.asList(cat));
			}
		}
		export((TemplatePersistenceData[]) datas.toArray(new TemplatePersistenceData[datas.size()]));
	}
	
	private void export(TemplatePersistenceData[] templates) {
		FileDialog dialog= new FileDialog(getShell(), SWT.SAVE);
		dialog.setText(Messages.format(PreferencesMessages.CodeTemplateBlock_export_title, String.valueOf(templates.length))); 
		dialog.setFilterExtensions(new String[] {PreferencesMessages.CodeTemplateBlock_export_extension}); 
		dialog.setFileName(PreferencesMessages.CodeTemplateBlock_export_filename); 
		String path= dialog.open();
		if (path == null)
			return;