Class EventStreamUtils
java.lang.Object
com.inductiveautomation.eventstream.designer.EventStreamUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetHandlerTypeString(StageDiagnostics stageDiagnostics, HandlerRegistry handlerRegistry) static voidinitializeCodeEditorSectionPanel(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 AExtensionFunctionPanelto edit the code AResultDisplayBarto display compilation results can use this method to initialize the UI.static booleanisError(StageDiagnostics stageDiagnostics) static booleanisHandler(StageDiagnostics stageDiagnostics) static StringtoWarningMessage(Exception exception, String defaultMessage) When using theDefaultViewModelSwingWorkerExecutorand 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
StageDiagnosticsdoes not contain diagnostics for handlers. Otherwise, the name of the handler type will be returned, of "Unknown" if theHandlerRegistrypassed as parameter does not contain theEventStreamHandlerDesignDelegatefor 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
ExtensionFunctionPanelto edit the code - A
ResultDisplayBarto display compilation results
- Parameters:
sectionPanel- theSectionPanelthat will contain the UI componentsenableComponent- theJCheckBoxthat will enable/disable the current sectionextensionFunctionPanel- theExtensionFunctionPanelthat will be used to edit the codecompilationResultDisplayBar- theResultDisplayBarthat will display compilation results
-
toWarningMessage
When using theDefaultViewModelSwingWorkerExecutorand 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- theExceptionto 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
-