Search in sources :

Example 1 with NodeList

use of org.jboss.errai.common.client.dom.NodeList in project kie-wb-common by kiegroup.

the class MonacoEditorView method attachListenerToPanelTitle.

// Workaround for refreshing Monaco editor and get scrollbars visible when the accordion is expanded
void attachListenerToPanelTitle() {
    final NodeList titleNodes = getParentInDepth(rootContainer, DEPTH).getElementsByClassName(PANEL_TITLE);
    for (int i = 0; i < titleNodes.getLength(); i++) {
        titleNodes.item(i).addEventListener(EVENT_NAME, event -> presenter.onLanguageChanged(languageSelector.getValue()), false);
    }
    if (resizeObserver == null) {
        resizeObserver = new ResizeObserver(event -> onResize());
        if (observeCommand == null) {
            observeCommand = () -> resizeObserver.observe((elemental2.dom.Element) monacoEditor.getParentElement().getParentNode());
        }
        observeCommand.execute();
    }
}
Also used : Option(org.jboss.errai.common.client.dom.Option) Event(org.jboss.errai.common.client.dom.Event) Div(org.jboss.errai.common.client.dom.Div) NodeList(org.jboss.errai.common.client.dom.NodeList) ForEvent(org.jboss.errai.ui.shared.api.annotations.ForEvent) HTMLElement(org.jboss.errai.common.client.dom.HTMLElement) MonacoEditor(org.uberfire.client.views.pfly.monaco.jsinterop.MonacoEditor) Inject(javax.inject.Inject) Templated(org.jboss.errai.ui.shared.api.annotations.Templated) StunnerFormsClientFieldsConstants(org.kie.workbench.common.stunner.bpmn.client.forms.fields.i18n.StunnerFormsClientFieldsConstants) PreDestroy(javax.annotation.PreDestroy) EventHandler(org.jboss.errai.ui.shared.api.annotations.EventHandler) Select(org.jboss.errai.common.client.dom.Select) MonacoStandaloneCodeEditor(org.uberfire.client.views.pfly.monaco.jsinterop.MonacoStandaloneCodeEditor) Js(jsinterop.base.Js) Dependent(javax.enterprise.context.Dependent) Node(org.jboss.errai.common.client.dom.Node) Window(org.jboss.errai.common.client.dom.Window) Element(org.jboss.errai.common.client.dom.Element) UberElement(org.uberfire.client.mvp.UberElement) DataField(org.jboss.errai.ui.shared.api.annotations.DataField) NodeList(org.jboss.errai.common.client.dom.NodeList) HTMLElement(org.jboss.errai.common.client.dom.HTMLElement) Element(org.jboss.errai.common.client.dom.Element) UberElement(org.uberfire.client.mvp.UberElement)

Example 2 with NodeList

use of org.jboss.errai.common.client.dom.NodeList in project kie-wb-common by kiegroup.

the class MonacoEditorView method clear.

private static void clear(Div div) {
    NodeList childNodes = div.getChildNodes();
    for (int i = 0; i < childNodes.getLength(); i++) {
        Node node = childNodes.item(i);
        div.removeChild(node);
    }
}
Also used : NodeList(org.jboss.errai.common.client.dom.NodeList) Node(org.jboss.errai.common.client.dom.Node)

Example 3 with NodeList

use of org.jboss.errai.common.client.dom.NodeList in project kie-wb-common by kiegroup.

the class SelectDocumentPopupViewImpl method clear.

@Override
public void clear() {
    final NodeList documents = documentsContainer.getChildNodes();
    for (int i = 0; i < documents.getLength(); i++) {
        final Node document = documents.item(i);
        documentsContainer.removeChild(document);
    }
}
Also used : NodeList(org.jboss.errai.common.client.dom.NodeList) Node(org.jboss.errai.common.client.dom.Node)

Example 4 with NodeList

use of org.jboss.errai.common.client.dom.NodeList in project kie-wb-common by kiegroup.

the class AppLauncherView method removeAllNodes.

public void removeAllNodes(final Element element) {
    final NodeList nodeList = element.getChildNodes();
    int length = nodeList.getLength();
    for (int i = 0; i < length; i++) {
        element.removeChild(nodeList.item(0));
    }
}
Also used : NodeList(org.jboss.errai.common.client.dom.NodeList)

Aggregations

NodeList (org.jboss.errai.common.client.dom.NodeList)4 Node (org.jboss.errai.common.client.dom.Node)3 PreDestroy (javax.annotation.PreDestroy)1 Dependent (javax.enterprise.context.Dependent)1 Inject (javax.inject.Inject)1 Js (jsinterop.base.Js)1 Div (org.jboss.errai.common.client.dom.Div)1 Element (org.jboss.errai.common.client.dom.Element)1 Event (org.jboss.errai.common.client.dom.Event)1 HTMLElement (org.jboss.errai.common.client.dom.HTMLElement)1 Option (org.jboss.errai.common.client.dom.Option)1 Select (org.jboss.errai.common.client.dom.Select)1 Window (org.jboss.errai.common.client.dom.Window)1 DataField (org.jboss.errai.ui.shared.api.annotations.DataField)1 EventHandler (org.jboss.errai.ui.shared.api.annotations.EventHandler)1 ForEvent (org.jboss.errai.ui.shared.api.annotations.ForEvent)1 Templated (org.jboss.errai.ui.shared.api.annotations.Templated)1 StunnerFormsClientFieldsConstants (org.kie.workbench.common.stunner.bpmn.client.forms.fields.i18n.StunnerFormsClientFieldsConstants)1 UberElement (org.uberfire.client.mvp.UberElement)1 MonacoEditor (org.uberfire.client.views.pfly.monaco.jsinterop.MonacoEditor)1