@@ -12,6 +12,7 @@
import javax.servlet.jsp.PageContext;
import org.freehep.util.export.ExportFileType;
+import org.freehep.util.export.ExportFileTypeGroups;
/**
* Various utility functions for the tags.
@@ -102,26 +103,33 @@
StringBuffer buffer = new StringBuffer("\n<p>Download:");
- List types = ExportFileType.getExportFileTypes();
- Iterator iterator = types.iterator();
- while (iterator.hasNext()) {
- ExportFileType fileType = (ExportFileType) iterator.next();
- String format = fileType.getExtensions()[0];
+ ExportFileTypeGroups groups = new ExportFileTypeGroups(ExportFileType.getExportFileTypes());
+ String[] groupNames = { ExportFileTypeGroups.VECTOR, ExportFileTypeGroups.BITMAP };
+ for (int i=0; i<groupNames.length; i++) {
+ if (i != 0) buffer.append(", ");
+ buffer.append("\n(<i>");
+ buffer.append(groupNames[i]);
+ buffer.append("</i>)\n");
+ List types = groups.getExportFileTypes(groupNames[i]);
+ Iterator iterator = types.iterator();
+ while (iterator.hasNext()) {
+ ExportFileType fileType = (ExportFileType) iterator.next();
+ String format = fileType.getExtensions()[0];
- // For the moment exclude bmp, wbmp and svgz
- if ( format.equals("bmp") || format.equals("wbmp") || format.equals("svgz") )
- continue;
+ // For the moment exclude bmp and wbmp
+ if (format.equals("bmp") || format.equals("wbmp"))
+ continue;
- plotCommand.setFormat(format);
+ plotCommand.setFormat(format);
- buffer.append("\n");
- buffer.append(" <a href=\"");
- buffer.append(urlEncode(request, plotCommand));
- buffer.append("\">");
- buffer.append(format);
- buffer.append("</a>\n");
+ buffer.append("\n");
+ buffer.append(" <a href=\"");
+ buffer.append(urlEncode(request, plotCommand));
+ buffer.append("\">");
+ buffer.append(format);
+ buffer.append("</a>\n");
+ }
}
-
buffer.append("</p>\n");
return buffer.toString();
|