Class ComponentRegistry
java.lang.Object
com.inductiveautomation.perspective.common.api.ComponentRegistry
- Direct Known Subclasses:
DesignerComponentRegistry
Registry of all perspective components. Module authors should register their components here in both Gateway
and Designer scopes.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ComponentDescriptor
buildDescriptor
(com.inductiveautomation.ignition.common.gson.JsonObject componentDef, String versionHash) static BufferedImage
fetchImage
(URL url) Fetches an image will be used for component palette tile entries in the designer.get()
void
Registers a component with the Perspective ComponentRegistry.void
void
removeComponent
(String componentId) Removes a component from the registry.void
-
Constructor Details
-
ComponentRegistry
public ComponentRegistry() -
ComponentRegistry
-
-
Method Details
-
registerComponent
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
BrowserResource
entries
Registering a new component will notify any registered
ComponentRegistry.ComponentRegistryListener
s.- Parameters:
comp
- the descriptor for the component
- Not be
-
removeComponent
Removes a component from the registry.Removing a component will notify any registered
ComponentRegistry.ComponentRegistryListener
s.- Parameters:
componentId
- theComponentDescriptor.id()
value of the component to remove
-
get
-
find
-
getCategories
-
buildDescriptor
protected ComponentDescriptor buildDescriptor(com.inductiveautomation.ignition.common.gson.JsonObject componentDef, @Nullable String versionHash) -
registerListener
-
removeListener
-
fetchImage
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
-