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;
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;
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();
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;
}
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) {
}
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) {