Class EditingInExcelManager

java.lang.Object
com.amalgamasimulation.desktop.ui.internal.PartialLoadAndSaveManager
com.amalgamasimulation.desktop.ui.views.EditingInExcelManager

public class EditingInExcelManager extends com.amalgamasimulation.desktop.ui.internal.PartialLoadAndSaveManager
A container for data required to edit a part of the scenario using Excel.

How to use:

  1. Get an instance of the EditingInExcelManager class from a TableView.
  2. Set up the instance via its setDataForEditing(EClass, Supplier, EMFExcelTransform, Supplier) method.
Expected result: the TableView now has the 'Edit in Excel' context menu item.
Author:
Ionov Ivan
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Function<List<org.eclipse.emf.ecore.EObject>,List<org.eclipse.emf.common.command.Command>>
     
    void
    openDialog(org.eclipse.swt.widgets.Shell shell)
    Shows a dialog that enables data export or upload.
    void
    setAdditionalActionBeforeRemove(Function<List<org.eclipse.emf.ecore.EObject>,List<org.eclipse.emf.common.command.Command>> additionalActionBeforeRemove)
     
    void
    setDataForEditing(org.eclipse.emf.ecore.EClass editingEClass, Supplier<org.eclipse.emf.ecore.EObject> rootObject, com.amalgamasimulation.emf.excel.EMFExcelTransform<? extends org.eclipse.emf.ecore.EObject> emfExcelTransform, Supplier<org.eclipse.emf.ecore.util.ECrossReferenceAdapter> crossReferenceAdapter)
    Set up the editing data.

    Methods inherited from class com.amalgamasimulation.desktop.ui.internal.PartialLoadAndSaveManager

    checkAvailableEditing, getActionAfterCommand, getActionBeforeCommand, getCrossReferenceAdapter, getEditingEClass, getEmfExcelTransform, getRootObject, setActionAfterCommand, setActionBeforeCommand, setData

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • EditingInExcelManager

      public EditingInExcelManager()
  • Method Details

    • setDataForEditing

      public void setDataForEditing(org.eclipse.emf.ecore.EClass editingEClass, Supplier<org.eclipse.emf.ecore.EObject> rootObject, com.amalgamasimulation.emf.excel.EMFExcelTransform<? extends org.eclipse.emf.ecore.EObject> emfExcelTransform, Supplier<org.eclipse.emf.ecore.util.ECrossReferenceAdapter> crossReferenceAdapter)
      Set up the editing data. After calling this method, a new menu item 'Edit in Excel' should appear in the TableView that holds this EditingInExcelManager instance.
      Parameters:
      editingEClass - The EClass of the data that will be edited. Note that objects of 'editingEClass' must be immediately contained within the root scenario object ('rootObject'), i.e., the 'rootObject' must have a 0..* reference to the objects of the 'editingEClass'.
      rootObject - Supplier of the scenario root object
      emfExcelTransform - The EMFExcelTransform object set up to work with scenario objects
      crossReferenceAdapter - ECrossReferenceAdapter supplier
    • openDialog

      public void openDialog(org.eclipse.swt.widgets.Shell shell)
      Description copied from class: com.amalgamasimulation.desktop.ui.internal.PartialLoadAndSaveManager
      Shows a dialog that enables data export or upload.
      Specified by:
      openDialog in class com.amalgamasimulation.desktop.ui.internal.PartialLoadAndSaveManager
      Parameters:
      shell - parent Shell object for the dialog
    • getAdditionalActionBeforeRemove

      public Function<List<org.eclipse.emf.ecore.EObject>,List<org.eclipse.emf.common.command.Command>> getAdditionalActionBeforeRemove()
    • setAdditionalActionBeforeRemove

      public void setAdditionalActionBeforeRemove(Function<List<org.eclipse.emf.ecore.EObject>,List<org.eclipse.emf.common.command.Command>> additionalActionBeforeRemove)