Add 'src/jexer/' from commit 'cf01c92f5809a0732409e280fb0f32f27393618d'
[nikiroo-utils.git] / src / jexer / TTableWindow.java
index 9365892f59cb26b4389c9e7d18f9d5cbe2c248f1..44ff7b48949749c1590bcead79b57f3b55d727fc 100644 (file)
@@ -343,6 +343,20 @@ public class TTableWindow extends TScrollableWindow {
             return;
         }
 
+        if (command.equals(cmSave)) {
+            try {
+                String filename = fileSaveBox(".");
+                if (filename != null) {
+                    tableField.saveToCsvFilename(filename);
+                }
+            } catch (IOException e) {
+                messageBox(i18n.getString("errorDialogTitle"),
+                    MessageFormat.format(i18n.
+                        getString("errorWritingFile"), e.getMessage()));
+            }
+            return;
+        }
+
         // Didn't handle it, let children get it instead
         super.onCommand(command);
     }