Class DesignerComponentModel
- java.lang.Object
-
- com.inductiveautomation.ignition.common.lifecycle.AbstractLifecycle
-
- com.inductiveautomation.perspective.gateway.model.ComponentModel
-
- com.inductiveautomation.perspective.gateway.model.DesignerComponentModel
-
- All Implemented Interfaces:
AuditingContext
,Component
,LoggingContext
,PerspectiveElement
,PropertyTreeOwner
public class DesignerComponentModel extends ComponentModel
Backend instance of a component as it exists in a Designer, in order to allow special functionality not present in a typical running project (e.g., adding, removing components, etc).- Since:
- 8.0.0
-
-
Field Summary
-
Fields inherited from class com.inductiveautomation.perspective.gateway.model.ComponentModel
actions, addressPath, addressPathString, bindings, changeScripts, config, customMethods, log, messageHandlers, parent, properties, view
-
Fields inherited from interface com.inductiveautomation.perspective.gateway.api.Component
MDC_COMPONENT
-
-
Constructor Summary
Constructors Constructor Description DesignerComponentModel(ViewModel view, ComponentConfig config, int[] addressPath, DesignerComponentModel parent)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
alterEvents(EventConfigChange change)
void
alterPropConfig(PropertyConfigChange change)
void
alterScripts(ScriptConfigChange change)
protected java.util.List<ComponentModel>
children()
This method should always return a list containing all children, in the proper order.protected PropertyTreePermissionModel
createPermissionModel(PropertyType scope, PropertyConfigCollection config)
DesignerPropertyReference
createPropertyReference(java.lang.String referencePath, java.util.function.Consumer<PropertyTreeChangeEvent> subscriber, java.util.Set<Origin> acceptableOrigins)
Create aPropertyReference
with thisPerspectiveElement
as the target.java.util.Optional<Component>
getChild(int childId)
protected void
initChildren(java.util.List<ComponentConfig> configChildren)
protected com.inductiveautomation.perspective.gateway.model.ActionCollection
newActionHandler(EventConfig config)
boolean
removeChild(int addressId)
java.lang.String
toString()
-
Methods inherited from class com.inductiveautomation.perspective.gateway.model.ComponentModel
dispatch, findChildByName, findCustomMethod, fireEvent, focus, getAuditSnapshot, getChildren, getComponentAddressPath, getComponentState, getLogger, getMdcParent, getModelDelegate, getName, getParent, getPropertyTreeOf, getQualifiedPath, getTraceId, getView, initProperties, mdcSetup, mdcTeardown, onShutdown, onStartup, refreshBinding, setName
-
Methods inherited from class com.inductiveautomation.ignition.common.lifecycle.AbstractLifecycle
isRunning, shutdown, startup
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.inductiveautomation.perspective.gateway.api.AuditingContext
audit
-
Methods inherited from interface com.inductiveautomation.perspective.gateway.api.Component
getPage, getSession
-
Methods inherited from interface com.inductiveautomation.perspective.gateway.api.LoggingContext
mdc, mdcSetupTree, mdcTeardownTree, mdcWrap
-
Methods inherited from interface com.inductiveautomation.perspective.gateway.api.PerspectiveElement
getAuditProfile
-
-
-
-
Constructor Detail
-
DesignerComponentModel
public DesignerComponentModel(ViewModel view, ComponentConfig config, int[] addressPath, DesignerComponentModel parent)
-
-
Method Detail
-
alterPropConfig
public void alterPropConfig(PropertyConfigChange change)
-
alterEvents
public void alterEvents(EventConfigChange change)
-
alterScripts
public void alterScripts(ScriptConfigChange change)
-
newActionHandler
protected com.inductiveautomation.perspective.gateway.model.ActionCollection newActionHandler(EventConfig config)
- Overrides:
newActionHandler
in classComponentModel
-
createPermissionModel
protected PropertyTreePermissionModel createPermissionModel(PropertyType scope, PropertyConfigCollection config)
- Overrides:
createPermissionModel
in classComponentModel
-
removeChild
public boolean removeChild(int addressId)
-
initChildren
protected void initChildren(java.util.List<ComponentConfig> configChildren)
- Overrides:
initChildren
in classComponentModel
-
children
@Nonnull protected java.util.List<ComponentModel> children()
Description copied from class:ComponentModel
This method should always return a list containing all children, in the proper order. Note that though all children are present and in the correct order, their index values may not be representative of their actual child ID (as is the case in the designer, where index and id diverge as changes are made to children).- Overrides:
children
in classComponentModel
- Returns:
- a list of child component models, which may be empty but will never be null.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getChild
public java.util.Optional<Component> getChild(int childId)
- Specified by:
getChild
in interfaceComponent
- Overrides:
getChild
in classComponentModel
-
createPropertyReference
@Nonnull public DesignerPropertyReference createPropertyReference(java.lang.String referencePath, java.util.function.Consumer<PropertyTreeChangeEvent> subscriber, java.util.Set<Origin> acceptableOrigins)
Description copied from interface:PerspectiveElement
Create aPropertyReference
with thisPerspectiveElement
as the target.- Specified by:
createPropertyReference
in interfacePerspectiveElement
- Overrides:
createPropertyReference
in classComponentModel
- Parameters:
referencePath
- the path to the propertysubscriber
- the subscriber - aConsumer
ofPropertyTreeChangeEvent
sacceptableOrigins
- theSet
ofOrigin
s in which the subscriber is interested- Returns:
- the
PropertyReference
-
-