Class AbstractGridComponent<T extends IGridItem,ME,M extends IGridModel<ME>,P extends IParameterization>

Record Components:
T - the type of grid items.
ME - the type of domain model elements.
M - the model type.
P - the parameterization type
All Implemented Interfaces:
IComponent<M>, IEventChannel
Direct Known Subclasses:
AbstractChartReferenceGridComponent, ChoiceListGridComponent, CommonPictureEntriesGridComponent, GanttChartBackgroundIntervalsGridComponent, GaugeChartQualityBandsGridComponent, MobileCommandBarElementsGridComponent, PlannerDimensionsGridComponent, TimeScaleLabelsGridComponent, TimeScaleLevelsGridComponent, TrendlineArrayGridComponent

public abstract class AbstractGridComponent<T extends IGridItem,ME,M extends IGridModel<ME>,P extends IParameterization> extends AbstractControlComponent<M,P,GridViewModel>
The abstract grid component.

It supports embedded AEF-based cell editors.

  • Constructor Details

    • AbstractGridComponent

      public AbstractGridComponent(P parameterization)
      Creates a new component.
      Parameters:
      parameterization - the parameterization, cannot be null.
  • Method Details

    • dispose

      public void dispose()
      Description copied from interface: IComponent
      Disposes this component, its view models and its child components.
      Specified by:
      dispose in interface IComponent<T extends IGridItem>
      Overrides:
      dispose in class Component<M extends IGridModel<ME>,P extends IParameterization>
    • createControlViewModel

      protected final GridViewModel createControlViewModel()
      Description copied from class: AbstractControlComponent
      Creates control view model instance.
      Specified by:
      createControlViewModel in class AbstractControlComponent<M extends IGridModel<ME>,P extends IParameterization,GridViewModel>
      Returns:
      a newly created control view model.
    • createColumn

      protected GridColumnViewModel createColumn(String header)
      Creates a new grid column view model with the given header.
      Also it automatically assigns index to the column.
      NOTE: the column index will be assigned in accordance with 'createColumn' invocation serial number. Please note this fact during createComponent(GridColumnViewModel, Object) implementation

      The created column fields is filled with default values.

      Parameters:
      header - the header of the column, cannot be null.
      Returns:
      a newly created column.
    • createColumn

      protected GridColumnViewModel createColumn(String header, Consumer<GridColumnViewModel> initializer)
      Creates a new grid column view model with the given header and initializes it using the specified initializer.
      Also it automatically assigns index to column.
      NOTE: the column index will be assigned in accordance with 'createColumn' invocation serial number. Please note this fact during createComponent(GridColumnViewModel, Object) implementation

      The created column fields is filled withtin initializer.

      Parameters:
      header - the header of the column, cannot be null.
      initializer - the column initializer.
      Returns:
      a newly created column.
    • disposeViewModels

      protected void disposeViewModels()
      Description copied from class: Component
      Disposes the view models of this component. Override it to do some additional disposal operations specific to a component.
      Overrides:
      disposeViewModels in class AbstractControlComponent<M extends IGridModel<ME>,P extends IParameterization,GridViewModel>
    • handleCellDisposalEvent

      protected void handleCellDisposalEvent(GridCellDisposalEvent event)
      Handles cell editor disposal event.
      Parameters:
      event - the event, cannot be null.
    • handleCheckBoxCellEvent

      protected void handleCheckBoxCellEvent(GridCheckboxCellEvent event)
      Handles checkbox cell event.
      Parameters:
      event - the event, cannot be null.
    • refreshGrid

      protected void refreshGrid()
      Refreshes the grid.
    • refreshGridItem

      protected void refreshGridItem(T item)
      Refreshes the grid item.
      Parameters:
      item - the grid item.
    • getItemByModelElement

      protected T getItemByModelElement(ME element)
      Returns the grid item associated with the given {code element}.
      Parameters:
      element - the model element.
    • getModelElementByItem

      protected ME getModelElementByItem(T item)
      Returns the model element associated with the given grid {code item}.
      Parameters:
      item - the grid item.
    • createGridInput

      protected IGridInput createGridInput()
      Creates a grid input.
      Returns:
      grid input.
    • createComponent

      protected abstract IComponent<?> createComponent(GridColumnViewModel column, ME element)
      Creates cell editor component for the given column and element.
      Parameters:
      column - the column view model that represents the grid column, cannot be null.
      element - the model element, cannot be null.
      Returns:
      cell editor component.
    • createContentProvider

      protected abstract MappingGridContentProvider<T,ME,M> createContentProvider(M model)
      Creates mapping content provider for grid input.
      Parameters:
      model - the model, cannot be null.
      Returns:
      mapping content provider.
    • createColumnStructure

      protected abstract Collection<GridColumnViewModel> createColumnStructure()
      Creates the grid column structure.
      Returns:
      the columns, never null.