Class ComponentDescriptorImpl
java.lang.Object
com.inductiveautomation.perspective.common.api.ComponentDescriptorImpl
- All Implemented Interfaces:
- ComponentDescriptor
- 
Nested Class SummaryNested Classes
- 
Method SummaryModifier and TypeMethodDescriptionReturns a set ofBrowserResources, which are provided to the designer and perspective client at runtime to insure the needed items are provided in the web environment to support the component.Optional<com.inductiveautomation.ignition.common.gson.JsonObject>Defined default position property structure and values for children of new instances of this component.Used for components that are containers in order to provide a schema for the position objects of their children.The default meta.name value for this component.com.inductiveautomation.ignition.common.gson.JsonObjectDefines default property structure and values for new instances of this component.booleanevents()fromJson(com.inductiveautomation.ignition.common.gson.JsonObject json, String moduleId, String versionHash) Builds a ComponentDescriptor, given aJsonObjectthat is follows the following format:fromJson(com.inductiveautomation.ignition.common.gson.JsonObject json, String moduleId, Function<String, Icon> iconFetcher, BiFunction<String, String, BufferedImage> thumbnailFetcher, String versionHash) Use this variant if you know how to provide icons and thumbnails for your components.Optional<com.inductiveautomation.ignition.common.gson.JsonObject>getIcon()Return the icon that is registered along with the descriptor.id()The unique string that identifies this componentmoduleId()The moduleId should be a String id that matches the module that is contributing this component to the Ignition Perspective module system.name()Which category this component should be listed under in the Designer's component palette.schema()Defines the shape of the component's properties structure.toString()Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.inductiveautomation.perspective.common.api.ComponentDescriptorgetInitialProps
- 
Method Details- 
moduleIdDescription copied from interface:ComponentDescriptorThe moduleId should be a String id that matches the module that is contributing this component to the Ignition Perspective module system.- Specified by:
- moduleIdin interface- ComponentDescriptor
- Returns:
- the Ignition module ID of the module providing the component.
 
- 
defaultMetaNameDescription copied from interface:ComponentDescriptorThe default meta.name value for this component.- Specified by:
- defaultMetaNamein interface- ComponentDescriptor
 
- 
name- Specified by:
- namein interface- ComponentDescriptor
- Returns:
- a human-readable name to briefly describe the component
 
- 
deprecatedpublic boolean deprecated()- Specified by:
- deprecatedin interface- ComponentDescriptor
- Returns:
- true if this component is no longer in active use. This will hide it from the palette and other UI that allows users to pick components (e.g. tag drop config)
 
- 
paletteCategoryDescription copied from interface:ComponentDescriptorWhich category this component should be listed under in the Designer's component palette.- Specified by:
- paletteCategoryin interface- ComponentDescriptor
 
- 
paletteEntries- Specified by:
- paletteEntriesin interface- ComponentDescriptor
 
- 
defaultProperties@Nonnull public com.inductiveautomation.ignition.common.gson.JsonObject defaultProperties()Description copied from interface:ComponentDescriptorDefines default property structure and values for new instances of this component.- Specified by:
- defaultPropertiesin interface- ComponentDescriptor
 
- 
childPositionDefaultsDescription copied from interface:ComponentDescriptorDefined default position property structure and values for children of new instances of this component.- Specified by:
- childPositionDefaultsin interface- ComponentDescriptor
 
- 
browserResourcesDescription copied from interface:ComponentDescriptorReturns a set ofBrowserResources, which are provided to the designer and perspective client at runtime to insure the needed items are provided in the web environment to support the component. Common use cases are css files and js libraries. These resources are collected at runtime and added to the DOM prior to starting the project/view.- Specified by:
- browserResourcesin interface- ComponentDescriptor
- Returns:
- a set of resources that the component requires.
 
- 
schemaDescription copied from interface:ComponentDescriptorDefines the shape of the component's properties structure.- Specified by:
- schemain interface- ComponentDescriptor
 
- 
childPositionSchemaDescription copied from interface:ComponentDescriptorUsed for components that are containers in order to provide a schema for the position objects of their children.- Specified by:
- childPositionSchemain interface- ComponentDescriptor
 
- 
idDescription copied from interface:ComponentDescriptorThe unique string that identifies this component- Specified by:
- idin interface- ComponentDescriptor
 
- 
events- Specified by:
- eventsin interface- ComponentDescriptor
- Returns:
- a collection of the events that this component might fire.
 
- 
extensionFunctions- Specified by:
- extensionFunctionsin interface- ComponentDescriptor
- Returns:
- a collection of the extension functions that this component declares
 
- 
getExampleChildPositionDefaultspublic Optional<com.inductiveautomation.ignition.common.gson.JsonObject> getExampleChildPositionDefaults()- Specified by:
- getExampleChildPositionDefaultsin interface- ComponentDescriptor
 
- 
getIconDescription copied from interface:ComponentDescriptorReturn the icon that is registered along with the descriptor. If an icon is not set, the default icon will be used instead. Pro-tip: use InteractiveSvgIconto create an icon that works well in the nav-tree- Specified by:
- getIconin interface- ComponentDescriptor
- Returns:
- icon used for the nav tree and component palette
 
- 
toString
- 
fromJsonpublic static ComponentDescriptorImpl.ComponentBuilder fromJson(@Nonnull com.inductiveautomation.ignition.common.gson.JsonObject json, @Nonnull String moduleId, @Nullable String versionHash) Builds a ComponentDescriptor, given aJsonObjectthat is follows the following format:{ "id": "mymodule.my-component", "name": "My Component", "deprecated": false, (optional), "defaultMetaName": "MyComp", "palette": { "category": "Examples", "variants": [ { "label": "My Component", "tooltip": "It's a useful component" }, { (additional entries optional) "id": "alt-1", "label": "My Component - Alternate", "tooltip": "It's like the normal version, but different" "props": { "someSetting": "set-differently" } } ] } "schema": { json-schema here } }- Parameters:
- json- object to build the descriptor from
- Returns:
- ComponentDescriptor populated from the given json object
- Since:
- Ignition 8.0.6
 
- 
fromJsonpublic static ComponentDescriptorImpl.ComponentBuilder fromJson(@Nonnull com.inductiveautomation.ignition.common.gson.JsonObject json, @Nonnull String moduleId, @Nonnull Function<String, Icon> iconFetcher, @Nonnull BiFunction<String, String, BufferedImage> thumbnailFetcher, @Nullable String versionHash) Use this variant if you know how to provide icons and thumbnails for your components.- Parameters:
- iconFetcher- function of component id -> (nullable)icon
- thumbnailFetcher- function of (component id, variant id) -> (nullable)buffered image
 
 
-