+ /**
+ * Method that subclasses can override to handle posted command events.
+ *
+ * @param command command event
+ */
+ @Override
+ public void onCommand(final TCommandEvent command) {
+ if (command.equals(cmOpen)) {
+ try {
+ String filename = fileOpenBox(".");
+ if (filename != null) {
+ try {
+ // TODO
+ if (false) {
+ tableField.saveToFilename(filename);
+ }
+ } catch (IOException e) {
+ messageBox(i18n.getString("errorDialogTitle"),
+ MessageFormat.format(i18n.
+ getString("errorReadingFile"), e.getMessage()));
+ }
+ }
+ } catch (IOException e) {
+ messageBox(i18n.getString("errorDialogTitle"),
+ MessageFormat.format(i18n.
+ getString("errorOpeningFileDialog"), e.getMessage()));
+ }
+ return;
+ }
+
+ if (command.equals(cmSave)) {
+ try {
+ String filename = fileSaveBox(".");
+ if (filename != null) {
+ tableField.saveToFilename(filename);
+ }
+ } catch (IOException e) {
+ messageBox(i18n.getString("errorDialogTitle"),
+ MessageFormat.format(i18n.
+ getString("errorSavingFile"), e.getMessage()));
+ }
+ return;
+ }
+
+ // Didn't handle it, let children get it instead
+ super.onCommand(command);
+ }
+