Class EventStreamUtils

java.lang.Object
com.inductiveautomation.eventstream.designer.EventStreamUtils

public final class EventStreamUtils extends Object
  • Method Details

    • isHandler

      public static boolean isHandler(StageDiagnostics stageDiagnostics)
    • isError

      public static boolean isError(StageDiagnostics stageDiagnostics)
    • getHandlerTypeString

      public static String getHandlerTypeString(StageDiagnostics stageDiagnostics, HandlerRegistry handlerRegistry)
      Returns:
      an empty string if the StageDiagnostics does not contain diagnostics for handlers. Otherwise, the name of the handler type will be returned, of "Unknown" if the HandlerRegistry passed as parameter does not contain the EventStreamHandlerDesignDelegate for the specified type.
    • initializeCodeEditorSectionPanel

      public static void initializeCodeEditorSectionPanel(SectionPanel sectionPanel, JCheckBox enableComponent, com.inductiveautomation.ignition.designer.gui.tools.ExtensionFunctionPanel extensionFunctionPanel, ResultDisplayBar compilationResultDisplayBar)
      SectionPanels that contains the following:
      • A JCheckBox to enable/disable the component
      • A ExtensionFunctionPanel to edit the code
      • A ResultDisplayBar to display compilation results
      can use this method to initialize the UI. This helps to ensure a uniform UX across sections that have similar UI components.
      Parameters:
      sectionPanel - the SectionPanel that will contain the UI components
      enableComponent - the JCheckBox that will enable/disable the current section
      extensionFunctionPanel - the ExtensionFunctionPanel that will be used to edit the code
      compilationResultDisplayBar - the ResultDisplayBar that will display compilation results
    • toWarningMessage

      public static String toWarningMessage(Exception exception, String defaultMessage)
      When using the DefaultViewModelSwingWorkerExecutor and you need to extract a message to present to the user. This method helps untangle the nested Exception chain and retrieve the relevant message to present to the user.
      Parameters:
      exception - the Exception to get the warning message from
      defaultMessage - the default message to return if the exception does not contain a warning message
      Returns:
      the warning message from the exception, or the default message if the exception does not contain a warning message