java.lang.Object
overit.geocall.platform.ui.UINode
overit.geocall.ui.Component
overit.geocallapp.utilities.ux.ui.container.cardview.CardField
All Implemented Interfaces:
Serializable, overit.geocall.marks.MethodExposer, overit.geocall.marks.NameExposer, Identified, Tool, HTMLRenderable
Direct Known Subclasses:
CardDate, CardDouble, CardDuration, CardLong, CardStaticView, CardString, CardTime

public abstract class CardField extends Component implements HTMLRenderable
Abstract base class for CardView field components. Provides common functionality for data context management and utility methods. Extends Component to inherit standard framework methods (getLABEL, getNAME, setICON, etc.)
Since:
21.0
See Also:
  • Field Details

    • LOG

      protected static final LogChannel LOG
    • dataContext

      protected Map<String,Object> dataContext
    • visible

      protected boolean visible
    • truncate

      protected int truncate
  • Constructor Details

    • CardField

      public CardField()
  • Method Details

    • setDataContext

      public void setDataContext(Map<String,Object> data)
      Sets the data context for this field component. This method should be called before getHtml() to provide the necessary data.
      Parameters:
      data - The data container with field values
    • getDataContext

      protected Map<String,Object> getDataContext()
      Gets the current data context.
      Returns:
      The current data context, may be null
    • isVisible

      public boolean isVisible()
    • setVisible

      public void setVisible(boolean visible)
    • setTRUNCATE

      public void setTRUNCATE(String s)
      Sets the maximum number of characters that are displayed in the field. The strings are then limited to that number of characters and to indicate the fact that the information is not complete, the three points of suspension are added.
      Parameters:
      s - The maximum number of characters displayed for the field
    • getTruncate

      public int getTruncate()
      Gets the maximum number of characters that are displayed in the field. The strings are then limited to that number of characters and to indicate the fact that the information is not complete, the three points of suspension are added.
      Returns:
      the truncate value
    • applyTruncate

      protected String applyTruncate(String s)
      Applies truncate logic to a string value. If truncate is 0, returns the string as-is. If the string length exceeds truncate, it is cut and ellipsis (…) is added.
      Parameters:
      s - The string to truncate
      Returns:
      The truncated string with ellipsis if needed, or the original string
    • getLabelHtml

      protected String getLabelHtml()
      Generates HTML for a label using Component's getLABEL() method.
      Returns:
      HTML string for the label, empty string if no label
    • getHtml

      public String getHtml()
      Template method implementation of HTMLRenderable interface. Provides common HTML generation logic for simple card fields. Complex fields (CardSwitch, CardSpan) should override this method entirely.
      Specified by:
      getHtml in interface HTMLRenderable
      Returns:
      The HTML string representation of the component
    • getFormattedValue

      protected abstract String getFormattedValue()
      Abstract method to be implemented by subclasses. Each card type should provide its own value formatting logic.
      Returns:
      The formatted value as string
    • getHtml

      public org.apache.ecs.Element getHtml(EntitySet es)
      Implementation of Component's abstract method. Delegates to HTMLRenderable.getHtml() and wraps the result in a StringElement.
      Specified by:
      getHtml in class Component
      Parameters:
      es - The EntitySet (not used, data context is injected separately)
      Returns:
      Element containing the HTML string