Class EditorHelper
- java.lang.Object
- 
- com.inductiveautomation.ignition.client.jsonedit.EditorHelper
 
- 
 public class EditorHelper extends java.lang.ObjectEncapsulates some logic useful in the editors to facilitate correct editing and listening of/to a node's value and prevent notification looping
- 
- 
Constructor SummaryConstructors Constructor Description EditorHelper(DocumentNode node, java.util.function.Consumer<java.lang.Object> updateUiFromNodeValue)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddestroy()Removes node listenersbooleanisUpdatingUi()Can be checked to prevent UI listeners from updating the node's value.java.awt.event.ItemListenernewItemListener(java.util.function.Consumer<java.lang.Boolean> realListener)Convenience function that makes an ItemListener that will automatically ignore events while the updatingUi flag is set.voidsetValue(java.lang.Object value)Sets the value in such a way that the resulting value change event won't re-trigger the ui to update.voidupdateUi(java.lang.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.
 
- 
- 
- 
Constructor Detail- 
EditorHelperpublic EditorHelper(DocumentNode node, java.util.function.Consumer<java.lang.Object> updateUiFromNodeValue) - Parameters:
- updateUiFromNodeValue- Called when the node's value changes. Update the UI here. will automatically be called inside the updateUI wrapper.
 
 
- 
 - 
Method Detail- 
destroypublic void destroy() Removes node listeners
 - 
newItemListenerpublic java.awt.event.ItemListener newItemListener(java.util.function.Consumer<java.lang.Boolean> realListener) Convenience function that makes an ItemListener that will automatically ignore events while the updatingUi flag is set.
 - 
isUpdatingUipublic boolean isUpdatingUi() Can be checked to prevent UI listeners from updating the node's value.
 - 
setValuepublic void setValue(java.lang.Object value) Sets the value in such a way that the resulting value change event won't re-trigger the ui to update.
 - 
updateUipublic void updateUi(java.lang.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.
 
- 
 
-