Class DtDynamicTreeComponent<T,M extends IDynamicTreeModel<T>,VM extends TreeViewModel,P extends ITreeParameterization>
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,VM>
com._1c.g5.v8.dt.ui.aef.component.DtDynamicTreeComponent<T,M,VM,P>
- All Implemented Interfaces:
IComponent<M>
,IEventChannel
,ILabelProviderListener
- Direct Known Subclasses:
NavigatorTreeComponent
,PackageDataComponent
,PredefinedCalculationTypeCalculationBaseComponent
,PredefinedDataComponent
,WebServiceDataComponent
public abstract class DtDynamicTreeComponent<T,M extends IDynamicTreeModel<T>,VM extends TreeViewModel,P extends ITreeParameterization>
extends AbstractControlComponent<M,P,VM>
implements ILabelProviderListener
Abstract implementation of the tree component that operates with
IDynamicTreeModel
.-
Nested Class Summary
Nested classes/interfaces inherited from class com._1c.g5.aef2.standard.components.StandardComponent
StandardComponent.BindingDirection
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDtDynamicTreeComponent
(P parameterization) Creates a new instance with parameterization. -
Method Summary
Modifier and TypeMethodDescriptionprotected IAefTreeContentProvider<TreeItemViewModel>
CreatesIAefTreeContentProvider
instance.protected VM
Creates control view model instance.protected IViewModelsMapper<T,
TreeItemViewModel> Gets or createsIMapper
instance.protected VM
Creates view model instance.void
dispose()
Disposes this component, its view models and its child components.protected void
Disposes the view models of this component.protected IAefTreeContentProvider<TreeItemViewModel>
Returns content provider.protected Object[]
Returns mapped selected objects.protected TreeItemViewModel
Returns the first element in this selection, ornull
if the selection is empty.Returns mapper.protected boolean
Checks is current selection is empty.void
protected void
Processes tree item double click event.protected abstract void
processEvent
(IEvent event) Processes the received event from component.protected boolean
setCurrentSelections
(IViewModel... items) Sets current selection.void
setMulti
(boolean multi) void
setSelection
(Collection<T> elementsToSelect) Sets selection to the underlying view.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
-
Field Details
-
active
protected boolean active
-
-
Constructor Details
-
DtDynamicTreeComponent
Creates a new instance with parameterization.- Parameters:
parameterization
- the parameterization, cannot benull
-
-
Method Details
-
setMulti
public void setMulti(boolean multi) - Parameters:
multi
- the multi to set
-
setSelection
Sets selection to the underlying view.- Parameters:
selection
- the selection to set, cannot benull
-
dispose
public void dispose()Description copied from interface:IComponent
Disposes this component, its view models and its child components.- Specified by:
dispose
in interfaceIComponent<T>
- Overrides:
dispose
in classComponent<M extends IDynamicTreeModel<T>,
P extends ITreeParameterization>
-
labelProviderChanged
- Specified by:
labelProviderChanged
in interfaceILabelProviderListener
-
getMapper
Returns mapper.- Returns:
- the mapper, cannot be
null
if control view is created
-
createControlViewModel
Description copied from class:AbstractControlComponent
Creates control view model instance.- Specified by:
createControlViewModel
in classAbstractControlComponent<M extends IDynamicTreeModel<T>,
P extends ITreeParameterization, VM extends TreeViewModel> - Returns:
- a newly created control view model.
-
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 classAbstractControlComponent<M extends IDynamicTreeModel<T>,
P extends ITreeParameterization, VM extends TreeViewModel>
-
createContentProvider
CreatesIAefTreeContentProvider
instance.- Returns:
- the newly created content provider, cannot be
null
-
createTreeMapper
Gets or createsIMapper
instance.- Returns:
- the newly created mapper, cannot be
null
-
createTreeViewModel
Creates view model instance.- Returns:
- a newly created view model, cannot be
null
-
getContentProvider
Returns content provider.- Returns:
- the content provider, cannot be
null
if control view is created
-
processDoubleClickEvent
Processes tree item double click event. Default implementation opens property sheet view.- Parameters:
event
- the event, cannot benull
-
processEvent
Processes the received event from component.- Parameters:
event
- the event
-
getCurretnSelectionsFirstItem
Returns the first element in this selection, ornull
if the selection is empty.- Returns:
- an element, or
null
if none
-
getCurrentSelectionsObjects
Returns mapped selected objects.- Returns:
- the mapped selected objects, cannot be
null
-
isCurrentSelectionsEmpty
protected boolean isCurrentSelectionsEmpty()Checks is current selection is empty.- Returns:
true
if empty,false
otherwise.
-
setCurrentSelections
Sets current selection.- Parameters:
items
- the selected items, cannot benull
- Returns:
true
if selection changed,false
otherwise
-