Class IndexSegmentConverter
- java.lang.Object
-
- org.eclipse.emfforms.internal.core.services.segments.index.IndexSegmentConverter
-
- All Implemented Interfaces:
DomainModelReferenceSegmentConverterEMF
public class IndexSegmentConverter extends java.lang.Object implements DomainModelReferenceSegmentConverterEMF
ConvertsVIndexDomainModelReferenceSegments
to value and list properties, and tosettings
.- Author:
- Lucas Koehler
-
-
Field Summary
-
Fields inherited from interface org.eclipse.emfforms.spi.core.services.databinding.emf.DomainModelReferenceSegmentConverterEMF
NOT_APPLICABLE
-
-
Constructor Summary
Constructors Constructor Description IndexSegmentConverter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SegmentConverterListResultEMF
convertToListProperty(VDomainModelReferenceSegment segment, org.eclipse.emf.ecore.EClass segmentRoot, org.eclipse.emf.edit.domain.EditingDomain editingDomain)
Converts aVDomainModelReferenceSegment
to anIListProperty
.SegmentConverterValueResultEMF
convertToValueProperty(VDomainModelReferenceSegment segment, org.eclipse.emf.ecore.EClass segmentRoot, org.eclipse.emf.edit.domain.EditingDomain editingDomain)
Converts aVDomainModelReferenceSegment
to anIValueProperty
.org.eclipse.emf.ecore.EStructuralFeature.Setting
getSetting(VDomainModelReferenceSegment segment, org.eclipse.emf.ecore.EObject eObject)
Retrieve the Setting which is described by the providedVDomainModelReferenceSegment
and the providedEObject
.double
isApplicable(VDomainModelReferenceSegment segment)
Checks whether the givenVDomainModelReferenceSegment
can be converted by thisDomainModelReferenceSegmentConverterEMF
to anIValueProperty
or anIListProperty
.
-
-
-
Method Detail
-
isApplicable
public double isApplicable(VDomainModelReferenceSegment segment)
Description copied from interface:DomainModelReferenceSegmentConverterEMF
Checks whether the givenVDomainModelReferenceSegment
can be converted by thisDomainModelReferenceSegmentConverterEMF
to anIValueProperty
or anIListProperty
. The return value is the priority of this converter. The higher the priority, the better the converter suits the givenVDomainModelReferenceSegment
.- Specified by:
isApplicable
in interfaceDomainModelReferenceSegmentConverterEMF
- Parameters:
segment
- TheVDomainModelReferenceSegment
whose priority is wanted.- Returns:
- The priority of the given
VDomainModelReferenceSegment
; negative infinity if this converter is not applicable.
-
convertToValueProperty
public SegmentConverterValueResultEMF convertToValueProperty(VDomainModelReferenceSegment segment, org.eclipse.emf.ecore.EClass segmentRoot, org.eclipse.emf.edit.domain.EditingDomain editingDomain) throws DatabindingFailedException
Description copied from interface:DomainModelReferenceSegmentConverterEMF
Converts aVDomainModelReferenceSegment
to anIValueProperty
.- Specified by:
convertToValueProperty
in interfaceDomainModelReferenceSegmentConverterEMF
- Parameters:
segment
- TheVDomainModelReferenceSegment
that will be converted to anIValueProperty
segmentRoot
- The rootEClass
of thesegment
used to resolve the segment to anEStructuralFeature
. This means theEClass
has to contain the feature used in the segmenteditingDomain
- TheEditingDomain
in which theIEMFValueProperty
is created- Returns:
- The
SegmentConverterValueResultEMF
with the createdIEMFValueProperty
, does not returnnull
- Throws:
DatabindingFailedException
- if no value property could be created
-
convertToListProperty
public SegmentConverterListResultEMF convertToListProperty(VDomainModelReferenceSegment segment, org.eclipse.emf.ecore.EClass segmentRoot, org.eclipse.emf.edit.domain.EditingDomain editingDomain) throws DatabindingFailedException
Description copied from interface:DomainModelReferenceSegmentConverterEMF
Converts aVDomainModelReferenceSegment
to anIListProperty
.- Specified by:
convertToListProperty
in interfaceDomainModelReferenceSegmentConverterEMF
- Parameters:
segment
- TheVDomainModelReferenceSegment
that will be converted to anIValueProperty
segmentRoot
- The rootEClass
of thesegment
used to resolve the segment to anEStructuralFeature
. This means theEClass
has to contain the feature used in the segmenteditingDomain
- TheEditingDomain
in which theIEMFValueProperty
is created- Returns:
- The
SegmentConverterListResultEMF
with the createdIEMFListProperty
, does not returnnull
- Throws:
DatabindingFailedException
- if no value property could be created
-
getSetting
public org.eclipse.emf.ecore.EStructuralFeature.Setting getSetting(VDomainModelReferenceSegment segment, org.eclipse.emf.ecore.EObject eObject) throws DatabindingFailedException
Description copied from interface:DomainModelReferenceSegmentConverterEMF
Retrieve the Setting which is described by the providedVDomainModelReferenceSegment
and the providedEObject
.- Specified by:
getSetting
in interfaceDomainModelReferenceSegmentConverterEMF
- Parameters:
segment
- TheVDomainModelReferenceSegment
to use to retrieve the settingeObject
- TheEObject
to use to retrieve the setting. ThisEObject
must have the sameEClass
as the feature used in the segment- Returns:
- The Setting being described by the
segment
andEObject
- Throws:
DatabindingFailedException
- if the databinding could not be executed successfully.
-
-