Example usage for com.google.gwt.query.client GQuery is

List of usage examples for com.google.gwt.query.client GQuery is

Introduction

In this page you can find the example usage for com.google.gwt.query.client GQuery is.

Prototype

public boolean is(String... filters) 

Source Link

Document

Checks the current selection against an expression and returns true, if at least one element of the selection fits the given expression.

Usage

From source file:com.arcbees.chosen.client.ChosenImpl.java

License:Apache License

private void keydownArrow() {
    if (isNotResultHighlighted()) {
        activateFirstResult();// w  w w  .j  a  v a  2s  . c  o m
    } else if (resultsShowing) {
        // TODO should be replaced by :
        // GQuery nextSibling = resultHighlight.nextAll("li."+css.activeResult()).first();
        // but performance is bad... See http://code.google.com/p/gwtquery/issues/detail?id=146

        GQuery nextSibling = resultHighlight.next();

        while (!nextSibling.isEmpty() && !nextSibling.is("li." + css.activeResult())) {
            nextSibling = nextSibling.next();
        }

        resultDoHighlight(nextSibling);
    }

    if (!resultsShowing) {
        resultsShow();
    }
}

From source file:com.arcbees.chosen.client.ChosenImpl.java

License:Apache License

private void keyupArrow() {
    if (!resultsShowing) {
        resultsShow();//from  www. j a  v  a  2  s  . c  om
    } else if (isNotResultHighlighted()) {
        activateLastResult();
    } else if (resultHighlight != null) {
        // TODO should be replaced by :
        // GQuery prevSibs = resultHighlight.prevAll("li." + css.activeResult());
        // but performance is bad... See http://code.google.com/p/gwtquery/issues/detail?id=146

        GQuery prevSibling = resultHighlight.prev();

        while (!prevSibling.isEmpty() && !prevSibling.is("li." + css.activeResult())) {
            prevSibling = prevSibling.prev();
        }

        if (prevSibling.length() > 0) {
            resultDoHighlight(prevSibling.first());
        } else {
            if (choices > 0) {
                resultsHide();
            }

            resultClearHighlight();
        }
    }
}

From source file:com.watopi.chosen.client.ChosenImpl.java

License:Open Source License

private void keydownArrow() {
    if (resultHighlight == null) {
        GQuery firstActive = searchResults.find("li." + css.activeResult()).first();
        if (firstActive != null) {
            resultDoHighlight(firstActive);
        }/*from  w w w.j a  v a  2  s . c om*/
    } else if (resultsShowing) {
        // TODO should be replaced by :
        // GQuery nextSibling = resultHighlight.nextAll("li."+css.activeResult()).first();
        // but performance is bad... See http://code.google.com/p/gwtquery/issues/detail?id=146

        GQuery nextSibling = resultHighlight.next();

        while (!nextSibling.isEmpty() && !nextSibling.is("li." + css.activeResult())) {
            nextSibling = nextSibling.next();
        }

        resultDoHighlight(nextSibling);

    }

    if (!resultsShowing) {
        resultsShow();
    }
}

From source file:com.watopi.chosen.client.ChosenImpl.java

License:Open Source License

private void keyupArrow() {
    if (!resultsShowing && !isMultiple) {
        resultsShow();/*w  ww  .ja v a2  s .co  m*/
    } else if (resultHighlight != null) {
        // TODO should be replaced by :
        // GQuery prevSibs = resultHighlight.prevAll("li." + css.activeResult());
        // but performance is bad... See http://code.google.com/p/gwtquery/issues/detail?id=146

        GQuery prevSibling = resultHighlight.prev();

        while (!prevSibling.isEmpty() && !prevSibling.is("li." + css.activeResult())) {
            prevSibling = prevSibling.prev();
        }

        if (prevSibling.length() > 0) {
            resultDoHighlight(prevSibling.first());
        } else {
            if (choices > 0) {
                resultsHide();
            }

            resultClearHighlight();
        }
    }

}

From source file:org.bonitasoft.web.toolkit.client.ui.component.table.Table.java

License:Open Source License

private void processEvent(final GQuery cb) {
    final GQuery labels = cb.closest("div").children("label");
    String itemId = cb.val();
    if (cb.is(":checked")) {
        onCheckItem(labels, itemId);/*from ww w.  j a  v  a 2s .  co  m*/
    } else {
        onUncheckItem(labels, itemId);
    }

    // Check all if no checkbox unchecked
    final boolean noCheckboxCheched = $(".td_checkboxes input", Table.this.getElement()).filter(":checked")
            .length() == $(".td_checkboxes input", Table.this.getElement()).length();
    if (noCheckboxCheched) {
        setCheckAllCheckboxesValue($(".th_checkboxes input", Table.this.getElement()), true);
    } else {
        setCheckAllCheckboxesValue($(".th_checkboxes input", Table.this.getElement()), false);
    }

    // Set datatable class to to inform about selected or not
    if ($(".td_checkboxes input", Table.this.getElement()).filter(":checked").length() > 0) {
        $(getElement()).addClass("linechecked");
        enableActionsLinks();
    } else {
        $(getElement()).removeClass("linechecked");
        disableActionLinks();
    }
}

From source file:org.bonitasoft.web.toolkit.client.ui.component.table.Table.java

License:Open Source License

private boolean isCheckable(GQuery checkboxes) {
    return checkboxes != null && checkboxes.length() > 0 && checkboxes.is("input[type='checkbox']");
}