X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.export.ui%2Fsrc%2Forg%2Fsimantics%2Fexport%2Fui%2FExportCoreWizard.java;h=cc4b3092d432c2ed28c013372b97a2e9cbf7d0be;hp=708bb86696f32b5d0e09ad033f391c6fb8a2ea87;hb=refs%2Fchanges%2F11%2F2511%2F2;hpb=0ae2b770234dfc3cbb18bd38f324125cf0faca07 diff --git a/bundles/org.simantics.export.ui/src/org/simantics/export/ui/ExportCoreWizard.java b/bundles/org.simantics.export.ui/src/org/simantics/export/ui/ExportCoreWizard.java index 708bb8669..cc4b3092d 100644 --- a/bundles/org.simantics.export.ui/src/org/simantics/export/ui/ExportCoreWizard.java +++ b/bundles/org.simantics.export.ui/src/org/simantics/export/ui/ExportCoreWizard.java @@ -11,9 +11,11 @@ import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.wizard.IWizardPage; import org.eclipse.jface.wizard.Wizard; import org.eclipse.jface.wizard.WizardPage; +import org.eclipse.osgi.util.NLS; import org.eclipse.ui.IExportWizard; import org.eclipse.ui.IWorkbench; import org.osgi.service.prefs.BackingStoreException; +import org.simantics.Simantics; import org.simantics.db.exception.DatabaseException; import org.simantics.export.core.ExportContext; import org.simantics.export.core.Exports; @@ -22,7 +24,6 @@ import org.simantics.export.core.manager.ExportManager; import org.simantics.export.core.manager.ExportPlan; import org.simantics.export.core.manager.ExportWizardResult; import org.simantics.export.core.util.ExporterUtils; -import org.simantics.ui.SimanticsUI; import org.simantics.utils.datastructures.collections.CollectionUtils; import org.simantics.utils.ui.ErrorLogger; import org.simantics.utils.ui.ExceptionUtils; @@ -36,14 +37,14 @@ public class ExportCoreWizard extends Wizard implements IExportWizard { OptionsPage optionsPage; public ExportCoreWizard() { - setWindowTitle("Export PDF files"); + setWindowTitle(Messages.ExportCoreWizard_ExportPDFFiles); setNeedsProgressMonitor(true); } public void init(IWorkbench workbench, final IStructuredSelection selection) { try { // Create export context - ctx = ExportContext.create( SimanticsUI.getSessionContext(), selection ); + ctx = ExportContext.create( Simantics.getSessionContext(), selection ); // Create extension point registry ctx.eep = Exports.createExtensionPoint(); @@ -83,7 +84,7 @@ public class ExportCoreWizard extends Wizard implements IExportWizard { if ( !exportProblems.isEmpty() ) { CollectionUtils.unique(exportProblems); WizardPage cp = (WizardPage) getContainer().getCurrentPage(); - String str = CollectionUtils.toString(exportProblems, "\n"); + String str = CollectionUtils.toString(exportProblems, "\n"); //$NON-NLS-1$ cp.setErrorMessage( str ); return false; } @@ -106,7 +107,7 @@ public class ExportCoreWizard extends Wizard implements IExportWizard { try { ctx.store.flush(); } catch (BackingStoreException e) { - ErrorLogger.defaultLogError("Failed to persist wizard preferences.", e); + ErrorLogger.defaultLogError(Messages.ExportCoreWizard_FailedToSavePreferences, e); ExceptionUtils.logError(e); } } catch (InvocationTargetException e) { @@ -119,13 +120,13 @@ public class ExportCoreWizard extends Wizard implements IExportWizard { } if (canceled[0]) { - cp.setErrorMessage("Export canceled."); + cp.setErrorMessage(Messages.ExportCoreWizard_FailedToPersistWizardPrefs); } else if (t instanceof IOException) { - ErrorLogger.defaultLogError("An I/O problem occurred while exporting the model. See exception for details.", t); - cp.setErrorMessage("An I/O problem occurred while exporting the model.\nMessage: " + t.getMessage()); + ErrorLogger.defaultLogError("An I/O problem occurred while exporting the model. See exception for details.", t); //$NON-NLS-1$ + cp.setErrorMessage(NLS.bind(Messages.ExportCoreWizard_IOProblem, t.getMessage())); } else { - ErrorLogger.defaultLogError("Unexpected exception while exporting the model. See exception for details.", t); - cp.setErrorMessage("Unexpected exception while exporting the model. See error log for details.\nMessage: " + t.getMessage()); + ErrorLogger.defaultLogError("Unexpected exception while exporting the model. See exception for details.", t); //$NON-NLS-1$ + cp.setErrorMessage(NLS.bind(Messages.ExportCoreWizard_UnexpectedException, t.getMessage())); } return false; } catch (InterruptedException e) {