Interface DesignerModuleHook
- All Superinterfaces:
LocationRenderingUpdater
- All Known Implementing Classes:
AbstractDesignerModuleHook
,DesignerHook
,DesignerHook
,ReportingDesignerHook
,SFCDesignerHook
,VisionDesignerImpl
The main hook into a module's designer scope. Each module should provide exactly one implementation of this hook
class
if the module includes designer-scoped logic. The name of this implementation must be included in the module's
descriptor file, with an entry like:
<hook scope="D">com.example.module.designer.SuperHookClass</hook>
Best practice: Instead of implementing this interface directly, subclass your hook class from
AbstractDesignerModuleHook
instead.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
configureDeserializer
(XMLDeserializer deserializer) void
Provides the module with an opportunity to define its own expression functionsvoid
configureSerializer
(XMLSerializer serializer) Provides the module a chance to add serialization delegates to the serializer custom for classes that might be encountered when serializing objects provided by this moduleAllows a module to create one or more id-bundlekey pairs that the module will use for role-based client security.List<com.jidesoft.docking.DockableFrame>
A list of DockableFrames that this module provides, that should be available to all workspaces.default Icon
Return an appropriate icon to display for this module.Returns a menu merge for any global menu additions.List<com.jidesoft.action.CommandBar>
Returns the toolbars for the module.Deprecated.default String
getResourceCategoryKey
(ResourcePath resourcePath) Used by modules that add project resources to an Ignition project.Deprecated.Since Ignition 8.1.34, in favor of the more appropriateresourcePath
signature.default String
getResourceDisplayName
(ResourcePath resourcePath) Allows a module to give an appropriate display name for the resource.Deprecated.Since Ignition 8.1.34, in favor of the more appropriateresourcePath
signature.default Icon
getResourceIcon
(ResourcePath resourcePath) Allows a module to give an appropriate icon for a resource.void
initializeScriptManager
(ScriptManager manager) Initialize a newly-instantiated script manager.void
notifyActivationStateChanged
(LicenseState licenseState) Notifies this designer module that its license state has changed.void
Notifies the module that the save operation has finished.void
Notifies the module that the user has requested that the project is saved.void
shutdown()
Called when the module is shut down.void
startup
(DesignerContext context, LicenseState activationState) The main entrypoint for the module hook.default void
updateLocationRenderer
(LocationRenderingInfo builder, Location location) Provides an opportunity for a module to enrich tag reference locations with extra context.
-
Method Details
-
startup
The main entrypoint for the module hook. This will only be called once for a given project. If another project is ever opened,shutdown()
will be called and a new hook will be instantiated- Throws:
Exception
- if the module was not able to be initialized for the given project.
-
shutdown
void shutdown()Called when the module is shut down. This will happen if the user opens a different project within the same designer session - the existing modules will be shut down, and new module hooks will be instantiated and started up. -
getModuleMenu
MenuBarMerge getModuleMenu()Returns a menu merge for any global menu additions. May be null.- See Also:
-
getModuleToolbars
Returns the toolbars for the module. May be empty but not null. -
getFrames
A list of DockableFrames that this module provides, that should be available to all workspaces. -
notifyActivationStateChanged
Notifies this designer module that its license state has changed. This could mean that the trial mode has expired (or been reset), the module has been activated, etc. -
configureSerializer
Provides the module a chance to add serialization delegates to the serializer custom for classes that might be encountered when serializing objects provided by this module -
configureDeserializer
-
configureFunctionFactory
Provides the module with an opportunity to define its own expression functions -
notifyProjectSaveStart
Notifies the module that the user has requested that the project is saved. The module must check-in any checked-out resources that it is holding. -
notifyProjectSaveDone
void notifyProjectSaveDone()Notifies the module that the save operation has finished. This is the cue to check-out any previously checked-out resources that it was forced to check-in before the save. -
initializeScriptManager
Initialize a newly-instantiated script manager. This will be called exactly once for any given ScriptManager instance. Usually this will involve callingScriptManager.addScriptModule(String, Object)
, which reflectively loads the public (instance and static) java functions from the given object into the scripting environment, at the provided path. -
getModuleIcon
Return an appropriate icon to display for this module. Ideally, anInteractiveIcon
of some kind. -
getResourceCategoryKey
Used by modules that add project resources to an Ignition project. This will be called when the platform needs to render your resource type in first-party UI. Only project resources that match this module's ID will passed to this function.
- Parameters:
resourcePath
- A resource path within this module's resources.- Returns:
- A bundle resource key for the category of this resource.
-
getResourceCategoryKey
Deprecated.Since Ignition 8.1.34, in favor of the more appropriateresourcePath
signature. To be removed in 8.3.0. -
getResourceDisplayName
Allows a module to give an appropriate display name for the resource. For most resources this won't be necessary (the resource's name itself should be used), but for some resources whose name is null, this may be appropriate.
- Returns:
- the name for a resource, or null to use the resource's folder path/name.
-
getResourceDisplayName
Deprecated.Since Ignition 8.1.34, in favor of the more appropriateresourcePath
signature. To be removed in 8.3.0. -
getResourceIcon
Allows a module to give an appropriate icon for a resource.
-
getResourceIcon
Deprecated.Since Ignition 8.1.34, in favor of the more appropriateresourcePath
signature. To be removed in 8.3.0. -
updateLocationRenderer
default void updateLocationRenderer(@Nonnull LocationRenderingInfo builder, @Nonnull Location location) Provides an opportunity for a module to enrich tag reference locations with extra context. Thelocation
provided is guaranteed to reside within your module. Call methods onLocationRenderingInfo
to enrich the rendering.- Specified by:
updateLocationRenderer
in interfaceLocationRenderingUpdater
- See Also:
-
createPermissionKeys
Allows a module to create one or more id-bundlekey pairs that the module will use for role-based client security.- Returns:
- Map of id-bundlekey entries. May be empty but not null.
-
resourcePath
signature.