TemplateFactory firstAvailable = (TemplateFactory) templateFactories.values()
.iterator().next();
if (firstAvailable == null) {
PrintingPlugin.log(
"Unable to locate any templates, resorting to hard coded default.", null); //$NON-NLS-1$
template = new BasicTemplateFactory().createTemplate();
} else {
template = firstAvailable.createTemplate();
}
} else {
template = templateFactory.createTemplate();