Class AbstractGridComponent<T extends IGridItem,ME,M extends IGridModel<ME>,P extends IParameterization>
- java.lang.Object
-
- com._1c.g5.aef2.components.Component<M,P>
-
- com._1c.g5.aef2.standard.components.StandardComponent<M,P>
-
- com._1c.g5.aef2.standard.components.AbstractControlComponent<M,P,GridViewModel>
-
- com._1c.g5.v8.dt.ui.aef.component.AbstractGridComponent<T,ME,M,P>
-
- All Implemented Interfaces:
IComponent<M>,IEventChannel
- Direct Known Subclasses:
com._1c.g5.v8.dt.form.ui.internal.chart.aef.components.reference.AbstractChartReferenceGridComponent,CommonPictureEntriesGridComponent
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.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com._1c.g5.aef2.standard.components.StandardComponent
StandardComponent.BindingDirection
-
-
Constructor Summary
Constructors Constructor Description AbstractGridComponent(P parameterization)Creates a new component.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected GridColumnViewModelcreateColumn(String header)Creates a new grid column view model with the givenheader.
Also it automatically assigns index to the column.
NOTE: the column index will be assigned in accordance with'createColumn'invocation serial number.protected GridColumnViewModelcreateColumn(String header, Consumer<GridColumnViewModel> initializer)Creates a new grid column view model with the givenheaderand initializes it using the specifiedinitializer.
Also it automatically assigns index to column.
NOTE: the column index will be assigned in accordance with'createColumn'invocation serial number.protected abstract Collection<GridColumnViewModel>createColumnStructure()Creates the grid column structure.protected abstract IComponent<?>createComponent(GridColumnViewModel column, ME element)Creates cell editor component for the givencolumnandelement.protected abstract MappingGridContentProvider<T,ME,M>createContentProvider(M model)Creates mapping content provider for grid input.protected GridViewModelcreateControlViewModel()Creates control view model instance.protected IGridInputcreateGridInput()Creates a grid input.voiddispose()Disposes this component, its view models and its child components.protected voiddisposeViewModels()Disposes the view models of this component.protected TgetItemByModelElement(ME element)Returns the grid item associated with the given {code element}.protected MEgetModelElementByItem(T item)Returns the model element associated with the given grid {code item}.protected voidhandleCellDisposalEvent(GridCellDisposalEvent event)Handles cell editor disposal event.protected voidhandleCheckBoxCellEvent(GridCheckboxCellEvent event)Handles checkbox cell event.protected voidrefreshGrid()Refreshes the grid.protected voidrefreshGridItem(T item)Refreshes the grid item.-
Methods inherited from class com._1c.g5.aef2.standard.components.AbstractControlComponent
createViewModels, getControlViewModel, handleExternalValidationEvent, isEditable, refresh, setLayoutData, updateViewModels
-
Methods inherited from class com._1c.g5.aef2.standard.components.StandardComponent
bindList, bindModel, bindValue, bindValue, createDefaultViewModelList, createDefaultViewModelValue, getLayoutData, isEnabled, isPassive, setEnabled, setFocus, updateViewModelStatus
-
Methods inherited from class com._1c.g5.aef2.components.Component
addComponent, addListener, addViewModel, areChildCommitsEnabled, areChildRefreshEnabled, areComponentsCreated, attachToModel, beginExternalUpdate, checkComponents, checkViewModels, commit, createComponents, detachFromModel, disposeComponents, endExternalUpdate, getComponents, getModel, getParameterization, getParent, getRunnableQueue, getScene, getServiceEventQualifiers, getViewModels, isDisposed, isInExternalUpdate, queueAndWaitEvent, queueEvent, removeComponent, removeListener, removeViewModel, setChildCommitsEnabled, setChildRefreshEnable, setModel, setParent, setScene, subscribeOnEvents, subscribeOnEvents, unsubscribeOnEvents
-
-
-
-
Constructor Detail
-
AbstractGridComponent
public AbstractGridComponent(P parameterization)
Creates a new component.- Parameters:
parameterization- the parameterization, cannot benull.
-
-
Method Detail
-
dispose
public void dispose()
Description copied from interface:IComponentDisposes this component, its view models and its child components.- Specified by:
disposein interfaceIComponent<T extends IGridItem>- Overrides:
disposein classComponent<M extends IGridModel<ME>,P extends IParameterization>
-
createControlViewModel
protected final GridViewModel createControlViewModel()
Description copied from class:AbstractControlComponentCreates control view model instance.- Specified by:
createControlViewModelin classAbstractControlComponent<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 givenheader.
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 duringcreateComponent(GridColumnViewModel, Object)implementationThe created column fields is filled with default values.
- Parameters:
header- the header of the column, cannot benull.- Returns:
- a newly created column.
-
createColumn
protected GridColumnViewModel createColumn(String header, Consumer<GridColumnViewModel> initializer)
Creates a new grid column view model with the givenheaderand initializes it using the specifiedinitializer.
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 duringcreateComponent(GridColumnViewModel, Object)implementationThe created column fields is filled withtin
initializer.- Parameters:
header- the header of the column, cannot benull.initializer- the column initializer.- Returns:
- a newly created column.
-
disposeViewModels
protected void disposeViewModels()
Description copied from class:ComponentDisposes the view models of this component. Override it to do some additional disposal operations specific to a component.- Overrides:
disposeViewModelsin classAbstractControlComponent<M extends IGridModel<ME>,P extends IParameterization,GridViewModel>
-
handleCellDisposalEvent
protected void handleCellDisposalEvent(GridCellDisposalEvent event)
Handles cell editor disposal event.- Parameters:
event- the event, cannot benull.
-
handleCheckBoxCellEvent
protected void handleCheckBoxCellEvent(GridCheckboxCellEvent event)
Handles checkbox cell event.- Parameters:
event- the event, cannot benull.
-
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 givencolumnandelement.- Parameters:
column- the column view model that represents the grid column, cannot benull.element- the model element, cannot benull.- 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 benull.- Returns:
- mapping content provider.
-
createColumnStructure
protected abstract Collection<GridColumnViewModel> createColumnStructure()
Creates the grid column structure.- Returns:
- the columns, never
null.
-
-