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;
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) {
}
});
showButton = new Button(composite, SWT.PUSH);
- showButton.setText("Show Report");
+ showButton.setText(Messages.ReportGeneratePage_ShowReport);
showButton.addSelectionListener(new SelectionAdapter() {
@Override
}
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) {
private void generate() {
generateButton.setEnabled(false);
- statusLabel.setText("Generating report");
+ statusLabel.setText(Messages.ReportGeneratePage_GeneratingReport);
try {
getWizard().getContainer().run(true, false, new IRunnableWithProgress() {
}
});
} 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);