]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.document.linking.ui/src/org/simantics/document/linking/wizard/ReportGeneratePage.java
Externalize org.simantics.document.linking.ui
[simantics/platform.git] / bundles / org.simantics.document.linking.ui / src / org / simantics / document / linking / wizard / ReportGeneratePage.java
index 4db863f2af714f72c31f5c6ab96d960509208348..39fb639836c9b2a994a4b90705e794a862431804 100644 (file)
@@ -7,6 +7,7 @@ import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.jface.operation.IRunnableWithProgress;
 import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.osgi.util.NLS;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.SelectionAdapter;
 import org.eclipse.swt.events.SelectionEvent;
@@ -70,17 +71,17 @@ public class ReportGeneratePage extends WizardPage {
                Composite composite = new Composite(parent, SWT.NONE);
                composite.setLayout(new GridLayout(2,false));
                Label label = new Label(composite, SWT.NONE);
-               label.setText("File:");
+               label.setText(Messages.ReportGeneratePage_File);
                fileLabel = new Label(composite, SWT.NONE);
                label = new Label(composite, SWT.NONE);
-               label.setText("Report:");
+               label.setText(Messages.ReportGeneratePage_Report);
                reportLabel = new Label(composite, SWT.NONE);
                label = new Label(composite, SWT.NONE);
-               label.setText("Status:");
+               label.setText(Messages.ReportGeneratePage_Status);
                this.statusLabel = new Label(composite, SWT.NONE);
-               this.statusLabel.setText("Report has not been generated");
+               this.statusLabel.setText(Messages.ReportGeneratePage_ReportNotGenerated);
                generateButton = new Button(composite, SWT.PUSH);
-               generateButton.setText("Generate report");
+               generateButton.setText(Messages.ReportGeneratePage_GenerateReport);
                generateButton.addSelectionListener(new SelectionAdapter() {
                        @Override
                        public void widgetSelected(SelectionEvent e) {
@@ -88,7 +89,7 @@ public class ReportGeneratePage extends WizardPage {
                        }
                });
                showButton = new Button(composite, SWT.PUSH);
-               showButton.setText("Show Report");
+               showButton.setText(Messages.ReportGeneratePage_ShowReport);
                showButton.addSelectionListener(new SelectionAdapter() {
                        
                        @Override
@@ -109,13 +110,13 @@ public class ReportGeneratePage extends WizardPage {
        }
        
        private void updateContent() {
-               fileLabel.setText(filename == null ? "File has not been selected" : filename);
-               reportLabel.setText(reportWriter == null ? "Report Writer has not been selected" : reportWriter.getName());
+               fileLabel.setText(filename == null ? Messages.ReportGeneratePage_FileNotSelected : filename);
+               reportLabel.setText(reportWriter == null ? Messages.ReportGeneratePage_ReportWriterNotSelected : reportWriter.getName());
                generateButton.setEnabled(filename != null && reportWriter != null && model != null);
                showButton.setEnabled(generated);
                generateButton.setEnabled(!generated);
                if (!generated)
-                       statusLabel.setText("Report has not been generated");
+                       statusLabel.setText(Messages.ReportGeneratePage_ReportNotGenerated);
        }
        
        public void setGenerated(boolean b) {
@@ -125,7 +126,7 @@ public class ReportGeneratePage extends WizardPage {
        
        private void generate() {
                generateButton.setEnabled(false);
-               statusLabel.setText("Generating report");
+               statusLabel.setText(Messages.ReportGeneratePage_GeneratingReport);
                try {
                        getWizard().getContainer().run(true, false, new IRunnableWithProgress() {
                                
@@ -154,14 +155,14 @@ public class ReportGeneratePage extends WizardPage {
                                }
                        });
                }  catch (InterruptedException err) {
-                       setErrorMessage("Report failed: " + err.getMessage());
-                       ErrorLogger.defaultLogError("Report failed.",err);
-                       statusLabel.setText("Report failed.");
+                       setErrorMessage(NLS.bind(Messages.ReportGeneratePage_ReportFailed , err.getMessage()));
+                       ErrorLogger.defaultLogError(Messages.ReportGeneratePage_ReportFail,err);
+                       statusLabel.setText(Messages.ReportGeneratePage_ReportFail);
                } catch (InvocationTargetException e) {
                    Throwable err = e.getCause();
-                       setErrorMessage("Report failed: " + err.getMessage());
-                       ErrorLogger.defaultLogError("Report failed.",err);
-                       statusLabel.setText("Report failed.");
+                       setErrorMessage(NLS.bind(Messages.ReportGeneratePage_ReportFailed , err.getMessage()));
+                       ErrorLogger.defaultLogError(Messages.ReportGeneratePage_ReportFail,err);
+                       statusLabel.setText(Messages.ReportGeneratePage_ReportFail);
                }
                setGenerated(true);