Hello
I’m using the
Elements Add-on
to use polymer elements on the server side.
I implemented a PaperIconButton which works with the “src” attribute.
[code]
import org.vaadin.elements.Element;
import org.vaadin.elements.Elements;
import org.vaadin.elements.Import;
import org.vaadin.elements.Tag;
@Tag(“paper-icon-button”)
@Import(“/VAADIN/bower_components/paper-icon-button/paper-icon-button.html”)
public interface PaperIconButton extends Element {
public static PaperIconButton create() {
return Elements.create(PaperIconButton.class);
}
public static PaperIconButton create(String icon) {
PaperIconButton button = create();
button.setAttribute("src", "/VAADIN/icons/" + icon + ".png");
return button;
}
public static PaperIconButton create(String icon, String tooltip) {
PaperIconButton button = create(icon);
button.setAttribute("title", tooltip);
return button;
}
}
[/code]I would like to use the “icon” attribute instead, so I can use the vaadin icons, e.g.:
button.setAttribute("icon", "menu");
According to this link
https://vaadin.com/icons/download
I need to include the following:
[code]
[/code]How do I manage this on the server side? Use @Import like for the [url=https://github.com/vaadin/serverside-elements/blob/master/elements-demo/src/main/java/org/vaadin/elements/demo/PaperButton.java] Demo [/url] PaperButton? [code] @Tag("paper-button") @Import("VAADIN/bower_components/paper-button/paper-button.html") public interface PaperButton extends Element { [/code]I can't use multiple @Import: [code] @Import("/VAADIN/bower_components/iron-icons/iron-icon.html") @Import("/VAADIN/bower_components/vaadin-icons/vaadin-icons.html") public class ViewerUI extends UI { [/code]Am I on the wrong track?