Class EMFFormsDatabindingImpl
- java.lang.Object
-
- org.eclipse.emfforms.internal.core.services.databinding.EMFFormsDatabindingImpl
-
- All Implemented Interfaces:
EMFFormsDatabindingEMF
,EMFFormsSegmentResolver
,EMFFormsDatabinding
public class EMFFormsDatabindingImpl extends java.lang.Object implements EMFFormsDatabindingEMF, EMFFormsSegmentResolver
EMF implementation ofEMFFormsDatabindingEMF
.- Author:
- Lucas Koehler
-
-
Constructor Summary
Constructors Constructor Description EMFFormsDatabindingImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addDomainModelReferenceConverter(DomainModelReferenceConverterEMF converter)
Adds the givenDomainModelReferenceConverterEMF
to the Set of reference converters.protected void
addDomainModelReferenceSegmentConverter(DomainModelReferenceSegmentConverterEMF converter)
Adds the givenDomainModelReferenceSegmentConverterEMF
to the Set of segment converters.org.eclipse.emf.ecore.EStructuralFeature
extractFeature(org.eclipse.core.databinding.observable.list.IObservableList observableList)
Extracts theEStructuralFeature
from the providedIObservableList
.org.eclipse.emf.ecore.EStructuralFeature
extractFeature(org.eclipse.core.databinding.observable.value.IObservableValue observableValue)
Extracts theEStructuralFeature
from the providedIObservableValue
.org.eclipse.emf.ecore.EObject
extractObserved(org.eclipse.core.databinding.observable.list.IObservableList observableList)
Extracts the observedEObject
from the providedIObservableList
.org.eclipse.emf.ecore.EObject
extractObserved(org.eclipse.core.databinding.observable.value.IObservableValue observableValue)
Extracts the observedEObject
from the providedIObservableValue
.org.eclipse.emf.databinding.IEMFListProperty
getListProperty(VDomainModelReference domainModelReference, org.eclipse.emf.ecore.EObject object)
Returns anIListProperty
described by the givenVDomainModelReference
.org.eclipse.core.databinding.observable.list.IObservableList
getObservableList(VDomainModelReference domainModelReference, org.eclipse.emf.ecore.EObject object)
Returns anIObservableList
by observing the list described by the givenVDomainModelReference
of the givenEObject
.org.eclipse.core.databinding.observable.value.IObservableValue
getObservableValue(VDomainModelReference domainModelReference, org.eclipse.emf.ecore.EObject object)
Returns anIObservableValue
by observing the value described by the givenVDomainModelReference
of the givenEObject
.org.eclipse.emf.ecore.EStructuralFeature.Setting
getSetting(VDomainModelReference domainModelReference, org.eclipse.emf.ecore.EObject object)
Retrieve the Setting which is described by the providedVDomainModelReference
and the providedEObject
.org.eclipse.emf.databinding.IEMFValueProperty
getValueProperty(VDomainModelReference domainModelReference, org.eclipse.emf.ecore.EClass rootEClass)
Returns anIValueProperty
described by the givenVDomainModelReference
.org.eclipse.emf.databinding.IEMFValueProperty
getValueProperty(VDomainModelReference domainModelReference, org.eclipse.emf.ecore.EClass rootEClass, org.eclipse.emf.edit.domain.EditingDomain editingDomain)
Returns anIValueProperty
described by the givenVDomainModelReference
and using the givenEditingDomain
.org.eclipse.emf.databinding.IEMFValueProperty
getValueProperty(VDomainModelReference domainModelReference, org.eclipse.emf.ecore.EObject object)
Returns anIValueProperty
described by the givenVDomainModelReference
.protected void
removeDomainModelReferenceConverter(DomainModelReferenceConverterEMF converter)
Removes the givenDomainModelReferenceConverterEMF
to the Set of reference converters.protected void
removeDomainModelReferenceSegmentConverter(DomainModelReferenceSegmentConverterEMF converter)
Removes the givenDomainModelReferenceSegmentConverterEMF
from the Set of segment converters.org.eclipse.emf.ecore.EStructuralFeature.Setting
resolveSegment(VDomainModelReferenceSegment segment, org.eclipse.emf.ecore.EObject domainObject)
Resolves the givensegment
from the givendomain object
and returns the resultingEStructuralFeature.Setting
.
-
-
-
Method Detail
-
addDomainModelReferenceSegmentConverter
protected void addDomainModelReferenceSegmentConverter(DomainModelReferenceSegmentConverterEMF converter)
Adds the givenDomainModelReferenceSegmentConverterEMF
to the Set of segment converters.- Parameters:
converter
- TheDomainModelReferenceSegmentConverterEMF
to add
-
removeDomainModelReferenceSegmentConverter
protected void removeDomainModelReferenceSegmentConverter(DomainModelReferenceSegmentConverterEMF converter)
Removes the givenDomainModelReferenceSegmentConverterEMF
from the Set of segment converters.- Parameters:
converter
- TheDomainModelReferenceSegmentConverterEMF
to remove
-
getObservableValue
public org.eclipse.core.databinding.observable.value.IObservableValue getObservableValue(VDomainModelReference domainModelReference, org.eclipse.emf.ecore.EObject object) throws DatabindingFailedException
Description copied from interface:EMFFormsDatabinding
Returns anIObservableValue
by observing the value described by the givenVDomainModelReference
of the givenEObject
.- Specified by:
getObservableValue
in interfaceEMFFormsDatabinding
- Specified by:
getObservableValue
in interfaceEMFFormsDatabindingEMF
- Parameters:
domainModelReference
- The domain model reference pointing to the desired valueobject
- The root object of the rendered form. If theVDomainModelReference
contains a path, the object is the first node of the path. Therefore, theIObservableValue
can be bound to a feature of a sub element in case of a path.- Returns:
- The resulting
IObservableValue
, does not returnnull
. - Throws:
DatabindingFailedException
- if the databinding could not be executed successfully.
-
getValueProperty
public org.eclipse.emf.databinding.IEMFValueProperty getValueProperty(VDomainModelReference domainModelReference, org.eclipse.emf.ecore.EObject object) throws DatabindingFailedException
Description copied from interface:EMFFormsDatabinding
Returns anIValueProperty
described by the givenVDomainModelReference
.- Specified by:
getValueProperty
in interfaceEMFFormsDatabinding
- Specified by:
getValueProperty
in interfaceEMFFormsDatabindingEMF
- Parameters:
domainModelReference
- The domain model reference pointing to the desired valueobject
- The root object of the rendered form. If theVDomainModelReference
contains a path, the object is the first node of the path. Therefore, theIValueProperty
can be bound to a feature of a sub element in case of a path.- Returns:
- The resulting
IValueProperty
, does not returnnull
. - Throws:
DatabindingFailedException
- if the databinding could not be executed successfully.
-
getValueProperty
public org.eclipse.emf.databinding.IEMFValueProperty getValueProperty(VDomainModelReference domainModelReference, org.eclipse.emf.ecore.EClass rootEClass) throws DatabindingFailedException
Description copied from interface:EMFFormsDatabindingEMF
Returns anIValueProperty
described by the givenVDomainModelReference
. Using this method, value properties are created without anEditingDomain
.- Specified by:
getValueProperty
in interfaceEMFFormsDatabindingEMF
- Parameters:
domainModelReference
- The domain model reference pointing to the desired valuerootEClass
- The rootEClass
of the rendered form- Returns:
- The resulting
IValueProperty
, does not returnnull
. - Throws:
DatabindingFailedException
- if the databinding could not be executed successfully.
-
getValueProperty
public org.eclipse.emf.databinding.IEMFValueProperty getValueProperty(VDomainModelReference domainModelReference, org.eclipse.emf.ecore.EClass rootEClass, org.eclipse.emf.edit.domain.EditingDomain editingDomain) throws DatabindingFailedException
Description copied from interface:EMFFormsDatabindingEMF
Returns anIValueProperty
described by the givenVDomainModelReference
and using the givenEditingDomain
.- Specified by:
getValueProperty
in interfaceEMFFormsDatabindingEMF
- Parameters:
domainModelReference
- The domain model reference pointing to the desired valuerootEClass
- The rootEClass
of the rendered formeditingDomain
- TheEditingDomain
for which the value property is created. May benull
- Returns:
- The resulting
IValueProperty
, does not returnnull
. - Throws:
DatabindingFailedException
- if the databinding could not be executed successfully.
-
addDomainModelReferenceConverter
protected void addDomainModelReferenceConverter(DomainModelReferenceConverterEMF converter)
Adds the givenDomainModelReferenceConverterEMF
to the Set of reference converters.- Parameters:
converter
- TheDomainModelReferenceConverterEMF
to add
-
removeDomainModelReferenceConverter
protected void removeDomainModelReferenceConverter(DomainModelReferenceConverterEMF converter)
Removes the givenDomainModelReferenceConverterEMF
to the Set of reference converters.- Parameters:
converter
- TheDomainModelReferenceConverterEMF
to remove
-
getObservableList
public org.eclipse.core.databinding.observable.list.IObservableList getObservableList(VDomainModelReference domainModelReference, org.eclipse.emf.ecore.EObject object) throws DatabindingFailedException
Description copied from interface:EMFFormsDatabinding
Returns anIObservableList
by observing the list described by the givenVDomainModelReference
of the givenEObject
.- Specified by:
getObservableList
in interfaceEMFFormsDatabinding
- Specified by:
getObservableList
in interfaceEMFFormsDatabindingEMF
- Parameters:
domainModelReference
- The domain model reference pointing to the desired listobject
- The root object of the rendered form. If theVDomainModelReference
contains a path, the object is the first node of the path. Therefore, theIObservableValue
can be bound to a feature of a sub element in case of a path.- Returns:
- The resulting
IObservableList
, does not returnnull
- Throws:
DatabindingFailedException
- if the databinding could not be executed successfully.
-
getListProperty
public org.eclipse.emf.databinding.IEMFListProperty getListProperty(VDomainModelReference domainModelReference, org.eclipse.emf.ecore.EObject object) throws DatabindingFailedException
Description copied from interface:EMFFormsDatabinding
Returns anIListProperty
described by the givenVDomainModelReference
.- Specified by:
getListProperty
in interfaceEMFFormsDatabinding
- Specified by:
getListProperty
in interfaceEMFFormsDatabindingEMF
- Parameters:
domainModelReference
- The domain model reference pointing to the desired listobject
- The root object of the rendered form. If theVDomainModelReference
contains a path, the object is the first node of the path. Therefore, theIValueProperty
can be bound to a feature of a sub element in case of a path.- Returns:
- The resulting
IListProperty
, does not returnnull
. - Throws:
DatabindingFailedException
- if the databinding could not be executed successfully.
-
extractFeature
public org.eclipse.emf.ecore.EStructuralFeature extractFeature(org.eclipse.core.databinding.observable.value.IObservableValue observableValue) throws DatabindingFailedException
Description copied from interface:EMFFormsDatabindingEMF
Extracts theEStructuralFeature
from the providedIObservableValue
.- Specified by:
extractFeature
in interfaceEMFFormsDatabindingEMF
- Parameters:
observableValue
- TheIObservableValue
to extract theEStructuralFeature
from- Returns:
- The extracted
EStructuralFeature
- Throws:
DatabindingFailedException
- when theIObservableValue
doesn't implementIEMFObservable
-
extractFeature
public org.eclipse.emf.ecore.EStructuralFeature extractFeature(org.eclipse.core.databinding.observable.list.IObservableList observableList) throws DatabindingFailedException
Description copied from interface:EMFFormsDatabindingEMF
Extracts theEStructuralFeature
from the providedIObservableList
.- Specified by:
extractFeature
in interfaceEMFFormsDatabindingEMF
- Parameters:
observableList
- TheIObservableList
to extract theEStructuralFeature
from- Returns:
- The extracted
EStructuralFeature
- Throws:
DatabindingFailedException
- when theIObservableValue
doesn't implementIEMFObservable
-
extractObserved
public org.eclipse.emf.ecore.EObject extractObserved(org.eclipse.core.databinding.observable.value.IObservableValue observableValue) throws DatabindingFailedException
Description copied from interface:EMFFormsDatabindingEMF
Extracts the observedEObject
from the providedIObservableValue
.- Specified by:
extractObserved
in interfaceEMFFormsDatabindingEMF
- Parameters:
observableValue
- TheIObservableValue
to extract the observedEObject
from- Returns:
- The extracted
EObject
- Throws:
DatabindingFailedException
- when theIObservableValue
doesn't implementIEMFObservable
-
extractObserved
public org.eclipse.emf.ecore.EObject extractObserved(org.eclipse.core.databinding.observable.list.IObservableList observableList) throws DatabindingFailedException
Description copied from interface:EMFFormsDatabindingEMF
Extracts the observedEObject
from the providedIObservableList
.- Specified by:
extractObserved
in interfaceEMFFormsDatabindingEMF
- Parameters:
observableList
- TheIObservableList
to extract the observedEObject
from- Returns:
- The extracted
EObject
- Throws:
DatabindingFailedException
- when theIObservableValue
doesn't implementIEMFObservable
-
getSetting
public org.eclipse.emf.ecore.EStructuralFeature.Setting getSetting(VDomainModelReference domainModelReference, org.eclipse.emf.ecore.EObject object) throws DatabindingFailedException
Description copied from interface:EMFFormsDatabindingEMF
Retrieve the Setting which is described by the providedVDomainModelReference
and the providedEObject
.- Specified by:
getSetting
in interfaceEMFFormsDatabindingEMF
- Parameters:
domainModelReference
- TheVDomainModelReference
to use to retrieve the settingobject
- TheEObject
to use to retrieve the setting- Returns:
- The Setting being described by the
VDomainModelReference
- Throws:
DatabindingFailedException
- if the databinding could not be executed successfully.
-
resolveSegment
public org.eclipse.emf.ecore.EStructuralFeature.Setting resolveSegment(VDomainModelReferenceSegment segment, org.eclipse.emf.ecore.EObject domainObject) throws DatabindingFailedException
Description copied from interface:EMFFormsSegmentResolver
Resolves the givensegment
from the givendomain object
and returns the resultingEStructuralFeature.Setting
.- Specified by:
resolveSegment
in interfaceEMFFormsSegmentResolver
- Parameters:
segment
- TheVDomainModelReferenceSegment
to resolvedomainObject
- The segment's root for which the segment is resolved- Returns:
- The resolved
EStructuralFeature.Setting
- Throws:
DatabindingFailedException
- if noEStructuralFeature.Setting
could be resolved
-
-