Class ComponentRegistry
- java.lang.Object
-
- com.inductiveautomation.perspective.common.api.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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
ComponentRegistry.ComponentRegistryListener
-
Constructor Summary
Constructors Constructor Description ComponentRegistry()
ComponentRegistry(java.util.List<java.lang.String> defFileNames)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ComponentDescriptor
buildDescriptor(com.inductiveautomation.ignition.common.gson.JsonObject componentDef, java.lang.String versionHash)
java.util.Optional<ComponentDescriptor>
find(java.lang.String type)
java.util.Map<java.lang.String,ComponentDescriptor>
get()
java.util.Set<java.lang.String>
getCategories()
void
registerComponent(ComponentDescriptor comp)
Registers a component with the Perspective ComponentRegistry.void
registerListener(ComponentRegistry.ComponentRegistryListener listener)
void
removeComponent(java.lang.String componentId)
Removes a component from the registry.void
removeListener(ComponentRegistry.ComponentRegistryListener listener)
-
-
-
Method Detail
-
registerComponent
public 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
BrowserResource
entries
Registering a new component will notify any registered
ComponentRegistry.ComponentRegistryListener
s.- Parameters:
comp
- the descriptor for the component
- Not be
-
removeComponent
public void removeComponent(@Nonnull java.lang.String componentId)
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
public java.util.Map<java.lang.String,ComponentDescriptor> get()
-
find
public java.util.Optional<ComponentDescriptor> find(java.lang.String type)
-
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)
-
registerListener
public void registerListener(ComponentRegistry.ComponentRegistryListener listener)
-
removeListener
public void removeListener(ComponentRegistry.ComponentRegistryListener listener)
-
-