public class LocalizedEnumeratorComparator extends Object implements FeatureAwareComparator<org.eclipse.emf.common.util.Enumerator>
Enumerator
values and compares them to each other.
Enumerators are localized by retrieving their literals' labels from the corresponding edit bundle by using the
EMFFormsLocalizationService
. Retrieved edit bundles are cached to avoid re-resolving them for every
comparison.Constructor and Description |
---|
LocalizedEnumeratorComparator(EMFFormsLocalizationService localizationService,
BundleResolver bundleResolver,
ReportService reportService)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
compare(org.eclipse.emf.ecore.EStructuralFeature feature,
org.eclipse.emf.common.util.Enumerator leftValue,
org.eclipse.emf.common.util.Enumerator rightValue)
Compares two values of the given feature.
|
public LocalizedEnumeratorComparator(EMFFormsLocalizationService localizationService, BundleResolver bundleResolver, ReportService reportService)
localizationService
- The EMFFormsLocalizationService
to get the localized literal labelsbundleResolver
- The BundleResolver
to resolve the edit bundlesreportService
- The ReportService
to report missing edit bundlespublic int compare(org.eclipse.emf.ecore.EStructuralFeature feature, org.eclipse.emf.common.util.Enumerator leftValue, org.eclipse.emf.common.util.Enumerator rightValue)
FeatureAwareComparator
compare
in interface FeatureAwareComparator<org.eclipse.emf.common.util.Enumerator>
feature
- The EStructuralFeature
containing the valuesleftValue
- Left valuerightValue
- Right Value0
if the left value is equal to the right value;
a positive number if the left value is greater than the right value.
Thereby, null
input values are treated as bigger than any other non-null valueComparator.compare(Object, Object)
Copyright © 2019. All rights reserved.