Directory

IronImage - Vaadin Add-on Directory

Vaadin 10 component to integrate IronImage - Vaadin Add-on Directory
# IronImage Vaadin 10 Java integration of https://github.com/PolymerElements/iron-image ## Usage ### Flow only Adding an iron image as a component. ``` Component container = ...; IronImage image = new IronImage("http://.../example.jpg"); // setting some basic properties image.setSizing(IronImage.Sizing.COVER); // ... // styling image.addClassName("example-image"); // image.setWidth("100px"); // activate preloading image.setPlaceholder("http://.../small-placeholder.jpg"); image.activatePreload(); container.add(image); ``` ### Polymer + Flow Using the image in a Polymer template. ``` ... ``` and attaching it to Flow ``` @Route("...") public class View ... { @Id("example-image") private IronImage image; @PostConstruct private void init() { ... // inform us, if the image source could not be loaded image.addErrorChangedListener(event -> System.out.println(event.isError() ? "error at loading image" : "everything is fine")); ... } } ```