Class EmfSelectionTableSectionBuilder
java.lang.Object
com.amalgamasimulation.desktop.ui.editor.builders.EmfSelectionTableSectionBuilder
Builder of a selection table section. Each row of the table shows an element of the elements
list. The check box column shows whether the element is in the selectionFeature list of the page
object. Usually you get this builder from EmfPage.emfSelectionTableEditor.
Example:
emfSelectionTableEditor(Product.class)
.elements(allProducts)
.selectionFeature(ModelPackage.Literals.ORDER__SELECTED_PRODUCTS)
.checkBoxColumn("Selected")
.columns(table -> table.column(Product::getName).name("Product").width(200))
.height(200)
.create();
How this table is different from a usual EmfTableSectionBuilder table:
- The rows are all the elements of the elements list, not the value of a feature of the object. The table does not add or remove rows. The selected elements are kept separately, in the many-valued selectionFeature of the page object.
- A click on a check box adds the element to selectionFeature or removes it from there. Two toolbar buttons add all elements or remove all elements. Each such change is one CommandsManager command, so the user can undo it.
- The check box column comes after the columns that the columns step adds. Its width is 80, and it shows "✓" for a selected element.
- If the list of selected elements changes, the table redraws the row of that element. If the rows must also update when other properties of the elements change, set observableFeatures.
- If the page gets another object, the table works with the list of selected elements of the new object.
- The steps go in the order elements, selectionFeature, checkBoxColumn, columns. Each step returns the interface of the next step, so you cannot skip a step. After columns, the settings of a usual table are available: height, observableFeatures, toolBar, create.
EmfListSelectionBinding keeps the selected elements. The table listens to its changes, and this listener cannot be removed: EmfListSelectionBinding has no method that removes a listener.
- Author:
- Ionov Ivan
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classEmfSelectionTableSectionBuilder.Builder<T extends org.eclipse.emf.ecore.EObject,V> Implementation of the builder steps.static interfacestatic interfacestatic interfacestatic interfaceEmfSelectionTableSectionBuilder.IPropertyBuilder<T extends org.eclipse.emf.ecore.EObject,V> static interface -
Method Summary