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

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

Introduction

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

Prototype

public GQuery add(String selector) 

Source Link

Document

Add elements to the set of matched elements if they are not included yet.

Usage

From source file:org.kaaproject.avro.ui.gwt.client.widget.choosen.AvroChoosenListBox.java

License:Apache License

public static void updateChoosenListBoxMaxTextWidth(ChosenListBox box, int width, TextWidthFunction function) {
    ChosenImpl impl = $(box.getElement()).data(CHOSEN_DATA_KEY, ChosenImpl.class);
    if (impl != null) {
        GQuery results = impl.getContainer().find("li." + avroChoosenResources.css().activeResult(),
                "li." + avroChoosenResources.css().resultSelected());
        GQuery searchchoiceSpan = impl.getContainer().find("li." + avroChoosenResources.css().searchChoice())
                .find("span");
        results = results.add(searchchoiceSpan);
        results = results.add($(box.getElement()).find("option"));
        for (int i = 0; i < results.size(); i++) {
            Element e = results.get(i);
            GQuery ge = $(e);//w ww . j a v a2 s  .  c  o  m
            ge.text(function.updateTextWidth(ge.text(), width));
        }
    }
}