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>
- 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.
-
Nested Class Summary
Nested classes/interfaces inherited from class com._1c.g5.aef2.standard.components.StandardComponent
StandardComponent.BindingDirection -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected 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>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 final GridViewModelCreates control view model instance.protected IGridInputCreates a grid input.voiddispose()Disposes this component, its view models and its child components.protected voidDisposes 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 voidHandles cell editor disposal event.protected voidHandles checkbox cell event.protected voidRefreshes 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, updateViewModelsMethods inherited from class com._1c.g5.aef2.standard.components.StandardComponent
bindList, bindModel, bindValue, bindValue, createDefaultViewModelList, createDefaultViewModelValue, getLayoutData, isEnabled, isPassive, setEnabled, setFocus, updateViewModelStatusMethods 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 Details
-
AbstractGridComponent
Creates a new component.- Parameters:
parameterization- the parameterization, cannot benull.
-
-
Method Details
-
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
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
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
Handles cell editor disposal event.- Parameters:
event- the event, cannot benull.
-
handleCheckBoxCellEvent
Handles checkbox cell event.- Parameters:
event- the event, cannot benull.
-
refreshGrid
protected void refreshGrid()Refreshes the grid. -
refreshGridItem
Refreshes the grid item.- Parameters:
item- the grid item.
-
getItemByModelElement
Returns the grid item associated with the given {code element}.- Parameters:
element- the model element.
-
getModelElementByItem
Returns the model element associated with the given grid {code item}.- Parameters:
item- the grid item.
-
createGridInput
Creates a grid input.- Returns:
- grid input.
-
createComponent
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
Creates mapping content provider for grid input.- Parameters:
model- the model, cannot benull.- Returns:
- mapping content provider.
-
createColumnStructure
Creates the grid column structure.- Returns:
- the columns, never
null.
-