Search in sources :

Example 1 with HTMLDivElement

use of elemental2.dom.HTMLDivElement in project openremote by openremote.

the class AppViewImpl method onDetach.

@Override
protected void onDetach() {
    super.onDetach();
    // TODO Not a very pretty hack to close all popup panels on app error
    DomGlobal.document.querySelectorAll(".or-PopupPanel").forEach((p0, p1, p2) -> {
        if (p0 instanceof HTMLDivElement) {
            HTMLDivElement htmlDivElement = (HTMLDivElement) p0;
            htmlDivElement.parentNode.removeChild(htmlDivElement);
        }
        return null;
    });
}
Also used : HTMLDivElement(elemental2.dom.HTMLDivElement)

Example 2 with HTMLDivElement

use of elemental2.dom.HTMLDivElement in project vue-gwt by Axellience.

the class VueGwtWidget method mountVueComponent.

private void mountVueComponent() {
    HTMLDivElement vueElement = (HTMLDivElement) DomGlobal.document.createElement("div");
    getElement().appendChild(Js.cast(vueElement));
    vueComponentInstance.$mount(vueElement);
}
Also used : HTMLDivElement(elemental2.dom.HTMLDivElement)

Example 3 with HTMLDivElement

use of elemental2.dom.HTMLDivElement in project domino-ui-demo by DominoKit.

the class ModalsViewImpl method initModalColor.

private void initModalColor() {
    Card card = Card.create("WITH MATERIAL DESIGN COLORS", "You can use material design colors.");
    HTMLDivElement buttonsContainer = div().css("button-demo").asElement();
    card.appendContent(buttonsContainer);
    // ------------ Red ------------
    ModalDialog modalDialogRed = createModalDialog().setModalColor(Color.RED);
    Button redButton = Button.create("RED").setBackground(Background.RED);
    redButton.getClickableElement().addEventListener("click", e -> openDialog(modalDialogRed));
    buttonsContainer.appendChild(redButton.asElement());
    element.appendChild(modalDialogRed.asElement());
    // ------------ Pink ------------
    ModalDialog modalDialogPink = createModalDialog().setModalColor(Color.PINK);
    Button pinkButton = Button.create("PINK").setBackground(Background.PINK);
    pinkButton.getClickableElement().addEventListener("click", e -> openDialog(modalDialogPink));
    buttonsContainer.appendChild(pinkButton.asElement());
    element.appendChild(modalDialogPink.asElement());
    // ------------ Purple ------------
    ModalDialog modalDialogPurple = createModalDialog().setModalColor(Color.PURPLE);
    Button purpleButton = Button.create("PURPLE").setBackground(Background.PURPLE);
    purpleButton.getClickableElement().addEventListener("click", e -> openDialog(modalDialogPurple));
    buttonsContainer.appendChild(purpleButton.asElement());
    element.appendChild(modalDialogPurple.asElement());
    // ------------ Deep Purple ------------
    ModalDialog modalDialogDeepPurple = createModalDialog().setModalColor(Color.DEEP_PURPLE);
    Button deepPurpleButton = Button.create("DEEP PURPLE").setBackground(Background.DEEP_PURPLE);
    deepPurpleButton.getClickableElement().addEventListener("click", e -> openDialog(modalDialogDeepPurple));
    buttonsContainer.appendChild(deepPurpleButton.asElement());
    element.appendChild(modalDialogDeepPurple.asElement());
    // ------------ Indigo ------------
    ModalDialog modalDialogIndigo = createModalDialog().setModalColor(Color.INDIGO);
    Button indigoButton = Button.create("INDIGO").setBackground(Background.INDIGO);
    indigoButton.getClickableElement().addEventListener("click", e -> openDialog(modalDialogIndigo));
    buttonsContainer.appendChild(indigoButton.asElement());
    element.appendChild(modalDialogIndigo.asElement());
    // ------------ Blue ------------
    ModalDialog modalDialogBlue = createModalDialog().setModalColor(Color.BLUE);
    Button blueButton = Button.create("BLUE").setBackground(Background.BLUE);
    blueButton.getClickableElement().addEventListener("click", e -> openDialog(modalDialogBlue));
    buttonsContainer.appendChild(blueButton.asElement());
    element.appendChild(modalDialogBlue.asElement());
    // ------------ Orange ------------
    ModalDialog modalDialogOrange = createModalDialog().setModalColor(Color.ORANGE);
    Button orangeButton = Button.create("ORANGE").setBackground(Background.ORANGE);
    orangeButton.getClickableElement().addEventListener("click", e -> openDialog(modalDialogOrange));
    buttonsContainer.appendChild(orangeButton.asElement());
    element.appendChild(modalDialogOrange.asElement());
    // ------------ Green ------------
    ModalDialog modalDialogGreen = createModalDialog().setModalColor(Color.GREEN);
    Button greenButton = Button.create("GREEN").setBackground(Background.GREEN);
    greenButton.getClickableElement().addEventListener("click", e -> openDialog(modalDialogGreen));
    buttonsContainer.appendChild(greenButton.asElement());
    element.appendChild(modalDialogGreen.asElement());
    // ------------ Teal ------------
    ModalDialog modalDialogTeal = createModalDialog().setModalColor(Color.TEAL);
    Button tealButton = Button.create("TEAL").setBackground(Background.TEAL);
    tealButton.getClickableElement().addEventListener("click", e -> openDialog(modalDialogTeal));
    buttonsContainer.appendChild(tealButton.asElement());
    element.appendChild(modalDialogTeal.asElement());
    element.appendChild(card.asElement());
    element.appendChild(Card.createCodeCard(CodeResource.INSTANCE.initModalColor()).asElement());
}
Also used : Button(org.dominokit.domino.ui.button.Button) HTMLDivElement(elemental2.dom.HTMLDivElement) ModalDialog(org.dominokit.domino.ui.modals.ModalDialog) Card(org.dominokit.domino.ui.cards.Card)

Aggregations

HTMLDivElement (elemental2.dom.HTMLDivElement)3 Button (org.dominokit.domino.ui.button.Button)1 Card (org.dominokit.domino.ui.cards.Card)1 ModalDialog (org.dominokit.domino.ui.modals.ModalDialog)1