X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.document.ui%2Fsrc%2Forg%2Fsimantics%2Fdocument%2Fui%2Factions%2FExportDocumentFolder.java;h=a7f9a9704554e07b2340165dd9e5e55257be7cd0;hp=3956a5923bdd7b377c71ac5d14562ee2c4758d93;hb=c8e675ae59eebb045a095a07e54462d0fe87f5cb;hpb=8783f9ee2b67f83160d88f43a7aef02a6b25f955 diff --git a/bundles/org.simantics.document.ui/src/org/simantics/document/ui/actions/ExportDocumentFolder.java b/bundles/org.simantics.document.ui/src/org/simantics/document/ui/actions/ExportDocumentFolder.java index 3956a5923..a7f9a9704 100644 --- a/bundles/org.simantics.document.ui/src/org/simantics/document/ui/actions/ExportDocumentFolder.java +++ b/bundles/org.simantics.document.ui/src/org/simantics/document/ui/actions/ExportDocumentFolder.java @@ -16,7 +16,9 @@ import java.io.File; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; +import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.osgi.util.NLS; import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.DirectoryDialog; import org.eclipse.swt.widgets.Display; @@ -47,7 +49,7 @@ public class ExportDocumentFolder implements ActionFactory { public ExportDocumentFolder(ReadGraph graph, String relationUri, String useResourceNames) throws DatabaseException { relation = graph.getResource(relationUri); - this.useResourceNames = useResourceNames.equals("true"); + this.useResourceNames = useResourceNames.equals("true"); //$NON-NLS-1$ } @Override @@ -70,7 +72,7 @@ public class ExportDocumentFolder implements ActionFactory { File folder = new File(folderName); int choice = -1; if (folder.list().length > 0) { - MessageDialog messageDialog = new MessageDialog(shell, "Folder export", null, "Selected folder \"" + folderName + "\" is not empty.", MessageDialog.QUESTION, new String[]{"Delete and export","Overwrite","Cancel"}, 2); + MessageDialog messageDialog = new MessageDialog(shell, Messages.ExportDocumentFolder_FolderExport, null, NLS.bind(Messages.ExportDocumentFolder_SelectedFolder, folderName), MessageDialog.QUESTION, new String[]{Messages.ExportDocumentFolder_DeleteAndExport,Messages.ExportDocumentFolder_Overwrite, IDialogConstants.CANCEL_LABEL }, 2); //$NON-NLS-3$ choice = messageDialog.open(); if (choice == 2) return; @@ -89,7 +91,7 @@ public class ExportDocumentFolder implements ActionFactory { File folder; boolean clear = false; public ExportJob(Resource resource,File folder, boolean clear) { - super("Export folder"); + super(Messages.ExportDocumentFolder_ExportFolder); this.resource = resource; this.folder = folder; this.clear = clear; @@ -97,17 +99,17 @@ public class ExportDocumentFolder implements ActionFactory { @Override protected IStatus run(IProgressMonitor monitor) { try { - monitor.beginTask("Export folder", IProgressMonitor.UNKNOWN); + monitor.beginTask(Messages.ExportDocumentFolder_ExportFolder, IProgressMonitor.UNKNOWN); if (clear) { GraphFileUtil.clearDirectoryStructure(folder); monitor.worked(1); } FileDocumentUtil.exportDocumentFolder(resource, folder, relation, useResourceNames, monitor); monitor.done(); - return new Status(IStatus.OK, Activator.PLUGIN_ID, "Folder exported."); + return new Status(IStatus.OK, Activator.PLUGIN_ID, Messages.ExportDocumentFolder_ActivatorFolderExported); } catch (Exception e) { monitor.done(); - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Cannot export document folder.", e); + return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.ExportDocumentFolder_AcivatorCannotExport, e); } } }