EN · DE · RU · FR · ES

#624: BaseFormatter.java

projectforge-business/src/main/java/org/projectforge/business/utils/BaseFormatter.java Type: Java · Role: Utility · Source: projectforge-business/src/main/java/org/projectforge/business/utils/BaseFormatter.java 59 lines · 20 code · 32 comments · 7 blank
Static utility methods for BaseFormatter. Collection of pure functions with no side effects, providing common helper operations.

Code Structure

Package: org.projectforge.business.utils

Classes: BaseFormatter

Implements: Serializable

Methods (3): appendNotVisible, getNotVisibleString, getLocalizedString

Imports: 2 packages

Source Code (abridged)

package org.projectforge.business.utils;

import org.projectforge.framework.persistence.user.api.ThreadLocalUserContext;

import java.io.Serializable;

public class BaseFormatter implements Serializable
{
  /**
   * Appends <not visible> element (italic and gray colored) to the given StringBuilder. This is used by the text for displaying not
   * accessible fields.
   */
  public void appendNotVisible(StringBuilder sb)
  {
    sb.append("<span style=\"font-style:italic; color: gray;\">&lt;").append(getLocalizedString("notVisible")).append("&gt;</span>");
  }

  public String getNotVisibleString()
  {
    StringBuilder sb = new StringBuilder();
    appendNotVisible(sb);
    return sb.toString();
  }

  /**
   * Proxy.
   * @param key
   * @return
   * @see ThreadLocalUserContext#getLocalizedString(String)
   */
  public String getLocalizedString(String key)
  {
    return ThreadLocalUserContext.getLocalizedString(key);
  }

}

Git History

868d6abb7 2025 -> 2026
63081666f Source file headers: 2024-> 2025.
a72903e36 *.java, *.kt: StringBuffer -> StringBuilder.
d6d3d176f Migration stuff in progress...
b6092df09 Copyright 2023 -> 2024