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

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

Introduction

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

Prototype

public GQuery text(String txt) 

Source Link

Document

Set the innerText of every matched element.

Usage

From source file:be.dramaix.ai.slidingpuzzle.client.ConfigPanel.java

License:Apache License

private void onDimensionChange(int newDimension) {
    GQuery algorithmSelector = SELECTOR.getAlgorithmSelectElement();
    GQuery algorithmSelectorSpan = algorithmSelector.siblings("span");
    GQuery heuristicSelectorRow = SELECTOR.getHeuristicSelectElement().parent().parent();

    if (newDimension == 4) {
        algorithmType = AlgorithmType.IDA_STAR;

        algorithmSelector.val(AlgorithmType.IDA_STAR.name());
        algorithmSelector.hide();//from ww w.j  a  va  2 s  . c o m
        algorithmSelectorSpan.text(AlgorithmType.IDA_STAR.getLabel());

        heuristicSelectorRow.show();
    } else {
        algorithmSelectorSpan.text("");
        algorithmSelector.show();

    }

    SELECTOR.getSolveButton().hide();
    SELECTOR.getPlayButton().hide();

}

From source file:com.arcbees.gquery.tooltip.client.TooltipImpl.java

License:Apache License

private void setContent(GQuery inner) {
    String title = getTitle();//w w  w  .  j a  v a 2 s  .c  om
    if (options.isHtml()) {
        inner.html(title);
    } else {
        inner.text(title);
    }
}

From source file:org.bonitasoft.web.toolkit.client.ui.component.menu.MenuFolder.java

License:Open Source License

@Override
protected Element makeElement() {
    this.items.setRootTagName("ul");
    this.items.setWrapTag(null, null);

    final GQuery root = $("<li>");
    root.addClass("menuitem");
    if (getJsId() != null) {
        root.addClass(getJsId().toString("menuitem"));
    }//from   w  ww . j  ava  2  s .c o m

    GQuery link = null;
    ;
    if (this.image != null || this.label != null && this.label.length() > 0) {
        link = $("<a href=\"#\">" + this.label + "</a>");
        root.append(link);

        if (this.label != null && this.label.length() > 0) {
            link.text(this.label);
        }

        if (this.image != null) {
            link.prepend(this.image.getElement());
        }

    }

    appendComponentToHtml((Element) root.get(0), this.items);

    return (Element) root.get(0);
}

From source file:org.bonitasoft.web.toolkit.client.ui.component.menu.MenuFolder.java

License:Open Source License

public void setLabel(final String label) {
    this.label = label;

    if (isGenerated()) {
        final GQuery link = $(this.element).children("a");
        final GQuery image = link.find("img");

        link.text(label);
        if (image.length() > 0) {
            link.prepend(image);/*from   w w  w  .  j a v  a  2  s.  c  o  m*/
        }
    }
}

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);
            ge.text(function.updateTextWidth(ge.text(), width));
        }/*  ww w. ja  v  a2s. c o m*/
    }
}