Class CardField
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
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:
-
Nested Class Summary
Nested classes/interfaces inherited from class overit.geocall.ui.Component
Component.Configurable, Component.ConfigurableAttribute, Component.ConfigurableAttributes, Component.FilterCriteria, Component.Registry -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final LogChannelprotected intprotected booleanFields inherited from class overit.geocall.ui.Component
_basic, _childrenContainers, _currentId, _gridalign, _gridcols, _gridrows, _gridvalign, _iconElement, _id, _keylabel, _label, _layoutName, _name, _parentContainer, _registryName, _shortcut, _tabindex, _transformations, _valuesContainer, aliasField, BR, configHidden, configuredLabel, configuredLabelInLine, defaultHidden, ELEMENT_BR, ELEMENT_NULL, entityContainer, entityName, extendedField, fullHeight, important, labelInLine, layoutLabel, PIXEL_IMG, safeInlineService -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringApplies truncate logic to a string value.Gets the current data context.protected abstract StringAbstract method to be implemented by subclasses.getHtml()Template method implementation of HTMLRenderable interface.org.apache.ecs.ElementImplementation of Component's abstract method.protected StringGenerates HTML for a label using Component's getLABEL() method.intGets the maximum number of characters that are displayed in the field.booleanvoidsetDataContext(Map<String, Object> data) Sets the data context for this field component.voidSets the maximum number of characters that are displayed in the field.voidsetVisible(boolean visible) Methods inherited from class overit.geocall.ui.Component
adapt, ajaxQuery, appendAttribute, buildDisplayScript, buildSetupScript, calcKeyLabel, calcLabel, calcShortcut, canBeConfigured, changed, clearConfiguredProperties, componentIterator, componentSize, connect, containerIterator, createAjaxFrame, deprecate, fillSetupScript, generateFlexableFullHeightContainer, generateId, getBASIC, getBoolean, getBoolean, getChildrenComponents, getChildrenContainers, getDefaultLabel, getDefaultLayoutLabel, getEntityContainer, getEntityName, getFullHeight, getGridAlign, getGridCols, getGridRows, getGridVAlign, getHtmlLabel, getHtmlLabel, getIcon, getId, getIdentity, getint, getKEYLABEL, getLABEL, getLayoutLabel, getLayoutName, getNAME, getParentComponent, getParentContainer, getPublishedChildrenList, getRegistryName, getSHORTCUT, getTabIndex, getTeacher, getValuesContainer, getWindow, initChilds, isActivable, isActive, isAliasField, isConfigHidden, isDefaultHidden, isExtendedField, isImportant, isLabelInLine, onInit, setActivable, setActive, setAliasField, setBASIC, setConfigHidden, setDEFAULTHIDDEN, setEntityName, setExtendedField, setFULLHEIGHT, setGRIDALIGN, setGRIDCOLS, setGRIDROWS, setGRIDVALIGN, setICON, setIdentity, setIMPORTANT, setLabel, setLABEL, setLABELINLINE, setLAYOUTLABEL, setLAYOUTNAME, setNAME, setREGISTRYNAME, setTooltip, setup, setValuesContainer, stringForJs, tabIndexer
-
Field Details
-
LOG
-
dataContext
-
visible
protected boolean visible -
truncate
protected int truncate
-
-
Constructor Details
-
CardField
public CardField()
-
-
Method Details
-
setDataContext
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
Gets the current data context.- Returns:
- The current data context, may be null
-
isVisible
public boolean isVisible() -
setVisible
public void setVisible(boolean visible) -
setTRUNCATE
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
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
Generates HTML for a label using Component's getLABEL() method.- Returns:
- HTML string for the label, empty string if no label
-
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:
getHtmlin interfaceHTMLRenderable- Returns:
- The HTML string representation of the component
-
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
Implementation of Component's abstract method. Delegates to HTMLRenderable.getHtml() and wraps the result in a StringElement.
-