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

    • Constructor Detail

      • AbstractGridComponent

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

      • 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.
      • 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.