예제 #1
0
 @Override
 public String debugDump(int indent) {
   StringBuilder sb = new StringBuilder();
   DebugUtil.indentDebugDump(sb, indent);
   sb.append(getDebugName());
   sb.append(": ").append(PrettyPrinter.prettyPrint(getName())).append("\n");
   DebugUtil.debugDumpWithLabel(sb, "displayName", displayName, indent + 1);
   sb.append("\n");
   DebugUtil.debugDumpWithLabel(
       sb, "status", status == null ? null : status.toString(), indent + 1);
   sb.append("\n");
   DebugUtil.debugDumpWithLabel(sb, "readonly", readonly, indent + 1);
   sb.append("\n");
   DebugUtil.debugDumpWithLabel(
       sb,
       "itemDefinition",
       itemDefinition == null ? null : itemDefinition.toString(),
       indent + 1);
   sb.append("\n");
   DebugUtil.debugDumpWithLabel(
       sb, "property", property == null ? null : property.toString(), indent + 1);
   sb.append("\n");
   DebugUtil.debugDumpLabel(sb, "values", indent + 1);
   sb.append("\n");
   DebugUtil.debugDump(sb, values, indent + 2, false);
   return sb.toString();
 }
예제 #2
0
 @Override
 public String toString() {
   StringBuilder builder = new StringBuilder();
   builder.append("PropertyWrapper(");
   builder.append(getDisplayName());
   builder.append(" (");
   builder.append(status);
   builder.append(") ");
   builder.append(getValues() == null ? null : getValues().size());
   builder.append(" values)");
   builder.append(")");
   return builder.toString();
 }
예제 #3
0
  // TODO - try to get rid of <br> attributes when creating new lines in association attributes
  // pop-up
  private String createAssociationTooltipText(PrismProperty property) {
    StringBuilder sb = new StringBuilder();
    sb.append(getString("prismValuePanel.message.association.attributes")).append("<br>");

    if (property.getParent() != null && property.getParent().getParent() != null) {
      PrismObject<ShadowType> shadowPrism =
          (PrismObject<ShadowType>) property.getParent().getParent();

      Collection<ResourceAttribute<?>> attributes = ShadowUtil.getAttributes(shadowPrism);
      if (attributes == null || attributes.isEmpty()) {
        return sb.toString();
      }

      // TODO - this is a dirty fix for situation, when attribute value is too long and it is a
      // string without white chars,
      // thus it will not break in tooltip. break-all is also not good, since it can brake in the
      // middle of words. What we
      // are doing here is replacing every, with ,&#8203;, &#8203; (the same with @) is a zero-width
      // space, so the attribute value
      // will break after comma. This dirty fix will be removed when association editor is
      // completed.
      for (ResourceAttribute<?> attr : attributes) {
        for (Object realValue : attr.getRealValues()) {
          sb.append(getAttributeName(attr));
          sb.append(":");
          if (realValue != null) {
            sb.append(
                realValue
                    .toString()
                    .replace(",", ",&#8203;")
                    .replace("@", "@&#8203;")
                    .replace("_", "@&#8203;"));
          }
          sb.append("<br>");
        }
      }
    }

    return sb.toString();
  }