Class EventStreamUtils
java.lang.Object
com.inductiveautomation.eventstream.designer.EventStreamUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
getHandlerTypeString
(StageDiagnostics stageDiagnostics, HandlerRegistry handlerRegistry) 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 AExtensionFunctionPanel
to edit the code AResultDisplayBar
to display compilation results can use this method to initialize the UI.static boolean
isError
(StageDiagnostics stageDiagnostics) static boolean
isHandler
(StageDiagnostics stageDiagnostics) static String
toWarningMessage
(Exception exception, String defaultMessage) When using theDefaultViewModelSwingWorkerExecutor
and you need to extract a message to present to the user.
-
Method Details
-
isHandler
-
isError
-
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 theHandlerRegistry
passed as parameter does not contain theEventStreamHandlerDesignDelegate
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
- Parameters:
sectionPanel
- theSectionPanel
that will contain the UI componentsenableComponent
- theJCheckBox
that will enable/disable the current sectionextensionFunctionPanel
- theExtensionFunctionPanel
that will be used to edit the codecompilationResultDisplayBar
- theResultDisplayBar
that will display compilation results
-
toWarningMessage
When using theDefaultViewModelSwingWorkerExecutor
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
- theException
to get the warning message fromdefaultMessage
- 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
-