Class EventStreamSubtextStateSynthesizer

java.lang.Object
com.inductiveautomation.eventstream.designer.ui.viewmodel.EventStreamSubtextStateSynthesizer
All Implemented Interfaces:
Disposable

public class EventStreamSubtextStateSynthesizer extends Object implements Disposable
This class is responsible for synthesizing the SubtextStateInfo, and updating the stateInfo property. The stateInfo property holds the most current SubtextStateInfo.

For synthesizing the SubtextStateInfo, this class monitors 3 sources:
  1. EventStreamStateTracker - This class provides the current state of the event stream as reported by the Gateway
  2. EventStreamConfigManager - This class provides the current configuration of the event stream. While an editor is open it is the source of truth for unsaved edits (it sees live, uncommitted UI changes).
  3. DesignableProject.isChanged(ResourcePath) - When no editor is open the config manager is gone, so the committed-but-unsaved state of the project resource is used to keep the PENDING_SAVE badge alive until the project is saved. This synthesizer is resource-scoped and outlives the editor, so it must not depend on the config manager for the unsaved-edits signal once the editor closes.