示例#1
0
  /**
   * 变量影响表单中的细粒度组件的值、状态
   *
   * @param fcList
   * @param simpleContainer
   */
  public static final void var2FC(
      Map<String, FinegrainedComponent> fcList, SimpleContainer simpleContainer) {
    Map<String, SimpleFC> simpleFCList = simpleContainer.getFcList();
    if (ContainerUtil.isNull(simpleFCList) || ContainerUtil.isNull(fcList)) return;

    for (Entry<String, SimpleFC> entry : simpleFCList.entrySet()) {
      if (!fcList.containsKey(entry.getKey())) continue;
      BOProperty bop = fcList.get(entry.getKey()).getBc();
      if (bop == null) continue;

      if (entry.getValue().isDisable() != null)
        bop.getStatus().setDisable(entry.getValue().isDisable());
      if (entry.getValue().isHidden() != null)
        bop.getStatus().setHidden(entry.getValue().isHidden());
      if (entry.getValue().isReadonly() != null)
        bop.getStatus().setReadonly(entry.getValue().isReadonly());
      if (StringUtils.isNotEmpty(entry.getValue().getValueStr()))
        bop.setValue(entry.getValue().getValueStr());
    }
  }