@Test public void testGetSelectorData() { assertConstraintTypeIsPresent(ConstraintType.EXPRESSION, values); assertConstraintTypeIsPresent(ConstraintType.ENUMERATION, values); assertConstraintTypeIsPresent(ConstraintType.RANGE, values); }
@Override public SelectorData getSelectorData(final FormRenderingContext context) { final Map<Object, String> values = new TreeMap<>(Comparator.comparing(o -> valuePosition.get(o))); Arrays.stream(ConstraintType.values()) .forEach(scope -> values.put(scope.value(), translationService.getTranslation(KEY_PREFIX + scope.value()))); values.put("", translationService.getTranslation(KEY_PREFIX + "selectType")); return new SelectorData(values, ConstraintType.EXPRESSION.value()); }
ConstraintTypeDataProvider implements SelectorDataProvider { @Override public SelectorData getSelectorData(final FormRenderingContext context) { final Map<Object, String> values = new TreeMap<>(Comparator.comparing(o -> valuePosition.get(o))); Arrays.stream(ConstraintType.values()) .forEach(scope -> values.put(scope.value(), translationService.getTranslation(KEY_PREFIX + scope.value()))); values.put("", translationService.getTranslation(KEY_PREFIX + "selectType")); return new SelectorData(values, ConstraintType.EXPRESSION.value()); } }
ConstraintTypeDataProvider implements SelectorDataProvider { @Override public SelectorData getSelectorData(final FormRenderingContext context) { final Map<Object, String> values = new TreeMap<>(Comparator.comparing(o -> valuePosition.get(o))); Arrays.stream(ConstraintType.values()) .forEach(scope -> values.put(scope.value(), translationService.getTranslation(KEY_PREFIX + scope.value()))); values.put("", translationService.getTranslation(KEY_PREFIX + "selectType")); return new SelectorData(values, ConstraintType.EXPRESSION.value()); } @Inject  ConstraintTypeDataProvider(final TranslationService translationService); }
ConstraintTypeDataProvider implements SelectorDataProvider { @Override public SelectorData getSelectorData(final FormRenderingContext context) { final Map<Object, String> values = new TreeMap<>(Comparator.comparing(o -> valuePosition.get(o))); Arrays.stream(ConstraintType.values()) .forEach(scope -> values.put(scope.value(), translationService.getTranslation(KEY_PREFIX + scope.value()))); values.put("", translationService.getTranslation(KEY_PREFIX + "selectType")); return new SelectorData(values, ConstraintType.EXPRESSION.value()); } @Inject  ConstraintTypeDataProvider(final TranslationService translationService); @Override String getProviderName(); @Override SelectorData getSelectorData(final FormRenderingContext context); }
ConstraintTypeDataProvider implements SelectorDataProvider { @Override public SelectorData getSelectorData(final FormRenderingContext context) { final Map<Object, String> values = new TreeMap<>(Comparator.comparing(o -> valuePosition.get(o))); Arrays.stream(ConstraintType.values()) .forEach(scope -> values.put(scope.value(), translationService.getTranslation(KEY_PREFIX + scope.value()))); values.put("", translationService.getTranslation(KEY_PREFIX + "selectType")); return new SelectorData(values, ConstraintType.EXPRESSION.value()); } @Inject  ConstraintTypeDataProvider(final TranslationService translationService); @Override String getProviderName(); @Override SelectorData getSelectorData(final FormRenderingContext context);  }