private void clearEditor() { nameTextBox.setValue(null); descTextBox.setValue(null); addrTextBox.setValue(null); kosherCb.setValue(false); fancyCb.setValue(false); takeAwayCb.setValue(false); avgSelector.setValue(null); ratingSelector.setValue(null); }
@Override public void setVocabulary(VocabularyDto vocabulary, JsArrayString locales) { name.setText(vocabulary.getName()); titles.setLocaleTexts(vocabulary.getTitleArray(), JsArrays.toList(locales)); descriptions.setLocaleTexts(vocabulary.getDescriptionArray(), JsArrays.toList(locales)); repeatable.setValue(vocabulary.hasRepeatable() && vocabulary.getRepeatable()); }
private Widget checkBoxEditor(final RuleAttribute at, final boolean isReadOnly) { final CheckBox box = new CheckBox(); box.setEnabled(!isReadOnly); if (at.getValue() == null || at.getValue().isEmpty()) { box.setValue(false); at.setValue(FALSE_VALUE); } else { box.setValue((at.getValue().equals(TRUE_VALUE))); } box.addClickHandler( new ClickHandler() { public void onClick(ClickEvent event) { at.setValue((box.getValue()) ? TRUE_VALUE : FALSE_VALUE); } }); return box; }
@Override public void formClear() { variableName.setText(""); repeatableCheckbox.setValue(false); occurrenceGroup.setText(""); occurrenceGroup.setEnabled( false); // Occurrence group is only enabled when repeatableCheckbox is true. unit.setText(""); mimeType.setText(""); }
@Override public void setNewVariable(VariableDto variableDto) { // Set the entity type (not displayed) entityType = variableDto.getEntityType(); // Set the UI fields. variableName.setValue(variableDto.getName()); setValueType(variableDto); repeatableCheckbox.setValue(variableDto.getIsRepeatable()); setOccurrenceGroup(variableDto); setUnit(variableDto); setMimeType(variableDto); }