Class PromptConnectionSelectionModel<Config>
java.lang.Object
de.xima.fc.prompt.mgmt.gui.model.PromptConnectionSelectionModel<Config>
- All Implemented Interfaces:
Serializable
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionerror()Gets the error message, if any, for the currently selected prompt connection.Extract the final configuration object with the properties of the currently selected prompt connection, that can be persisted in the persistence layer.static PromptConnectionSelectionModel<?> static PromptConnectionSelectionModel<?> guiBean()Gets the bean instance needed by the custom GUI provided by the prompt service handler.guiIcon()Gets the icon for the type of the currently selected prompt connection.Gets the resource bundle containing the GUI messages for the currently selected prompt connection.guiXhtml()Gets the URL to the XHTML file that contains the custom GUI for the prompt connection.booleanhasError()Whether this model represents a prompt connection that could not be loaded correctly, usually due to a missing plugin or an error in the plugin that handles the prompt connection.Invokes the test connection method of the prompt service handler and returns the result.lock()Gets the lock, if any, for the currently selected prompt connection.Gets the pending configuration object with the properties of the currently selected prompt connection.voidupdateLock(IPromptLock newLock) Updates the lock for the currently selected prompt connection.uuid()Gets the ID of the currently selected prompt connection represented by this model.
-
Method Details
-
error
Gets the error message, if any, for the currently selected prompt connection. UsehasError()to check if there is an error. An error usually occurs due to a missing plugin or an error in the plugin that handles the prompt connection. When this returns a non-null error,pendingGuiConfig()and other methods will return null.- Returns:
- The error message, or null if there is no error.
-
extractGuiConfig
Extract the final configuration object with the properties of the currently selected prompt connection, that can be persisted in the persistence layer.- Returns:
- The final configuration object of the selected prompt connection.
- Throws:
Exception- If the configuration could not be retrieved.
-
guiBean
Gets the bean instance needed by the custom GUI provided by the prompt service handler.- Returns:
- The GUI bean for the prompt connection, or null if
unavailable. - Throws:
Exception- If the bean instance could not be retrieved, e.g. when the bean class is not found or the bean throws an exception during its construction.
-
guiIcon
Gets the icon for the type of the currently selected prompt connection.- Returns:
- The icon for the selected prompt connection's type, or null if
unavailable.
-
guiMessages
Gets the resource bundle containing the GUI messages for the currently selected prompt connection.- Returns:
- The resource bundle for the selected prompt connection, or null if
unavailable.
-
guiXhtml
Gets the URL to the XHTML file that contains the custom GUI for the prompt connection.- Returns:
- The URL to the XHTML file, or null if
unavailable.
-
hasError
public boolean hasError()Whether this model represents a prompt connection that could not be loaded correctly, usually due to a missing plugin or an error in the plugin that handles the prompt connection. When this returns true,pendingGuiConfig()and other methods will return null.- Returns:
- true if there is an error, false otherwise.
-
uuid
Gets the ID of the currently selected prompt connection represented by this model.- Returns:
- The ID of the prompt connection.
-
invokeHandlerTestConnection
Invokes the test connection method of the prompt service handler and returns the result.- Returns:
- The result of the test connection invocation.
-
lock
Gets the lock, if any, for the currently selected prompt connection. When the data changes in the meantime, an attempt to save the changes will fail with an exception.- Returns:
- The lock for the prompt connection, or null if no lock is held.
-
pendingGuiConfig
Gets the pending configuration object with the properties of the currently selected prompt connection. Does not represent the final model. For persisting the model, useextractGuiConfig().- Returns:
- The pending configuration object of the selected prompt connection, or null if
unavailable.
-
updateLock
Updates the lock for the currently selected prompt connection. Usually called after saving the connection to the persistence layer.- Parameters:
newLock- The new lock to set.
-
forError
-
forNewSelection
public static PromptConnectionSelectionModel<?> forNewSelection(PromptConnectionViewModel selected, PromptConnectionBeanEnvironment env) throws Exception - Throws:
Exception
-