protected String generateFormField(String[] fieldNames) { if (fieldNames[NO] != null) { return String.format( "<div class='%s%s'><span class='yes-no-picker'>%s%s%s</span> <span title='%s'>%s</span></div>", DEFAULT_CSS_CLASS, this.expandable ? EXPANDABLE_CSS_CLASS : "", generateCheckbox("none", this.value, "", (!isSelected(YES) && !isSelected(NO)), "na", "NA"), generateCheckbox(fieldNames[YES], this.value, this.hint, isSelected(YES), "yes", "Y"), generateCheckbox(fieldNames[NO], this.value, this.hint, isSelected(NO), "no", "N"), this.term == null ? this.title + "\n(custom term)" : (this.term.getName() + (StringUtils.isNotBlank(this.term.getDescription()) ? "\n" + StringEscapeUtils.escapeXml10(this.term.getDescription()) : "")), generateLabel(fieldNames[YES] + '_' + this.value, "yes-no-picker-label", this.title)); } else { return generateCheckbox(fieldNames[YES], this.value, this.hint, isSelected(YES), DEFAULT_CSS_CLASS + (this.expandable ? EXPANDABLE_CSS_CLASS : ""), this.title); } }
@Override public VocabularyTermSummary createVocabularyTermRepresentation(VocabularyTerm term) { VocabularyTermSummary rep = new VocabularyTermSummary(); rep.withId(term.getId()); rep.withName(term.getName()); JSONObject jsonObject = term.toJSON(); String symbolKey = "symbol"; if (jsonObject != null && jsonObject.opt(symbolKey) != null) { rep.withSymbol(jsonObject.get(symbolKey).toString()); } rep.withDescription(term.getDescription()); return rep; } }
protected String generateFormField(String[] fieldNames) { if (fieldNames[NO] != null) { return String.format( "<div class='%s%s'><span class='yes-no-picker'>%s%s%s</span> <span title='%s'>%s</span></div>", DEFAULT_CSS_CLASS, this.expandable ? EXPANDABLE_CSS_CLASS : "", generateCheckbox("none", this.value, "", (!isSelected(YES) && !isSelected(NO)), "na", "NA"), generateCheckbox(fieldNames[YES], this.value, this.hint, isSelected(YES), "yes", "Y"), generateCheckbox(fieldNames[NO], this.value, this.hint, isSelected(NO), "no", "N"), this.term == null ? this.title + "\n(custom term)" : (this.term.getName() + (StringUtils.isNotBlank(this.term.getDescription()) ? "\n" + StringEscapeUtils.escapeXml10(this.term.getDescription()) : "")), generateLabel(fieldNames[YES] + '_' + this.value, "yes-no-picker-label", this.title)); } else { return generateCheckbox(fieldNames[YES], this.value, this.hint, isSelected(YES), DEFAULT_CSS_CLASS + (this.expandable ? EXPANDABLE_CSS_CLASS : ""), this.title); } }