Search in sources :

Example 1 with DomGlobal.setTimeout

use of elemental2.dom.DomGlobal.setTimeout in project gwtproject by treblereel.

the class RichTextAreaImplStandard method initElement.

@Override
public void initElement() {
    // Most browsers don"t like setting designMode until slightly _after_
    // the iframe becomes attached to the DOM. Any non-zero timeout will do
    // just fine.
    RichTextAreaImplStandard _this = this;
    _this.onElementInitializing();
    DomGlobal.setTimeout((ignore) -> {
        if (_this.elem != null) {
            HTMLIFrameElement iframe = Js.uncheckedCast(_this.elem);
            if (iframe.contentWindow != null) {
                ((JsPropertyMap) ((JsPropertyMap) iframe.contentWindow).get("document")).set("designMode", "On");
                _this.onElementInitialized();
            }
        }
    }, 1.0D, new Object[0]);
}
Also used : HTMLIFrameElement(elemental2.dom.HTMLIFrameElement) JsPropertyMap(jsinterop.base.JsPropertyMap)

Example 2 with DomGlobal.setTimeout

use of elemental2.dom.DomGlobal.setTimeout in project deephaven-core by deephaven.

the class JsTreeTable method snapshotQuery.

/**
 * Requests an update from the server. Should only be called by itself and scheduleSnapshotQuery.
 */
private void snapshotQuery() {
    if (closed) {
        JsLog.warn("TreeTable already closed, cannot perform operation");
        return;
    }
    // we're running now, so mark as already scheduled
    scheduled = false;
    if (firstRow == null || lastRow == null) {
        // viewport not set yet, don't start loading data
        return;
    }
    // clear any size update, we're getting data either way, future updates should be noted
    nextSnapshotState = NextSnapshotState.TIMER_RUNNING;
    viewportUpdateTimeoutId = DomGlobal.setTimeout(p -> {
        // started
        if (nextSnapshotState == NextSnapshotState.QUERY_WHEN_TIMER_ENDS) {
            scheduleSnapshotQuery(false);
        } else {
            // otherwise, this means that we should query right away if any update arrives
            nextSnapshotState = NextSnapshotState.QUERY_WHEN_UPDATE_SEEN;
        }
    }, updateInterval);
    if (connection.isUsable()) {
        running = true;
        TreeTableRequest query = buildQuery();
        Column[] queryColumns = this.columns;
        boolean alwaysFireEvent = this.alwaysFireNextEvent;
        this.alwaysFireNextEvent = false;
        JsLog.debug("Sending tree table request", this, LazyString.of(baseTable::getHandle), query, alwaysFireEvent);
        // }));
        throw new UnsupportedOperationException("treeSnapshotQuery");
    } else {
        JsLog.debug("Connection not ready, skipping tree table poll", this);
    }
}
Also used : JsRunnable(io.deephaven.web.shared.fu.JsRunnable) JsItr(io.deephaven.web.client.fu.JsItr) java.util(java.util) JsOptional(jsinterop.annotations.JsOptional) ColumnData(io.deephaven.web.shared.data.columns.ColumnData) JsMethod(jsinterop.annotations.JsMethod) Promise(elemental2.promise.Promise) Any(jsinterop.base.Any) JsProperty(jsinterop.annotations.JsProperty) Js(jsinterop.base.Js) io.deephaven.web.shared.data(io.deephaven.web.shared.data) io.deephaven.web.client.api(io.deephaven.web.client.api) ViewportRow(io.deephaven.web.client.api.subscription.ViewportRow) FilterCondition(io.deephaven.web.client.api.filter.FilterCondition) JsAggregationOperation(io.deephaven.web.client.api.tree.enums.JsAggregationOperation) LazyPromise(io.deephaven.web.client.fu.LazyPromise) JsObject(elemental2.core.JsObject) TreeTableRequest(io.deephaven.web.shared.data.treetable.TreeTableRequest) JsLog(io.deephaven.web.client.fu.JsLog) DomGlobal(elemental2.dom.DomGlobal) ViewportData(io.deephaven.web.client.api.subscription.ViewportData) ClientTableState(io.deephaven.web.client.state.ClientTableState) CustomEventInit(elemental2.dom.CustomEventInit) TreeTableResult(io.deephaven.web.shared.data.treetable.TreeTableResult) NO_ROW_FORMAT_COLUMN(io.deephaven.web.client.api.subscription.ViewportData.NO_ROW_FORMAT_COLUMN) ColumnDefinition(io.deephaven.web.client.api.barrage.def.ColumnDefinition) Key(io.deephaven.web.shared.data.treetable.Key) JsArray(elemental2.core.JsArray) HasLifecycle(io.deephaven.web.client.api.lifecycle.HasLifecycle) TreeRow(io.deephaven.web.client.api.tree.JsTreeTable.TreeViewportData.TreeRow) TableDetails(io.deephaven.web.shared.data.treetable.TableDetails) TreeTableRequest(io.deephaven.web.shared.data.treetable.TreeTableRequest)

Aggregations

JsArray (elemental2.core.JsArray)1 JsObject (elemental2.core.JsObject)1 CustomEventInit (elemental2.dom.CustomEventInit)1 DomGlobal (elemental2.dom.DomGlobal)1 HTMLIFrameElement (elemental2.dom.HTMLIFrameElement)1 Promise (elemental2.promise.Promise)1 io.deephaven.web.client.api (io.deephaven.web.client.api)1 ColumnDefinition (io.deephaven.web.client.api.barrage.def.ColumnDefinition)1 FilterCondition (io.deephaven.web.client.api.filter.FilterCondition)1 HasLifecycle (io.deephaven.web.client.api.lifecycle.HasLifecycle)1 ViewportData (io.deephaven.web.client.api.subscription.ViewportData)1 NO_ROW_FORMAT_COLUMN (io.deephaven.web.client.api.subscription.ViewportData.NO_ROW_FORMAT_COLUMN)1 ViewportRow (io.deephaven.web.client.api.subscription.ViewportRow)1 TreeRow (io.deephaven.web.client.api.tree.JsTreeTable.TreeViewportData.TreeRow)1 JsAggregationOperation (io.deephaven.web.client.api.tree.enums.JsAggregationOperation)1 JsItr (io.deephaven.web.client.fu.JsItr)1 JsLog (io.deephaven.web.client.fu.JsLog)1 LazyPromise (io.deephaven.web.client.fu.LazyPromise)1 ClientTableState (io.deephaven.web.client.state.ClientTableState)1 io.deephaven.web.shared.data (io.deephaven.web.shared.data)1