Class KStringHTMLTextVirtualSpaceTag

All Implemented Interfaces:
IKStringTextTag, Cloneable

public class KStringHTMLTextVirtualSpaceTag extends KStringHTMLDynamicTag<VSField> implements IKStringTextTag
Class for the dynamic HTML tag IZ that refers to VirtualSpace text.
Author:
Christopher Mindus
  • Constructor Details

    • KStringHTMLTextVirtualSpaceTag

      public KStringHTMLTextVirtualSpaceTag(int position, int ordinal, LinkedHashMap<String,String> attributes, String inputString, int parsePosition) throws KStringParseException
      Creates a VirtualSpace text tag and resolves the name attribute. The "format" attributes is also retrieved.
      Parameters:
      position - The position of the tag in the parsed string.
      attributes - The tag attributes.
      inputString - The input string to KString.
      parsePosition - The parsing position where tag starts.
      Throws:
      KStringParseException - For missing attributes.
  • Method Details

    • getReference

      public String getReference()
      Gets the reference.
      Specified by:
      getReference in interface IKStringTextTag
      Specified by:
      getReference in class KStringHTMLDynamicTag<VSField>
      Returns:
      The reference string to the property.
    • setReference

      public boolean setReference(String ref)
      Updates the reference for the tag.
      Specified by:
      setReference in interface IKStringTextTag
      Overrides:
      setReference in class KStringHTMLTag<VSField>
      Parameters:
      ref - The new reference string.
      Returns:
      true for changed, false for no change.
    • getReferenceClass

      public Class<?> getReferenceClass()
      Returns the reference class used by this tag, e.g. KStringProp for text table, or the image class IImageTarget.class.
      Overrides:
      getReferenceClass in class KStringTag<VSField>
      Returns:
      VSField.class.
    • willLoseFormatting

      public boolean willLoseFormatting()
      Checks if this string will lose formatting when translated to PLAIN. Note that translating PLAIN to HTML never loses formatting.
      Specified by:
      willLoseFormatting in class KStringHTMLDynamicTag<VSField>
      Returns:
      Always false.
    • getPLAINTagText

      public String getPLAINTagText(StringBuilder useme)
      Gets the "unparsed" string representation of this tag in the PLAIN format, i.e. this HTML tag will reformat or translate itself for PLAIN. For the basic HTML tags, this results in an empty string.
      Specified by:
      getPLAINTagText in class KStringHTMLDynamicTag<VSField>
    • getPLAINString

      public String getPLAINString(StringBuilder useme, IKStringInfoProvider provider)
      Gets the string representation of this tag in the PLAIN format, i.e. returns empty string.
      Specified by:
      getPLAINString in class KStringHTMLDynamicTag<VSField>
      Parameters:
      useme - Temporary StringBuilder for any use.
      provider - The information provider or null for none.
    • getHTMLString

      public String getHTMLString(StringBuilder useme, IKStringInfoProvider provider)
      Gets the string representation of this tag in the HTML format. Method needs to be overridden for IZ that replaces the entire tag with an HTML string.
      Overrides:
      getHTMLString in class KStringHTMLDynamicTag<VSField>
      Parameters:
      useme - Temporary StringBuilder for any use.
      provider - The information provider or null for none.
    • isRefreshRequired

      public boolean isRefreshRequired(GEvent event, VSField field)
      Upon a property event received on the target reference property (or its children), this method verifies if the event would affect the KString contents needing to be refreshed.
      Overrides:
      isRefreshRequired in class KStringTag<VSField>
      Parameters:
      event - The event.
      field - The target property for the tag.
      Returns:
      true to refresh the KString, false not to.