Interface DynamicPropertyEvaluator


  • @API(type=NOT_EXTENDABLE,
         src=PUBLIC)
    public interface DynamicPropertyEvaluator
    Some form control properties can't be evaluated at the time the CSS is compiled. For example the InplaceEditorCSSConstants.PROPERTY_WIDTH can depend on the font size used by the form control (10em). This means that the value of the property can be evaluated only after the form control initializes itself. This evaluator offers methods that can expand such dynamic properties.
    Since:
    16.1
    • Method Detail

      • evaluateWidthProperty

        int evaluateWidthProperty​(java.util.Map<java.lang.String,​java.lang.Object> arguments,
                                  int fontSize)
        Evaluates InplaceEditorCSSConstants.PROPERTY_WIDTH to a value. The value of this property might depend on the font size so the form control must explicitly call this method with the font it uses.
         elem {
           content: oxy_textfield(edit, '#text', width, 12em)
         }
         
        Parameters:
        arguments - Form control arguments. Used to get the value of InplaceEditorCSSConstants.PROPERTY_WIDTH.
        fontSize - The font size to be used for values that depend on the font, like 20em.
        Returns:
        The expanded value or -1 if the property is not set or its value is invalid.
      • evaluateHeightProperty

        int evaluateHeightProperty​(java.util.Map<java.lang.String,​java.lang.Object> arguments,
                                   int fontSize)
        Evaluates InplaceEditorCSSConstants.PROPERTY_HEIGHT to a value. The value of this property might depend on the font size so the form control must explicitly call this method with the font it uses.
         elem {
           content: oxy_video(href, attr(toPlay), width, 12em, height, 12em)
         }
         
        Parameters:
        arguments - Form control arguments. Used to get the value of InplaceEditorCSSConstants.PROPERTY_HEIGHT.
        fontSize - The font size to be used for values that depend on the font, like 20em.
        Returns:
        The expanded value or -1 if the property is not set or its value is invalid.