]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.document.linking.ui/src/org/simantics/document/linking/report/ExportToPDF.java
Externalize org.simantics.document.linking.ui
[simantics/platform.git] / bundles / org.simantics.document.linking.ui / src / org / simantics / document / linking / report / ExportToPDF.java
index 2bfdf79c0a0f850308fd03423eb24a62fee830cf..f9645042bbc2b8b5fc97f85b4f041d2286f8cd2c 100644 (file)
@@ -84,18 +84,18 @@ public class ExportToPDF {
                
                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 {
@@ -106,7 +106,7 @@ public class ExportToPDF {
                        }
                        
                }
-               String status  = "Report generated.";
+               String status  = Messages.ExportToPDF_ReportGenerated;
 //             if (lineWriter instanceof PDFTableWriter) {
 //                     status += " Report size " + ((PDFTableWriter)lineWriter).getCurrentPageIndex() + " pages.";
 //             }
@@ -124,16 +124,16 @@ public class ExportToPDF {
                                
                                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;