public String getWealthRadioLabel() { return wealthRadio.getLabel(); }
public String getWealthFridgeLabel() { return wealthFridge.getLabel(); }
private String render(EnumType type, EnumValue value) { StringBuilder sb = new StringBuilder(); boolean needsComma = false; for (EnumItem enumItem : value.getValuesAsItems(type)) { if(needsComma) { sb.append(", "); } sb.append(enumItem.getLabel()); needsComma = true; } return sb.toString(); } }
public MultiEnumFormat(String columnId, FormulaNode formula, EnumType enumType) { this.columnId = columnId; this.formula = formula; this.enumType = enumType; this.numItems = enumType.getValues().size(); this.labels = new String[numItems]; for (int i = 0; i < numItems; i++) { labels[i] = enumType.getValues().get(i).getLabel(); } }
SimpleEnumColumnBuilder(PendingSlot<ColumnView> result, EnumType enumType) { this.result = result; int labelIndex = 0; this.labels = new String[enumType.getValues().size()]; for (EnumItem item : enumType.getValues()) { this.labels[labelIndex] = item.getLabel(); this.labelIndexMap.put(item.getId(), labelIndex); labelIndex++; } }
public EnumItemViewModel(EnumItem item) { id = item.getId().asString(); label = item.getLabel(); }
public CompactingEnumColumnBuilder(PendingSlot<ColumnView> result, EnumType enumType) { this.result = result; int index = 0; this.ids = new String[enumType.getValues().size()]; this.labels = new String[enumType.getValues().size()]; for (EnumItem item : enumType.getValues()) { this.ids[index] = item.getId().asString(); this.labels[index] = item.getLabel(); this.labelIndexMap.put(item.getId(), index); index++; } }
private CheckBox createControl(EnumItem instance) { CheckBox checkBox; if (enumType.getCardinality() == Cardinality.SINGLE) { checkBox = new org.activityinfo.ui.client.widget.RadioButton(groupName, label(instance.getLabel())); } else { checkBox = new org.activityinfo.ui.client.widget.CheckBox(label(instance.getLabel())); } checkBox.setFormValue(instance.getId().asString()); checkBox.getElement().setAttribute("data-id", instance.getId().asString()); controls.add(checkBox); return checkBox; }
private EnumItem enumValue(ResourceId formField, String label) { EnumType enumType = (EnumType) formClass.getField(formField).getType(); for (EnumItem value : enumType.getValues()) { if (value.getLabel().equalsIgnoreCase(label)) { return value; } } throw new IllegalArgumentException("Unable to find enumValue with label: " + label); }
private EnumItem enumValue(ResourceId formField, String label) { EnumType enumType = (EnumType) formClass.getField(formField).getType(); for (EnumItem value : enumType.getValues()) { if (value.getLabel().equalsIgnoreCase(label)) { return value; } } throw new IllegalArgumentException("Unable to find enumValue with label: " + label); }
private void editLabel(ResourceId id) { EnumItem enumItem = enumValueForId(id); String newLabel = Window.prompt(I18N.CONSTANTS.enterNameForOption(), enumItem.getLabel()); if (!Strings.isNullOrEmpty(newLabel)) { enumItem.setLabel(newLabel); controlForId(id).setHTML(designLabel(newLabel)); } }
@Override public void init(FormField field, FieldValue value) { operandListBox.setVisible(true); EnumType type = (EnumType) field.getType(); this.enumItems = type.getValues(); operandListBox.clear(); for (EnumItem enumItem : enumItems) { operandListBox.addItem(enumItem.getLabel()); } if(value instanceof EnumValue) { selectEnumItem(((EnumValue) value)); } }
public EnumItem getEnumValueByLabel(String label) { for (FormField field : formClass.getFields()) { if (field.getType() instanceof EnumType) { EnumType enumType = (EnumType) field.getType(); for (EnumItem value : enumType.getValues()) { if (value.getLabel().equalsIgnoreCase(label)) { return value; } } } } throw new IllegalArgumentException("Unable to find enumValue with label: " + label); }
public CheckBoxGroupWidget(EnumType enumType, FieldUpdater fieldUpdater) { this.flowPanel = new FlowPanel(); for (EnumItem enumItem : enumType.getValues()) { CheckBox checkBox = new CheckBox(); checkBox.setBoxLabel(enumItem.getLabel()); checkBox.addValueChangeHandler(event -> fieldUpdater.update(input())); checkBoxes.put(enumItem.getId(), checkBox); flowPanel.add(checkBox); } }
public String getDescription() { if(match.isEnumBoolean()) { return match.getFieldNode().getField().getLabel() + " is " + match.getEnumItem().getLabel(); } else { return match.getFieldNode().getField().getLabel(); } }
@Override public List<ImportTarget> getImportSites(FormTree.Node node) { EnumType type = (EnumType) node.getType(); List<ImportTarget> result = Lists.newArrayList(); if (type.getCardinality() == Cardinality.SINGLE) { result.add(new ImportTarget(node.getField(), VALUE, node.getField().getLabel(), node.getDefiningFormClass().getId())); } else { for (EnumItem item : type.getValues()) { result.add(new ImportTarget(node.getField(), new TargetSiteId(item.getId().asString()), label(item.getLabel(), node.getField().getLabel()), node.getDefiningFormClass().getId())); } } return result; }
public FormulaElement(FormulaElement field, EnumItem item) { this.key = field.getKey() + "#" + item.getId().asString(); this.formulaNode = new CompoundExpr(field.getExpr(), new SymbolNode(symbolFor(item))); this.label = item.getLabel(); this.icon = IconBundle.INSTANCE.enumField(); this.code = null; }
public RadioGroupWidget(EnumType type, Appearance appearance, FieldUpdater updater) { container = appearance.createContainer(); group = new ToggleGroup(); for (EnumItem enumItem : type.getValues()) { Radio radio = new Radio(new RadioCell(appearance.getRadioAppearance())); radio.setBoxLabel(enumItem.getLabel()); group.add(radio); container.add(radio); radios.put(enumItem.getId(), radio); } group.addValueChangeHandler(event -> updater.update(input())); }
private void addChoices(String listName, EnumType enumType) { for (EnumItem enumItem : enumType.getValues()) { HSSFRow row = choicesSheet.createRow(nextChoiceRow++); row.createCell(CHOICES_LIST_NAME_COLUMN).setCellValue(listName); row.createCell(CHOICES_NAME_COLUMN).setCellValue(enumItem.getId().asString()); row.createCell(CHOICES_LABEL).setCellValue(enumItem.getLabel()); } } }