save from statusbar
authorKevin Lamonte <kevin.lamonte@gmail.com>
Fri, 2 Aug 2019 11:03:48 +0000 (06:03 -0500)
committerKevin Lamonte <kevin.lamonte@gmail.com>
Fri, 2 Aug 2019 11:03:48 +0000 (06:03 -0500)
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);
     }