public void decorate(@NotNull MetaModel model) { String name = getName(); model.decorate0(this, name); for (Property<RadViewComponent> childProperty : myChildren) { model.decorate(childProperty, name + "." + childProperty.getName()); } }
@Override public boolean isDefaultValue(RadViewComponent component) throws Exception { for (Property<RadViewComponent> childProperty : myChildren) { if (!childProperty.isDefaultValue(component)) { return false; } } return true; }
@Override public Property<RadViewComponent> createForNewPresentation( @Nullable Property parent, @NotNull String name) { CompoundProperty property = createForNewPresentation(name); List<Property<RadViewComponent>> children = property.getChildren(null); for (Property<RadViewComponent> childProperty : myChildren) { children.add(childProperty.createForNewPresentation(property, childProperty.getName())); } return property; }
@Override public Object getValue(RadViewComponent component) throws Exception { StringBuilder value = new StringBuilder(); int index = 0; int empty = 0; for (Property<RadViewComponent> childProperty : myChildren) { if (index++ > 0) { value.append(", "); } String childValue = (String) childProperty.getValue(component); if (StringUtil.isEmpty(childValue)) { empty++; value.append("?"); } else { value.append(childValue); } } if (empty == myChildren.size()) { return ""; } return value.toString(); }
@Override public void setDefaultValue(RadViewComponent component) throws Exception { for (Property<RadViewComponent> childProperty : myChildren) { childProperty.setDefaultValue(component); } }