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

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

Introduction

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

Prototype

public GQuery val(String... values) 

Source Link

Document

Sets the value 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   w  w  w .j a  v  a 2 s  .com*/
        algorithmSelectorSpan.text(AlgorithmType.IDA_STAR.getLabel());

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

    }

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

}

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

License:Apache License

private void init() {
    // build algorithm options
    SafeHtmlBuilder algorithmTypeOptions = new SafeHtmlBuilder();

    for (AlgorithmType at : AlgorithmType.values()) {
        algorithmTypeOptions.append(Templates.INSTANCE.option(at.name(), at.getLabel()));
    }//from ww w  .j a  va 2  s  .c  o m

    GQuery algorithmSelector = SELECTOR.getAlgorithmSelectElement();
    algorithmSelector.append(algorithmTypeOptions.toSafeHtml().asString());
    algorithmSelector.val(algorithmType.name());

    // build heuristic options
    SafeHtmlBuilder heuristicTypeOptions = new SafeHtmlBuilder();

    for (HeuristicType ht : HeuristicType.values()) {
        heuristicTypeOptions.append(Templates.INSTANCE.option(ht.name(), ht.getLabel()));
    }

    GQuery heuristicSelector = SELECTOR.getHeuristicSelectElement();
    heuristicSelector.append(heuristicTypeOptions.toSafeHtml().asString());
    heuristicSelector.val(heuristicType.name());

    onDimensionChange(4);
}