Class BasicMutableConfigurationPropertyModel
- java.lang.Object
-
- com.inductiveautomation.ignition.common.config.BasicConfigurationPropertyModel
-
- com.inductiveautomation.ignition.common.config.BasicMutableConfigurationPropertyModel
-
- All Implemented Interfaces:
ConfigurationPropertyModel
,MutableConfigurationPropertyModel
,PropertyResolver
,java.io.Serializable
public class BasicMutableConfigurationPropertyModel extends BasicConfigurationPropertyModel implements MutableConfigurationPropertyModel
This is the basic serializable version of the configuration property model.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
BasicMutableConfigurationPropertyModel.ClassifiedProperties<T>
-
Nested classes/interfaces inherited from class com.inductiveautomation.ignition.common.config.BasicConfigurationPropertyModel
BasicConfigurationPropertyModel.DefaultRankedProperty, BasicConfigurationPropertyModel.InternalProperty<T>, BasicConfigurationPropertyModel.RankedProperty
-
-
Field Summary
-
Fields inherited from class com.inductiveautomation.ignition.common.config.BasicConfigurationPropertyModel
resources
-
Fields inherited from interface com.inductiveautomation.ignition.common.config.ConfigurationPropertyModel
EMPTY_MODEL
-
-
Constructor Summary
Constructors Constructor Description BasicMutableConfigurationPropertyModel()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addClassifiedProperties(java.lang.String classification, Property<?> prop, java.util.Collection<Property<?>> properties)
Registers a set of properties that would be available for a given value of a certain classification.<T> void
addClassifiedValue(java.lang.String classification, Property<T> keyProp, T value)
This is where we associate a particular value with a certain classification.<T> void
addDependantProperties(Property<T> prop, java.util.Collection<T> values, java.util.Collection<Property<?>> properties)
Same as single-value registerDependentProperties, but when multiple values are valid.<T> void
addDependantProperties(Property<T> prop, T value, java.util.Collection<Property<?>> properties)
Registers properties that are only available if the specified property is equal to the given value.void
addProperties(java.util.Collection<Property<?>> properties)
Registers properties that are always editable.<T> void
addResourceValue(java.lang.String classification, T... value)
Resource values are a type of value that multiple properties can share.long
getCurrentModelVersion()
Returns the current model version, incremented when the model is changed.ConfigurationPropertyModel
getModelSnapshot()
Returns a serializable, non-mutable version of the model appropriate for sending to the designer or remote gateways.protected void
incrementModelVersion()
void
markImmutable(Property<?> property)
This effectively excludes a property from ever being "applicable".static BasicMutableConfigurationPropertyModel
of(Property<?>... props)
static BasicMutableConfigurationPropertyModel
of(java.util.Collection<Property<?>> props)
<T> void
registerAllowedValues(Property<T> property, java.util.List<T> values)
Registers a set of allowed values for the given property.void
removeClassifiedProperties(java.lang.String classification, Property<?> keyProp)
<T> void
removeClassifiedValue(java.lang.String classification, Property<T> keyProp, T value)
<T> void
removeDependantProperties(Property<T> prop, T value)
Removes all dependant properties for the given value.void
removeProperties(java.util.Collection<Property<?>> properties)
Unregisters tag properties.void
setAllowCustomValue(Property<?> property, boolean value)
Marks whether or not a property that has allowed values is also customizable.<T> void
setAllowedValues(Property<T> property, java.util.List<T> values)
Registers a set of allowed values for the given property.<T> void
setResourceValues(java.lang.String classification, java.util.Collection<T> values)
Resource values are a type of value that multiple properties can share.<T> void
setResourceValueSource(Property<T> property, java.lang.String classification)
Sets a "resource type" as the value source.-
Methods inherited from class com.inductiveautomation.ignition.common.config.BasicConfigurationPropertyModel
compareRankedProperties, connectDependency, contains, getAffectedProperties, getAllowedValues, getApplicableProperties, getModelProperties, getResourceValues, isApplicable, isCustomizable, isModelProperty, mergeTo, p, resolve
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.inductiveautomation.ignition.common.config.ConfigurationPropertyModel
contains, getAffectedProperties, getAllowedValues, getApplicableProperties, getModelProperties, isApplicable, isCustomizable, isModelProperty, mergeTo
-
Methods inherited from interface com.inductiveautomation.ignition.common.config.MutableConfigurationPropertyModel
addDependantProperties, addProperties, removeProperties
-
Methods inherited from interface com.inductiveautomation.ignition.common.config.PropertyResolver
resolve
-
-
-
-
Method Detail
-
getCurrentModelVersion
public long getCurrentModelVersion()
Description copied from interface:ConfigurationPropertyModel
Returns the current model version, incremented when the model is changed.- Specified by:
getCurrentModelVersion
in interfaceConfigurationPropertyModel
- Overrides:
getCurrentModelVersion
in classBasicConfigurationPropertyModel
-
incrementModelVersion
protected void incrementModelVersion()
-
getModelSnapshot
public ConfigurationPropertyModel getModelSnapshot()
Description copied from interface:MutableConfigurationPropertyModel
Returns a serializable, non-mutable version of the model appropriate for sending to the designer or remote gateways.- Specified by:
getModelSnapshot
in interfaceMutableConfigurationPropertyModel
-
of
public static BasicMutableConfigurationPropertyModel of(java.util.Collection<Property<?>> props)
-
of
public static BasicMutableConfigurationPropertyModel of(Property<?>... props)
-
markImmutable
public void markImmutable(Property<?> property)
Description copied from interface:MutableConfigurationPropertyModel
This effectively excludes a property from ever being "applicable". However, it's still used to evaluate dependencies. Therefore, it's used when we want sets of properties to be dependent on a value that should not be changed through any sort of editing UI.- Specified by:
markImmutable
in interfaceMutableConfigurationPropertyModel
-
addProperties
public void addProperties(java.util.Collection<Property<?>> properties)
Description copied from interface:MutableConfigurationPropertyModel
Registers properties that are always editable.- Specified by:
addProperties
in interfaceMutableConfigurationPropertyModel
-
removeProperties
public void removeProperties(java.util.Collection<Property<?>> properties)
Description copied from interface:MutableConfigurationPropertyModel
Unregisters tag properties. Only affects properties registered by registerProperties.- Specified by:
removeProperties
in interfaceMutableConfigurationPropertyModel
-
registerAllowedValues
public <T> void registerAllowedValues(Property<T> property, java.util.List<T> values)
Description copied from interface:MutableConfigurationPropertyModel
Registers a set of allowed values for the given property. If values are already defined, these will be added to them.- Specified by:
registerAllowedValues
in interfaceMutableConfigurationPropertyModel
-
setAllowedValues
public <T> void setAllowedValues(Property<T> property, java.util.List<T> values)
Description copied from interface:MutableConfigurationPropertyModel
Registers a set of allowed values for the given property. If values are already defined, they will be replaced. If the property is a string type, the empty string option will automatically be added. This function is primarily used by string options that want to allow selection from a list of profiles, or objects. Often these properties allow "" but don't provide it as a value from their model. If you really want to not allow the empty option, you can call setAllowedValues(p, null), and then call registerAllowedValues(...) with the values you want.- Specified by:
setAllowedValues
in interfaceMutableConfigurationPropertyModel
-
setAllowCustomValue
public void setAllowCustomValue(Property<?> property, boolean value)
Description copied from interface:MutableConfigurationPropertyModel
Marks whether or not a property that has allowed values is also customizable.- Specified by:
setAllowCustomValue
in interfaceMutableConfigurationPropertyModel
-
addDependantProperties
public <T> void addDependantProperties(Property<T> prop, T value, java.util.Collection<Property<?>> properties)
Description copied from interface:MutableConfigurationPropertyModel
Registers properties that are only available if the specified property is equal to the given value.- Specified by:
addDependantProperties
in interfaceMutableConfigurationPropertyModel
-
addDependantProperties
public <T> void addDependantProperties(Property<T> prop, java.util.Collection<T> values, java.util.Collection<Property<?>> properties)
Description copied from interface:MutableConfigurationPropertyModel
Same as single-value registerDependentProperties, but when multiple values are valid. Slightly more efficient than registering each value independently.- Specified by:
addDependantProperties
in interfaceMutableConfigurationPropertyModel
-
removeDependantProperties
public <T> void removeDependantProperties(Property<T> prop, T value)
Description copied from interface:MutableConfigurationPropertyModel
Removes all dependant properties for the given value.- Specified by:
removeDependantProperties
in interfaceMutableConfigurationPropertyModel
-
addClassifiedProperties
public void addClassifiedProperties(java.lang.String classification, Property<?> prop, java.util.Collection<Property<?>> properties)
Description copied from interface:MutableConfigurationPropertyModel
Registers a set of properties that would be available for a given value of a certain classification. This is typically used for properties registered by extension points. The type id is the "class", and then as profiles are added and removed, they are registered/unregistered with registerClassifiedValue.- Specified by:
addClassifiedProperties
in interfaceMutableConfigurationPropertyModel
-
addClassifiedValue
public <T> void addClassifiedValue(java.lang.String classification, Property<T> keyProp, T value)
This is where we associate a particular value with a certain classification.- Specified by:
addClassifiedValue
in interfaceMutableConfigurationPropertyModel
-
removeClassifiedProperties
public void removeClassifiedProperties(java.lang.String classification, Property<?> keyProp)
- Specified by:
removeClassifiedProperties
in interfaceMutableConfigurationPropertyModel
-
removeClassifiedValue
public <T> void removeClassifiedValue(java.lang.String classification, Property<T> keyProp, T value)
- Specified by:
removeClassifiedValue
in interfaceMutableConfigurationPropertyModel
-
addResourceValue
public <T> void addResourceValue(java.lang.String classification, T... value)
Description copied from interface:MutableConfigurationPropertyModel
Resource values are a type of value that multiple properties can share. The are registered here, and then separately a property must be set to use a resource value type with setResourceValueSource(id). An example of this would be Tag Groups- multiple properties use them. This function adds available values to anything that was already registered.- Specified by:
addResourceValue
in interfaceMutableConfigurationPropertyModel
-
setResourceValues
public <T> void setResourceValues(java.lang.String classification, java.util.Collection<T> values)
Description copied from interface:MutableConfigurationPropertyModel
Resource values are a type of value that multiple properties can share. The are registered here, and then separately a property must be set to use a resource value type with setResourceValueSource(id). An example of this would be Tag Groups- multiple properties use them. This function sets the available values, replacing anything that was previously registered.- Specified by:
setResourceValues
in interfaceMutableConfigurationPropertyModel
-
setResourceValueSource
public <T> void setResourceValueSource(Property<T> property, java.lang.String classification)
Description copied from interface:MutableConfigurationPropertyModel
Sets a "resource type" as the value source. These are values that are registered through add/setResourceValue.- Specified by:
setResourceValueSource
in interfaceMutableConfigurationPropertyModel
-
-