use of com.aire.ux.test.ElementResolver in project aire-components by aire-ux.
the class PathRegistryParameterResolver method create.
@Override
public ElementResolver create(AnnotatedElement element) {
return new ElementResolver() {
@Override
@SuppressWarnings("unchecked")
public <T> T resolve() {
val selector = element.getAnnotation(Select.class);
val value = Utilities.firstNonDefault(selector.value(), selector.selector());
return (T) Selection.path(value).select(Aire.getUserInterface(), UI::getCurrent, new DefaultComponentExtension<>(value, c -> {
})).map(ExtensionDefinition::getValue).get();
}
};
}
Aggregations