Class InputFieldRenderer

All Implemented Interfaces:
IPropertyContainer, IRenderer

public class InputFieldRenderer extends AbstractOneLineTextFieldRenderer
The AbstractOneLineTextFieldRenderer implementation for input fields.
  • Field Details

  • Constructor Details

    • InputFieldRenderer

      public InputFieldRenderer(InputField modelElement)
      Creates a new InputFieldRenderer instance.
      Parameters:
      modelElement - the model element
  • Method Details

    • getNextRenderer

      public IRenderer getNextRenderer()
      Gets a new instance of this class to be used as a next renderer, after this renderer is used, if IRenderer.layout(LayoutContext) is called more than once.
      Returns:
      new renderer instance
    • getSize

      public int getSize()
      Gets the size of the input field.
      Returns:
      the input field size
    • isPassword

      public boolean isPassword()
      Checks if the input field is a password field.
      Returns:
      true, if the input field is a password field
    • createParagraphRenderer

      IRenderer createParagraphRenderer(String defaultValue)
      Creates a paragraph renderer.
      Overrides:
      createParagraphRenderer in class AbstractTextFieldRenderer
      Parameters:
      defaultValue - the default value
      Returns:
      the renderer
    • adjustFieldLayout

      protected void adjustFieldLayout(LayoutContext layoutContext)
      Adjusts the field layout.
      Specified by:
      adjustFieldLayout in class AbstractFormFieldRenderer
      Parameters:
      layoutContext - layout context
    • createFlatRenderer

      protected IRenderer createFlatRenderer()
      Creates the flat renderer instance.
      Specified by:
      createFlatRenderer in class AbstractFormFieldRenderer
      Returns:
      the renderer instance.
    • applyAcroField

      protected void applyAcroField(DrawContext drawContext)
      Applies the AcroField widget.
      Specified by:
      applyAcroField in class AbstractFormFieldRenderer
      Parameters:
      drawContext - the draw context
    • getProperty

      public <T1> T1 getProperty(int key)
      Gets the property from this entity. Compared to IPropertyContainer.getOwnProperty(int), this method can check parent's properties, styles, etc, depending on the origin of the instance
      Specified by:
      getProperty in interface IPropertyContainer
      Overrides:
      getProperty in class AbstractRenderer
      Type Parameters:
      T1 - the return type associated with the property
      Parameters:
      key - the property to be retrieved
      Returns:
      the value of the given property. null will be returned if the property value was not found
    • setMinMaxWidthBasedOnFixedWidth

      protected boolean setMinMaxWidthBasedOnFixedWidth(MinMaxWidth minMaxWidth)
      Overrides:
      setMinMaxWidthBasedOnFixedWidth in class AbstractRenderer
    • getSubParagraph

      private static Paragraph getSubParagraph(String value, int maxLen)
    • isComb

      private boolean isComb()
      Checks if the input field is a comb field.
      Returns:
      true, if the input field is a comb field
    • getMaxLen

      private int getMaxLen()
      Gets the maximum length of the field's text, in characters.
      Returns:
      the current maximum text length
    • obfuscatePassword

      private String obfuscatePassword(String text)
      Obfuscates the content of a password input field.
      Parameters:
      text - the password
      Returns:
      a string consisting of '*' characters.