use of com.enonic.xp.style.StyleDescriptors in project xp by enonic.
the class HtmlLinkProcessor method getImageStyleMap.
private ImmutableMap<String, ImageStyle> getImageStyleMap(final PortalRequest portalRequest) {
final ImmutableMap.Builder<String, ImageStyle> imageStyleMap = ImmutableMap.builder();
final StyleDescriptors styleDescriptors = getStyleDescriptors(portalRequest);
styleDescriptors.stream().flatMap(styleDescriptor -> styleDescriptor.getElements().stream()).filter(elementStyle -> ImageStyle.STYLE_ELEMENT_NAME.equals(elementStyle.getElement())).forEach(elementStyle -> imageStyleMap.put(elementStyle.getName(), (ImageStyle) elementStyle));
return imageStyleMap.build();
}
use of com.enonic.xp.style.StyleDescriptors in project xp by enonic.
the class StyleDescriptorServiceImplTest method getAll.
@Test
public void getAll() {
final ApplicationKey appKey = ApplicationKey.from("myapp1");
final StyleDescriptors descriptors = this.service.getAll();
assertNotNull(descriptors);
assertEquals(2, descriptors.getSize());
}
use of com.enonic.xp.style.StyleDescriptors in project xp by enonic.
the class StyleDescriptorServiceImplTest method getByApplications.
@Test
public void getByApplications() {
final ApplicationKeys appKeys = ApplicationKeys.from("myapp1", "myapp2");
final StyleDescriptors descriptors = this.service.getByApplications(appKeys);
assertNotNull(descriptors);
assertEquals(2, descriptors.getSize());
}
Aggregations