Class ComponentDescriptorImpl
- java.lang.Object
-
- com.inductiveautomation.perspective.common.api.ComponentDescriptorImpl
-
- All Implemented Interfaces:
ComponentDescriptor
public class ComponentDescriptorImpl extends java.lang.Object implements ComponentDescriptor
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ComponentDescriptorImpl.ComponentBuilder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Set<BrowserResource>
browserResources()
Returns a set ofBrowserResource
s, 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.java.util.Optional<com.inductiveautomation.ignition.common.gson.JsonObject>
childPositionDefaults()
Defined default position property structure and values for children of new instances of this component.JsonSchema
childPositionSchema()
Used for components that are containers in order to provide a schema for the position objects of their children.java.lang.String
defaultMetaName()
The default meta.name value for this component.com.inductiveautomation.ignition.common.gson.JsonObject
defaultProperties()
Defines default property structure and values for new instances of this component.java.util.Collection<ComponentEventDescriptor>
events()
static ComponentDescriptorImpl.ComponentBuilder
fromJson(com.inductiveautomation.ignition.common.gson.JsonObject json, java.lang.String versionHash)
Builds a ComponentDescriptor, given aJsonObject
that is follows the following format:// TODO
java.util.Optional<com.inductiveautomation.ignition.common.gson.JsonObject>
getExampleChildPositionDefaults()
com.inductiveautomation.ignition.common.gson.JsonObject
getExampleDefaultProps()
javax.swing.Icon
getIcon()
Return the icon that is registered along with the descriptor.java.lang.String
id()
The unique string that identifies this componentjava.lang.String
moduleId()
The moduleId should be a String id that matches the module that is contributing this component to the Ignition Perspective module system.java.lang.String
paletteCategory()
Which category this component should be listed under in the Designer's component palette.java.lang.String
paletteDescription()
The description should return a short description of the component, generally as a short sentence.java.lang.String
paletteName()
The name for this component as it will be presented in the Designer palette, stored as aLocalizedString
.JsonSchema
schema()
Defines the shape of the component's properties structure.boolean
showOnPalette()
java.lang.String
toString()
-
-
-
Method Detail
-
moduleId
@Nonnull public java.lang.String moduleId()
Description copied from interface:ComponentDescriptor
The moduleId should be a String id that matches the module that is contributing this component to the Ignition Perspective module system.- Specified by:
moduleId
in interfaceComponentDescriptor
- Returns:
- the Ignition module ID of the module providing the component.
-
paletteName
@Nonnull public java.lang.String paletteName()
Description copied from interface:ComponentDescriptor
The name for this component as it will be presented in the Designer palette, stored as aLocalizedString
.- Specified by:
paletteName
in interfaceComponentDescriptor
-
defaultMetaName
@Nonnull public java.lang.String defaultMetaName()
Description copied from interface:ComponentDescriptor
The default meta.name value for this component.- Specified by:
defaultMetaName
in interfaceComponentDescriptor
-
paletteDescription
@Nonnull public java.lang.String paletteDescription()
Description copied from interface:ComponentDescriptor
The description should return a short description of the component, generally as a short sentence.- Specified by:
paletteDescription
in interfaceComponentDescriptor
- Returns:
- a short sentence about what this component does
-
defaultProperties
@Nonnull public com.inductiveautomation.ignition.common.gson.JsonObject defaultProperties()
Description copied from interface:ComponentDescriptor
Defines default property structure and values for new instances of this component.- Specified by:
defaultProperties
in interfaceComponentDescriptor
-
childPositionDefaults
public java.util.Optional<com.inductiveautomation.ignition.common.gson.JsonObject> childPositionDefaults()
Description copied from interface:ComponentDescriptor
Defined default position property structure and values for children of new instances of this component.- Specified by:
childPositionDefaults
in interfaceComponentDescriptor
-
browserResources
@Nonnull public java.util.Set<BrowserResource> browserResources()
Description copied from interface:ComponentDescriptor
Returns a set ofBrowserResource
s, 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:
browserResources
in interfaceComponentDescriptor
- Returns:
- a set of resources that the component requires.
-
schema
public JsonSchema schema()
Description copied from interface:ComponentDescriptor
Defines the shape of the component's properties structure.- Specified by:
schema
in interfaceComponentDescriptor
-
childPositionSchema
@Nullable public JsonSchema childPositionSchema()
Description copied from interface:ComponentDescriptor
Used for components that are containers in order to provide a schema for the position objects of their children.- Specified by:
childPositionSchema
in interfaceComponentDescriptor
-
id
@Nonnull public java.lang.String id()
Description copied from interface:ComponentDescriptor
The unique string that identifies this component- Specified by:
id
in interfaceComponentDescriptor
-
paletteCategory
@Nonnull public java.lang.String paletteCategory()
Description copied from interface:ComponentDescriptor
Which category this component should be listed under in the Designer's component palette.- Specified by:
paletteCategory
in interfaceComponentDescriptor
-
showOnPalette
public boolean showOnPalette()
- Specified by:
showOnPalette
in interfaceComponentDescriptor
- Returns:
- true if the component should be displayed in the Ignition Designer's Perspective Component palette. True by default, but may be implemented to return false to remove a component from the designer palette. Useful as a means to 'soft deprecate' a component without removing it from the system entirely, insuring that projects that already use said component will continue to function, but new instances of these components will not easily be created in the designer.
-
events
@Nonnull public java.util.Collection<ComponentEventDescriptor> events()
- Specified by:
events
in interfaceComponentDescriptor
- Returns:
- a collection of the events that this component might fire.
-
getExampleDefaultProps
@Nullable public com.inductiveautomation.ignition.common.gson.JsonObject getExampleDefaultProps()
- Specified by:
getExampleDefaultProps
in interfaceComponentDescriptor
-
getExampleChildPositionDefaults
public java.util.Optional<com.inductiveautomation.ignition.common.gson.JsonObject> getExampleChildPositionDefaults()
- Specified by:
getExampleChildPositionDefaults
in interfaceComponentDescriptor
-
getIcon
@Nullable public javax.swing.Icon getIcon()
Description copied from interface:ComponentDescriptor
Return the icon that is registered along with the descriptor. If an icon is not set, the default icon will be used instead.- Specified by:
getIcon
in interfaceComponentDescriptor
- Returns:
- icon used for the nav tree and component palette
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
fromJson
public static ComponentDescriptorImpl.ComponentBuilder fromJson(@Nonnull com.inductiveautomation.ignition.common.gson.JsonObject json, @Nullable java.lang.String versionHash)
Builds a ComponentDescriptor, given aJsonObject
that is follows the following format:// TODO
- Parameters:
json
- object to build the descriptor from- Returns:
- ComponentDescriptor populated from the given json object
- Since:
- Ignition 8.0.6
-
-