Class ComponentRegistry

  • Direct Known Subclasses:
    DesignerComponentRegistry

    public class ComponentRegistry
    extends java.lang.Object
    Registry of all perspective components. Module authors should register their components here in both Gateway and Designer scopes.
    • Constructor Detail

      • ComponentRegistry

        public ComponentRegistry()
      • ComponentRegistry

        public ComponentRegistry​(java.util.List<java.lang.String> defFileNames)
    • Method Detail

      • registerComponent

        public void registerComponent​(@Nonnull
                                      ComponentDescriptor comp)
        Registers a component with the Perspective ComponentRegistry.

        For a component to show up, it must

        1. Not be deprecated
        2. Have at least one palette varient
        3. Have a valid name
        4. Include any appropriate BrowserResource entries

        Registering a new component will notify any registered ComponentRegistry.ComponentRegistryListeners.

        Parameters:
        comp - the descriptor for the component
      • getCategories

        public java.util.Set<java.lang.String> getCategories()
      • buildDescriptor

        protected ComponentDescriptor buildDescriptor​(com.inductiveautomation.ignition.common.gson.JsonObject componentDef,
                                                      @Nullable
                                                      java.lang.String versionHash)
      • fetchImage

        @Nullable
        public static java.awt.image.BufferedImage fetchImage​(java.net.URL url)
        Fetches an image will be used for component palette tile entries in the designer. The image will be scaled down to 72x48.
        Parameters:
        url - URL for the image
        Returns:
        a buffered image or null if the URL is not valid