Class EmfTablePageBuilder

java.lang.Object
com.amalgamasimulation.desktop.appelements.builders.EmfTablePageBuilder

public final class EmfTablePageBuilder extends Object
Builder of a page with an EMF table for a part with pages (AbstractPagesPart). The table shows the objects of a feature of a container. It is usually obtained with Pages.emfTable(Row.class).

The first steps go in a fixed order: the tree element, the container, the elements feature and the columns. After them the optional settings go in any order, and register creates the page and registers it in the part:

 Pages.emfTable(WorkCenter.class)
     .treeElementType(TreeElementType.WORK_CENTER)
     .container(() -> appData.getScenario())
     .elementsFeature(DatamodelPackage.Literals.SCENARIO__WORK_CENTERS)
     .columns(table -> table.column(WorkCenter::getName).name("Name"))
     .toolBar()
         .defaultCreateElementAction("WC-", DatamodelFactory.eINSTANCE::createWorkCenter)
         .defaultRemoveElementAction()
     .end()
     .register(this);
 
Author:
Ionov Ivan
  • Method Details

    • create

      public static <V extends org.eclipse.emf.ecore.EObject> EmfTablePageBuilder.TreeElementTypeBuilder<V> create()
      Starts the setup of a new page with a table.
      Type Parameters:
      V - the type of the table rows
      Returns:
      the first step of the builder
    • toolBar

      public static <V extends org.eclipse.emf.ecore.EObject, R> EmfTablePageBuilder.ToolBarBuilder<V,R> toolBar(TablePageProperties<V> properties, R owner)
      Returns a toolbar builder for the settings of an existing page. EmfTablePage.toolBar() uses it to add toolbar items after register.
      Type Parameters:
      V - the type of the table rows
      R - the type returned by end()
      Parameters:
      properties - the settings of the page
      owner - the object returned by end()
      Returns:
      the toolbar builder