Class AbstractDesignerModuleHook

  • All Implemented Interfaces:
    DesignerModuleHook
    Direct Known Subclasses:
    DesignerHook, DesignerHook, ReportingDesignerHook, SFCDesignerHook, VisionDesignerImpl

    public abstract class AbstractDesignerModuleHook
    extends java.lang.Object
    implements DesignerModuleHook

    Base class for all designer module hook implementations. All methods are given empty implementations. It is expected that subclasses will override any methods that they wish to give real implementations.

    Best practice is to subclass this class rather than implement DesignerModuleHook directly, so that when new methods get added to the interface, your module automatically inherits an empty implementation of the new method rather than breaking with a NoSuchMethodError.

    • Constructor Detail

      • AbstractDesignerModuleHook

        public AbstractDesignerModuleHook()
    • Method Detail

      • startup

        public void startup​(DesignerContext context,
                            LicenseState activationState)
                     throws java.lang.Exception
        Description copied from interface: DesignerModuleHook
        The main entrypoint for the module hook. This will only be called once for a given project. If another project is ever opened, DesignerModuleHook.shutdown() will be called and a new hook will be instantiated
        Specified by:
        startup in interface DesignerModuleHook
        Throws:
        java.lang.Exception - if the module was not able to be initialized for the given project.
      • shutdown

        public void shutdown()
        Description copied from interface: DesignerModuleHook
        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.
        Specified by:
        shutdown in interface DesignerModuleHook
      • getResourceCategoryKey

        public java.lang.String getResourceCategoryKey​(ProjectResourceId id)
        Description copied from interface: DesignerModuleHook

        Used by modules that add project resources to an Ignition project. This will be called when the exporter is displaying all of the resources inside a project for export. Only project resources that match this module's ID will passed to this function.

        Used by the import/export system.

        Specified by:
        getResourceCategoryKey in interface DesignerModuleHook
        Parameters:
        id - A project resource that was added by this module.
        Returns:
        A bundle resource key for the category of this resource.
      • getResourceDisplayName

        public java.lang.String getResourceDisplayName​(ProjectResourceId id)
        Description copied from interface: DesignerModuleHook

        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.

        Used by the import/export system.

        Specified by:
        getResourceDisplayName in interface DesignerModuleHook
        Returns:
        the name for a resource, or null to use the resource's folder path/name.
      • getModuleToolbars

        @Nonnull
        public java.util.List<com.jidesoft.action.CommandBar> getModuleToolbars()
        Description copied from interface: DesignerModuleHook
        Returns the toolbars for the module. May be empty but not null.
        Specified by:
        getModuleToolbars in interface DesignerModuleHook
      • getFrames

        @Nonnull
        public java.util.List<com.jidesoft.docking.DockableFrame> getFrames()
        Description copied from interface: DesignerModuleHook
        A list of DockableFrames that this module provides, that should be available to all workspaces.
        Specified by:
        getFrames in interface DesignerModuleHook
      • notifyActivationStateChanged

        public void notifyActivationStateChanged​(LicenseState licenseState)
        Description copied from interface: DesignerModuleHook
        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.
        Specified by:
        notifyActivationStateChanged in interface DesignerModuleHook
      • configureSerializer

        public void configureSerializer​(XMLSerializer serializer)
        Description copied from interface: DesignerModuleHook
        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
        Specified by:
        configureSerializer in interface DesignerModuleHook
      • notifyProjectSaveStart

        public void notifyProjectSaveStart​(SaveContext save)
        Description copied from interface: DesignerModuleHook
        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.
        Specified by:
        notifyProjectSaveStart in interface DesignerModuleHook
      • notifyProjectSaveDone

        public void notifyProjectSaveDone()
        Description copied from interface: DesignerModuleHook
        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.
        Specified by:
        notifyProjectSaveDone in interface DesignerModuleHook
      • createPermissionKeys

        public java.util.Map<java.lang.String,​java.lang.String> createPermissionKeys()
        Description copied from interface: DesignerModuleHook
        Allows a module to create one or more id-bundlekey pairs that the module will use for role-based client security.
        Specified by:
        createPermissionKeys in interface DesignerModuleHook
        Returns:
        Map of id-bundlekey entries. May be empty but not null.