java.lang.Object
com.inductiveautomation.ignition.client.jsonedit.EditorHelper

public class EditorHelper extends Object
Encapsulates some logic useful in the editors to facilitate correct editing and listening of/to a node's value and prevent notification looping
  • Constructor Details

    • EditorHelper

      public EditorHelper(DocumentNode node, Consumer<Object> updateUiFromNodeValue)
      Parameters:
      updateUiFromNodeValue - Called when the node's value changes. Update the UI here. will automatically be called inside the updateUI wrapper.
  • Method Details

    • destroy

      public void destroy()
      Removes node listeners
    • newItemListener

      public ItemListener newItemListener(Consumer<Boolean> realListener)
      Convenience function that makes an ItemListener that will automatically ignore events while the updatingUi flag is set.
    • isUpdatingUi

      public boolean isUpdatingUi()
      Can be checked to prevent UI listeners from updating the node's value.
    • setValue

      public void setValue(Object value)
      Sets the value in such a way that the resulting value change event won't re-trigger the ui to update.
    • updateUi

      public void updateUi(Runnable r)
      Any code that updates the UI should be put through here, that way the updating flag can be set and then used to prevent other ui listeners from firing.