org.dominokit.domino.ui.utils.DominoElement Maven / Gradle / Ivy
package org.dominokit.domino.ui.utils;
import elemental2.dom.DomGlobal;
import elemental2.dom.HTMLBodyElement;
import elemental2.dom.HTMLDivElement;
import elemental2.dom.HTMLElement;
import org.jboss.gwt.elemento.core.Elements;
import org.jboss.gwt.elemento.core.IsElement;
public class DominoElement extends BaseDominoElement> {
private final E wrappedElement;
public static DominoElement of(E element) {
return new DominoElement<>(element);
}
public static DominoElement of(IsElement element) {
return new DominoElement<>(element.element());
}
public static DominoElement body() {
return new DominoElement<>(DomGlobal.document.body);
}
public static DominoElement div() {
return DominoElement.of(Elements.div());
}
public DominoElement(E element) {
this.wrappedElement = element;
init(this);
}
@Override
public E element() {
return wrappedElement;
}
}