Example #1
0
  private boolean hasEmptyPlaceholder(
      ItemWrapper<? extends Item, ? extends ItemDefinition> property) {
    for (ValueWrapper value : property.getValues()) {
      value.normalize(property.getItemDefinition().getPrismContext());
      if (ValueStatus.ADDED.equals(value.getStatus()) && !value.hasValueChanged()) {
        return true;
      }
    }

    return false;
  }
 private boolean showEmpty(ItemWrapper item) {
   ObjectWrapper objectWrapper = getObject();
   List<ValueWrapper> valueWrappers = item.getValues();
   boolean isEmpty;
   if (valueWrappers == null) {
     isEmpty = true;
   } else {
     isEmpty = valueWrappers.isEmpty();
   }
   if (!isEmpty && valueWrappers.size() == 1) {
     ValueWrapper value = valueWrappers.get(0);
     if (ValueStatus.ADDED.equals(value.getStatus())) {
       isEmpty = true;
     }
   }
   return objectWrapper.isShowEmpty() || !isEmpty;
 }
Example #3
0
  private int countUsableValues(ItemWrapper<? extends Item, ? extends ItemDefinition> property) {
    int count = 0;
    for (ValueWrapper value : property.getValues()) {
      value.normalize(property.getItemDefinition().getPrismContext());

      if (ValueStatus.DELETED.equals(value.getStatus())) {
        continue;
      }

      if (ValueStatus.ADDED.equals(value.getStatus()) && !value.hasValueChanged()) {
        continue;
      }

      count++;
    }
    return count;
  }