Class BasicConfigurationPropertyModel
- java.lang.Object
-
- com.inductiveautomation.ignition.common.config.BasicConfigurationPropertyModel
-
- All Implemented Interfaces:
ConfigurationPropertyModel,PropertyResolver,java.io.Serializable
- Direct Known Subclasses:
BasicMutableConfigurationPropertyModel
public class BasicConfigurationPropertyModel extends java.lang.Object implements ConfigurationPropertyModel
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classBasicConfigurationPropertyModel.DefaultRankedPropertyprotected classBasicConfigurationPropertyModel.InternalProperty<T>protected static interfaceBasicConfigurationPropertyModel.RankedProperty
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Map<java.lang.String,java.util.Set>resources-
Fields inherited from interface com.inductiveautomation.ignition.common.config.ConfigurationPropertyModel
EMPTY_MODEL
-
-
Constructor Summary
Constructors Modifier Constructor Description BasicConfigurationPropertyModel(long version)protectedBasicConfigurationPropertyModel(long version, java.util.Map<Property<?>,BasicConfigurationPropertyModel.InternalProperty> properties)Used for cloningBasicConfigurationPropertyModel(PropertySet propertySet)Creates a simple model off of the properties contained in the propertyset.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected intcompareRankedProperties(BasicConfigurationPropertyModel.RankedProperty a, BasicConfigurationPropertyModel.RankedProperty b)protected <T> voidconnectDependency(BasicConfigurationPropertyModel.InternalProperty<T> owner, T value, BasicConfigurationPropertyModel.InternalProperty<?> child)booleancontains(Property<?> property)Returns whether this property is contained in the model at all.java.util.Set<Property<?>>getAffectedProperties(Property<?> p)Called after editing the given property, this returns the props whose isRelevant/isEditable should be called.<T> java.util.Optional<java.util.Collection<T>>getAllowedValues(Property<T> p)If the range of allowed properties is restricted, this will return the valid values.java.util.List<Property<?>>getApplicableProperties(PropertySet config)Given the current config, returns the properties that should be displayed.longgetCurrentModelVersion()Returns the current model version, incremented when the model is changed.java.util.Set<Property<?>>getModelProperties()Returns properties that are in some way registered with the model.protected java.util.SetgetResourceValues(java.lang.String id)booleanisApplicable(PropertySet config, Property<?> property)Returns whether a property is relevant given the current configuration.booleanisCustomizable(Property<?> property)Returns whether a property that has allowed values defined also allows custom values.booleanisModelProperty(Property<?> property)Returns true if this is a property that is contained in the Model Properties.voidmergeTo(MutableConfigurationPropertyModel target)Takes the traits of this configuration prop model and puts them in the target model.protected <T> BasicConfigurationPropertyModel.InternalProperty<T>p(Property<T> prop)Property<?>resolve(java.lang.String id)Returns the property represented by the id, or null if the property cannot be found.
-
-
-
Constructor Detail
-
BasicConfigurationPropertyModel
public BasicConfigurationPropertyModel(long version)
-
BasicConfigurationPropertyModel
public BasicConfigurationPropertyModel(PropertySet propertySet)
Creates a simple model off of the properties contained in the propertyset.- Parameters:
propertySet- the collection of properties to register.
-
BasicConfigurationPropertyModel
protected BasicConfigurationPropertyModel(long version, java.util.Map<Property<?>,BasicConfigurationPropertyModel.InternalProperty> properties)Used for cloning
-
-
Method Detail
-
getCurrentModelVersion
public long getCurrentModelVersion()
Description copied from interface:ConfigurationPropertyModelReturns the current model version, incremented when the model is changed.- Specified by:
getCurrentModelVersionin interfaceConfigurationPropertyModel
-
p
protected <T> BasicConfigurationPropertyModel.InternalProperty<T> p(Property<T> prop)
-
getApplicableProperties
public java.util.List<Property<?>> getApplicableProperties(PropertySet config)
Description copied from interface:ConfigurationPropertyModelGiven the current config, returns the properties that should be displayed. There is no need to call isApplicable for each, as that would be true. The properties are returned in desired display order.- Specified by:
getApplicablePropertiesin interfaceConfigurationPropertyModel
-
isApplicable
public boolean isApplicable(PropertySet config, Property<?> property)
Description copied from interface:ConfigurationPropertyModelReturns whether a property is relevant given the current configuration.- Specified by:
isApplicablein interfaceConfigurationPropertyModel
-
getAffectedProperties
public java.util.Set<Property<?>> getAffectedProperties(Property<?> p)
Description copied from interface:ConfigurationPropertyModelCalled after editing the given property, this returns the props whose isRelevant/isEditable should be called. The result of those calls means that properties might be added or removed to the editable property list.- Specified by:
getAffectedPropertiesin interfaceConfigurationPropertyModel
-
getAllowedValues
public <T> java.util.Optional<java.util.Collection<T>> getAllowedValues(Property<T> p)
Description copied from interface:ConfigurationPropertyModelIf the range of allowed properties is restricted, this will return the valid values. Otherwise it will return Optional.empty, in which case the editor should be built based on the property type.- Specified by:
getAllowedValuesin interfaceConfigurationPropertyModel
-
resolve
public Property<?> resolve(java.lang.String id)
Description copied from interface:PropertyResolverReturns the property represented by the id, or null if the property cannot be found.- Specified by:
resolvein interfacePropertyResolver
-
contains
public boolean contains(Property<?> property)
Description copied from interface:ConfigurationPropertyModelReturns whether this property is contained in the model at all. Does not indicate whether it would be applicable to the current config or not.- Specified by:
containsin interfaceConfigurationPropertyModel
-
getModelProperties
public java.util.Set<Property<?>> getModelProperties()
Description copied from interface:ConfigurationPropertyModelReturns properties that are in some way registered with the model. Any property in a PropertySet that is not in this Set is a custom property.- Specified by:
getModelPropertiesin interfaceConfigurationPropertyModel
-
isModelProperty
public boolean isModelProperty(Property<?> property)
Description copied from interface:ConfigurationPropertyModelReturns true if this is a property that is contained in the Model Properties.- Specified by:
isModelPropertyin interfaceConfigurationPropertyModel
-
isCustomizable
public boolean isCustomizable(Property<?> property)
Description copied from interface:ConfigurationPropertyModelReturns whether a property that has allowed values defined also allows custom values.- Specified by:
isCustomizablein interfaceConfigurationPropertyModel
-
mergeTo
public void mergeTo(MutableConfigurationPropertyModel target)
Description copied from interface:ConfigurationPropertyModelTakes the traits of this configuration prop model and puts them in the target model.- Specified by:
mergeToin interfaceConfigurationPropertyModel
-
connectDependency
protected <T> void connectDependency(BasicConfigurationPropertyModel.InternalProperty<T> owner, T value, BasicConfigurationPropertyModel.InternalProperty<?> child)
-
getResourceValues
protected java.util.Set getResourceValues(java.lang.String id)
-
compareRankedProperties
protected int compareRankedProperties(BasicConfigurationPropertyModel.RankedProperty a, BasicConfigurationPropertyModel.RankedProperty b)
-
-