Excel-based tabular data editing

A typical Amalgama Platform-based desktop application welcomes its users with the editor mode, where a new scenario can be created from scratch, or an existing scenario can be loaded from a file and fine-tuned.

For mass editing operations, however, Excel is likely to be more convenient. The EMFTable class is designed to support both in-place editing and externalized editing in Excel.

The user experience is as follows:

  1. Open or create a scenario in the desktop application.

  2. In the desktop app, open a table with data to be edited.

  3. In the table’s context menu, click 'Edit in Excel'. The Excel app is launched and a temporary file containing the tabular data is loaded.

  4. Edit data in Excel: add, remove, update rows in the 1st sheet.

  5. Save the Excel file.

  6. Close the Excel app.

  7. Push 'Upload' in the dialog window.

The updated data is loaded into the table in the desktop app.

Edit in Excel
Figure 1. Editing data in Excel

To enable 'Edit in Excel' functionality, get EMFTable’s internal EditingInExcelManager object (via the getEditingInExcelManager() method), and then call its setDataForEditing() method.

Here is an example from the Warehouse Fast Track Tutorial:

tableView.getEditingInExcelManager().setDataForEditing(
			DatamodelPackage.Literals.NODE,
			() -> scenarioObservable.getValue(),
			EMFExcelDataTransform.getExcelTransform(),
			() -> commandFactory.getCrossReferenceAdapter());

This code enables editing of objects of the datamodel class Node that are contained inside a Scenario object. See details in the setDataForEditing() method JavaDoc.