X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2FTTableWindow.java;h=766ceafdd901a0a4044105aba5114093cf7ef7a6;hb=HEAD;hp=9365892f59cb26b4389c9e7d18f9d5cbe2c248f1;hpb=656c0dddc7c0faddd62d373f22916107d322429e;p=fanfix.git diff --git a/src/jexer/TTableWindow.java b/src/jexer/TTableWindow.java index 9365892..766ceaf 100644 --- a/src/jexer/TTableWindow.java +++ b/src/jexer/TTableWindow.java @@ -112,7 +112,6 @@ public class TTableWindow extends TScrollableWindow { */ public void onFocus() { // Enable the table menu items. - getApplication().enableMenuItem(TMenu.MID_CUT); getApplication().enableMenuItem(TMenu.MID_TABLE_RENAME_COLUMN); getApplication().enableMenuItem(TMenu.MID_TABLE_RENAME_ROW); getApplication().enableMenuItem(TMenu.MID_TABLE_VIEW_ROW_LABELS); @@ -171,7 +170,6 @@ public class TTableWindow extends TScrollableWindow { */ public void onUnfocus() { // Disable the table menu items. - getApplication().disableMenuItem(TMenu.MID_CUT); getApplication().disableMenuItem(TMenu.MID_TABLE_RENAME_COLUMN); getApplication().disableMenuItem(TMenu.MID_TABLE_RENAME_ROW); getApplication().disableMenuItem(TMenu.MID_TABLE_VIEW_ROW_LABELS); @@ -343,6 +341,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); }