Class KStringHolder

java.lang.Object
com.iizix.text.KStringHolder
All Implemented Interfaces:
EventListener

public class KStringHolder extends Object implements EventListener
Helper class used to maintain a KString for its dynamic tags with references, i.e. the image, text table, VirtualSpace and Connector tags.
Author:
Christopher Mindus
  • Field Details

  • Constructor Details

    • KStringHolder

      public KStringHolder(IKStringHolder<?> holder)
      Constructor for a holder of a single KString.
      Parameters:
      holder - The holder property.
      Throws:
      NullPointerException - If the holder is null.
  • Method Details

    • disposeHolder

      public void disposeHolder()
      Disposes of the instance and the KString and removes property listener. Disposal can be done followed by calling setKString() with a new KString.
    • setKString

      public void setKString(KString ks)
      Called when a KString is assigned in the holder.
      Parameters:
      ks - The KString, or null for none (same as calling dispose() method).
    • getRefactoredKString

      public KString getRefactoredKString()
      Gets the refactored KString.

      The returned instance is of the same type, i.e. if a PlainKString is the original string, this will also be the return from this call.

      Returns:
      The refactored KString, or null if this instance is disposed of.
    • resolve

      public void resolve(boolean doReCheck, GEvent triggerEvent)
      Resolves the references.
      Parameters:
      doReCheck - Re-check flag.
      triggerEvent - The triggering property event.
    • resolveBeforeSend

      public void resolveBeforeSend()
      Resolves the references in the KString if required before sending it to the remote party. The reference tree is assumed valid.
    • isReferenceTreeValid

      protected boolean isReferenceTreeValid()
      Verifies if the tree is valid for reference creation, i.e. that there is a valid Property Manager owning the root. This method can be overridden in order for references not to be created for the particular configuration (e.g. Client-related references such as LabelForReference that does not create references when communicating).
      Returns:
      true if the root property manager is found, false otherwise.
    • onEvent

      public void onEvent(GEvent event)
      Called when a property event is send to the holder property.
      Specified by:
      onEvent in interface EventListener
      Parameters:
      event - The property event.
    • onReferenceEvent

      protected void onReferenceEvent(ResolveReferencesEvent event)
      Called to perform reference resolving. A property should override this method if it needs to perform reference resolving and validation.

      Subclasses override this method and only subclasses extending PropCnr needs to call super.onReferenceEvent(ResolveReferenceEvent event).

      Parameters:
      event - The resolve references event.
    • verify

      public void verify(PropVerification verification, String location)
      Called when a KString requires verification of the references due to broken or valid references. This event is fired only in the Designer.
      Parameters:
      verification - The property verification class.
      location - The location.