Class ComponentRegistry
- java.lang.Object
- 
- com.inductiveautomation.perspective.common.api.ComponentRegistry
 
- 
- Direct Known Subclasses:
- DesignerComponentRegistry
 
 public class ComponentRegistry extends java.lang.ObjectRegistry of all perspective components. Module authors should register their components here in both Gateway and Designer scopes.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static interfaceComponentRegistry.ComponentRegistryListener
 - 
Constructor SummaryConstructors Constructor Description ComponentRegistry()ComponentRegistry(java.util.List<java.lang.String> defFileNames)
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ComponentDescriptorbuildDescriptor(com.inductiveautomation.ignition.common.gson.JsonObject componentDef, java.lang.String versionHash)static java.awt.image.BufferedImagefetchImage(java.net.URL url)Fetches an image will be used for component palette tile entries in the designer.java.util.Optional<ComponentDescriptor>find(java.lang.String type)java.util.Map<java.lang.String,ComponentDescriptor>get()java.util.Set<java.lang.String>getCategories()voidregisterComponent(ComponentDescriptor comp)Registers a component with the Perspective ComponentRegistry.voidregisterListener(ComponentRegistry.ComponentRegistryListener listener)voidremoveComponent(java.lang.String componentId)Removes a component from the registry.voidremoveListener(ComponentRegistry.ComponentRegistryListener listener)
 
- 
- 
- 
Method Detail- 
registerComponentpublic void registerComponent(@Nonnull ComponentDescriptor comp)Registers a component with the Perspective ComponentRegistry.For a component to show up, it must - Not be deprecated
- Have at least one palette varient
- Have a valid name
- Include any appropriate BrowserResourceentries
 Registering a new component will notify any registered ComponentRegistry.ComponentRegistryListeners.- Parameters:
- comp- the descriptor for the component
 
- Not be 
 - 
removeComponentpublic void removeComponent(@Nonnull java.lang.String componentId)Removes a component from the registry.Removing a component will notify any registered ComponentRegistry.ComponentRegistryListeners.- Parameters:
- componentId- the- ComponentDescriptor.id()value of the component to remove
 
 - 
getpublic java.util.Map<java.lang.String,ComponentDescriptor> get() 
 - 
findpublic java.util.Optional<ComponentDescriptor> find(java.lang.String type) 
 - 
getCategoriespublic java.util.Set<java.lang.String> getCategories() 
 - 
buildDescriptorprotected ComponentDescriptor buildDescriptor(com.inductiveautomation.ignition.common.gson.JsonObject componentDef, @Nullable java.lang.String versionHash) 
 - 
registerListenerpublic void registerListener(ComponentRegistry.ComponentRegistryListener listener) 
 - 
removeListenerpublic void removeListener(ComponentRegistry.ComponentRegistryListener listener) 
 - 
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
 
 
- 
 
-