Search in sources :

Example 1 with HTMLText

use of com.storedobject.common.HTMLText in project SODevelopment by syampillai.

the class ELabel method convert.

private static Object convert(Object object) {
    if (object == null) {
        return "";
    }
    if (object instanceof Icon) {
        HTMLText h = new HTMLText();
        h.appendHTML("<iron-icon icon=\"" + ((Icon) object).getElement().getAttribute("icon") + "\"></iron-icon>");
        return h;
    }
    if (object instanceof ELabel) {
        return ((ELabel) object).label;
    }
    Application a = Application.get();
    if (a != null) {
        return a.getEnvironment().toDisplay(object);
    }
    return object;
}
Also used : HTMLText(com.storedobject.common.HTMLText) Icon(com.vaadin.flow.component.icon.Icon)

Aggregations

HTMLText (com.storedobject.common.HTMLText)1 Icon (com.vaadin.flow.component.icon.Icon)1