Document lineWriter = null;
try {
- if (filename.toLowerCase().endsWith(".pdf"))
- lineWriter = new PDFDocument(filename, new Font("Arial", Font.PLAIN, 10),new Font("Arial", Font.BOLD, 10));
- else if (filename.toLowerCase().endsWith(".html") ||
- filename.toLowerCase().endsWith(".htm"))
+ if (filename.toLowerCase().endsWith(".pdf")) //$NON-NLS-1$
+ lineWriter = new PDFDocument(filename, new Font("Arial", Font.PLAIN, 10),new Font("Arial", Font.BOLD, 10)); //$NON-NLS-1$ //$NON-NLS-2$
+ else if (filename.toLowerCase().endsWith(".html") || //$NON-NLS-1$
+ filename.toLowerCase().endsWith(".htm")) //$NON-NLS-1$
lineWriter = new HTMLDocument(new File(filename));
else {
- throw new Exception("File has unknow extension " + filename);
+ throw new Exception("File has unknow extension " + filename); //$NON-NLS-1$
}
export(lineWriter, reportWriter, monitor);
} catch (Exception e) {
- return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Could not generate report", e);
+ return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.ExportToPDF_ActivatorCouldNotGenerateReport, e);
} finally {
if (lineWriter != null) {
try {
}
}
- String status = "Report generated.";
+ String status = Messages.ExportToPDF_ReportGenerated;
// if (lineWriter instanceof PDFTableWriter) {
// status += " Report size " + ((PDFTableWriter)lineWriter).getCurrentPageIndex() + " pages.";
// }
try {
Map<Object, Object> context = new HashMap<Object, Object>();
- context.put("model", model);
+ context.put("model", model); //$NON-NLS-1$
context.put(Document.class, document);
context.put(ReportWriter.class, reportWriter);
- context.put("DocumentName", reportWriter.getName());
+ context.put("DocumentName", reportWriter.getName()); //$NON-NLS-1$
reportWriter.start(graph, model, document, context);
List<T> list = reportWriter.getReportItems(graph);
- monitor.beginTask("Write Report", list.size());
+ monitor.beginTask(Messages.ExportToPDF_MonitorWriteReport, list.size());
T previous = null;
T current = null;