public class SettingToControlMapperImpl extends Object implements EMFFormsSettingToControlMapper, EMFFormsContextListener, SubControlMapper
EMFFormsSettingToControlMapper
.Constructor and Description |
---|
SettingToControlMapperImpl(EMFFormsMappingProviderManager mappingManager,
EMFFormsViewContext viewModelContext)
Creates a new instance of
SettingToControlMapperImpl . |
Modifier and Type | Method and Description |
---|---|
void |
checkAndUpdateSettingToControlMapping(org.eclipse.emf.ecore.EObject eObject)
Checks and updates the mapping for the given
EObject . |
void |
childContextAdded(VElement parentElement,
EMFFormsViewContext childContext)
Called when a child context is added.
|
void |
childContextDisposed(EMFFormsViewContext childContext)
Called when a child context is disposed.
|
void |
contextDispose()
Called by the context when the dispose is running.
|
void |
contextInitialised()
Called by the context when the initialization has finished.
|
Set<VControl> |
getControlsFor(org.eclipse.emf.ecore.EStructuralFeature.Setting setting)
Returns all controls which are associated with the provided
EStructuralFeature.Setting . |
Set<VElement> |
getControlsFor(UniqueSetting setting)
Returns all controls which are associated with the provided
UniqueSetting . |
Collection<org.eclipse.emf.ecore.EObject> |
getEObjectsWithSettings()
Returns a collection of all EObjects which have a mapped setting.
|
Collection<org.eclipse.emf.ecore.EObject> |
getEObjectsWithSettings(VElement element)
Obtain a collection of all objects that have a mapped setting in the
hierarchy of the given view
element . |
Set<UniqueSetting> |
getSettingsForControl(VControl control)
Returns a collection of all settings for the given control.
|
boolean |
hasControlsFor(org.eclipse.emf.ecore.EObject eObject)
Checks whether any feature of this EObject has a registered control.
|
void |
updateControlMapping(VControl vControl)
Updates the setting to control mapping for the given
VControl . |
void |
vControlAdded(VControl vControl)
Adds a
VControl to the setting to control mapping. |
void |
vControlRemoved(VControl vControl)
Removes a
VControl from the setting to control mapping. |
public SettingToControlMapperImpl(EMFFormsMappingProviderManager mappingManager, EMFFormsViewContext viewModelContext)
SettingToControlMapperImpl
.mappingManager
- The EMFFormsMappingProviderManager
viewModelContext
- The EMFFormsViewContext
that created this instancepublic Set<VControl> getControlsFor(org.eclipse.emf.ecore.EStructuralFeature.Setting setting)
EStructuralFeature.Setting
. The EStructuralFeature.Setting
is converted to
a UniqueSetting
.getControlsFor
in interface EMFFormsSettingToControlMapper
setting
- the EStructuralFeature.Setting
to search controls forpublic Set<VElement> getControlsFor(UniqueSetting setting)
UniqueSetting
.getControlsFor
in interface EMFFormsSettingToControlMapper
setting
- the UniqueSetting
to search controls forpublic void updateControlMapping(VControl vControl)
VControl
.updateControlMapping
in interface EMFFormsSettingToControlMapper
vControl
- The VControl
public void vControlRemoved(VControl vControl)
VControl
from the setting to control mapping.vControlRemoved
in interface EMFFormsSettingToControlMapper
vControl
- The VControl
to removepublic void vControlAdded(VControl vControl)
VControl
to the setting to control mapping.vControlAdded
in interface EMFFormsSettingToControlMapper
vControl
- The VControl
to addpublic void checkAndUpdateSettingToControlMapping(org.eclipse.emf.ecore.EObject eObject)
EObject
.checkAndUpdateSettingToControlMapping
in interface EMFFormsSettingToControlMapper
eObject
- The EObject
public void childContextAdded(VElement parentElement, EMFFormsViewContext childContext)
childContextAdded
in interface EMFFormsContextListener
parentElement
- The VElement
that is associated with the child contextchildContext
- The EMFFormsViewContext
that was addedEMFFormsContextListener.childContextAdded(org.eclipse.emf.ecp.view.spi.model.VElement,
org.eclipse.emfforms.spi.core.services.view.EMFFormsViewContext)
public void childContextDisposed(EMFFormsViewContext childContext)
childContextDisposed
in interface EMFFormsContextListener
childContext
- The EMFFormsViewContext
that was disposedEMFFormsContextListener.childContextDisposed(org.eclipse.emfforms.spi.core.services.view.EMFFormsViewContext)
public void contextInitialised()
contextInitialised
in interface EMFFormsContextListener
EMFFormsContextListener.contextInitialised()
public void contextDispose()
contextDispose
in interface EMFFormsContextListener
EMFFormsContextListener.contextDispose()
public boolean hasControlsFor(org.eclipse.emf.ecore.EObject eObject)
EMFFormsSettingToControlMapper
hasControlsFor
in interface EMFFormsSettingToControlMapper
eObject
- the EObject to checktrue
if there is at least one control for any feature of the given EObject,
false
otherwisepublic Collection<org.eclipse.emf.ecore.EObject> getEObjectsWithSettings()
EMFFormsSettingToControlMapper
getEObjectsWithSettings
in interface EMFFormsSettingToControlMapper
public Collection<org.eclipse.emf.ecore.EObject> getEObjectsWithSettings(VElement element)
SubControlMapper
element
.getEObjectsWithSettings
in interface SubControlMapper
element
- the view sub-tree for which to get objectspublic Set<UniqueSetting> getSettingsForControl(VControl control)
EMFFormsSettingToControlMapper
getSettingsForControl
in interface EMFFormsSettingToControlMapper
control
- the control to get the settings forCopyright © 2019. All rights reserved.