]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.document.ui/src/org/simantics/document/ui/actions/ExportDocumentFolder.java
Externalize strings in org.simantics.document.ui
[simantics/platform.git] / bundles / org.simantics.document.ui / src / org / simantics / document / ui / actions / ExportDocumentFolder.java
index 3956a5923bdd7b377c71ac5d14562ee2c4758d93..a7f9a9704554e07b2340165dd9e5e55257be7cd0 100644 (file)
@@ -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);
                        }
                }
        }