List of usage examples for com.google.gwt.query.client GQuery val
public GQuery val(String... values)
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); }