Class BasicTagEditController<T extends PropertySet>
- java.lang.Object
-
- com.inductiveautomation.ignition.designer.sqltags.config.adapters.BasicTagEditController<T>
-
- All Implemented Interfaces:
Countable
,Extendable<PropertySet>
,Mergable<PropertySet>
,MutablePropertyValueSource
,PropertySet
,PropertySetEdit
,PropertyValueSource
,TagEditController<T>
,java.io.Serializable
,java.lang.Iterable<PropertyValue>
public class BasicTagEditController<T extends PropertySet> extends java.lang.Object implements TagEditController<T>
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface com.inductiveautomation.ignition.common.config.PropertySet
EMPTY
-
-
Constructor Summary
Constructors Constructor Description BasicTagEditController(DesignerContext context, T target, boolean intersection, boolean inherited, TagProviderMeta provMeta, Flags tagEditingFlags, TagPath relativePath, boolean isNew)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
boolean
contains(Property<?> prop)
protected void
fireChange(Property<?> property)
protected void
fireChange(java.lang.String propName)
<T> T
get(Property<T> prop)
Retrieves the value of the property, or null if this set doesn't contain that property.DataType[]
getAllowedDataTypes()
DesignerContext
getContext()
int
getCount()
Flags
getEditingFlags()
Flags that provide information about tag editing, such as which features are supported.TagEditResources
getEditResources(boolean forceRefresh)
java.lang.String[]
getExpandibles()
Returns that values for the current edit context that can be referenced for property expansion.<T> T
getOrDefault(Property<T> prop)
<T> T
getOrElse(Property<T> prop, T value)
Get the value for a givenProperty
, or else fall back to value if it's not present.TagPath
getPath()
The path to use for relative referencing.java.util.Collection<Property<?>>
getProperties()
TagProviderMeta
getProviderMeta()
Deprecated.java.lang.String
getSourceName()
T
getTarget()
ExtendedTagType
getType()
java.util.List<PropertyValue>
getValues()
Returns the opaque PropertyValue objects.boolean
isExtended(Property<?> prop)
Returns whether this property set contains a value for the prop, and the prop was actually inherited.boolean
isInherited()
Returns whether the edit object extends from a different object.boolean
isInherited(Property<?> prop)
Indicates whether the property was inherited from a parent type.boolean
isModified(Property<?> property)
boolean
isMulti()
boolean
isNewTag()
java.util.Iterator<PropertyValue>
iterator()
void
merge(PropertySet other, boolean localOnly)
Merges the values from other collection into this one.void
remove(Property<?> prop)
void
removePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
void
revert(Property<?> prop)
<T> void
set(Property<T> prop, T value)
void
set(PropertyValue propValue)
void
setEditable(boolean value)
If false, edits will be ignored.void
setExpandables(java.lang.String[] values)
-
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.PropertySet
extend, getExtension, newDefaultInstance, newExtension
-
Methods inherited from interface com.inductiveautomation.ignition.common.config.PropertyValueSource
getNonNull, getNonNull
-
-
-
-
Constructor Detail
-
BasicTagEditController
public BasicTagEditController(DesignerContext context, T target, boolean intersection, boolean inherited, TagProviderMeta provMeta, Flags tagEditingFlags, TagPath relativePath, boolean isNew)
-
-
Method Detail
-
getContext
public DesignerContext getContext()
- Specified by:
getContext
in interfaceTagEditController<T extends PropertySet>
-
getEditResources
public TagEditResources getEditResources(boolean forceRefresh)
- Specified by:
getEditResources
in interfaceTagEditController<T extends PropertySet>
-
setEditable
public void setEditable(boolean value)
Description copied from interface:TagEditController
If false, edits will be ignored. This is mostly useful during initialization of UIs to prevent unexpected edits.- Specified by:
setEditable
in interfaceTagEditController<T extends PropertySet>
-
getTarget
public T getTarget()
- Specified by:
getTarget
in interfaceTagEditController<T extends PropertySet>
-
getType
public ExtendedTagType getType()
- Specified by:
getType
in interfaceTagEditController<T extends PropertySet>
-
getExpandibles
public java.lang.String[] getExpandibles()
Description copied from interface:TagEditController
Returns that values for the current edit context that can be referenced for property expansion. If expansion is not available for the tag, should return null.- Specified by:
getExpandibles
in interfaceTagEditController<T extends PropertySet>
-
setExpandables
public void setExpandables(java.lang.String[] values)
-
getAllowedDataTypes
public DataType[] getAllowedDataTypes()
- Specified by:
getAllowedDataTypes
in interfaceTagEditController<T extends PropertySet>
-
isNewTag
public boolean isNewTag()
- Specified by:
isNewTag
in interfaceTagEditController<T extends PropertySet>
-
isMulti
public boolean isMulti()
- Specified by:
isMulti
in interfaceTagEditController<T extends PropertySet>
-
isInherited
public boolean isInherited()
Description copied from interface:TagEditController
Returns whether the edit object extends from a different object. In other words, should override controls be shown?- Specified by:
isInherited
in interfaceTagEditController<T extends PropertySet>
-
getEditingFlags
public Flags getEditingFlags()
Description copied from interface:TagEditController
Flags that provide information about tag editing, such as which features are supported. The values are defined inTagEditingFlags
- Specified by:
getEditingFlags
in interfaceTagEditController<T extends PropertySet>
-
getPath
public TagPath getPath()
Description copied from interface:TagEditController
The path to use for relative referencing.- Specified by:
getPath
in interfaceTagEditController<T extends PropertySet>
-
getSourceName
public java.lang.String getSourceName()
- Specified by:
getSourceName
in interfaceTagEditController<T extends PropertySet>
-
getProviderMeta
@Deprecated public TagProviderMeta getProviderMeta()
Deprecated.- Specified by:
getProviderMeta
in interfaceTagEditController<T extends PropertySet>
-
set
public <T> void set(Property<T> prop, T value)
- Specified by:
set
in interfaceMutablePropertyValueSource
-
set
public void set(PropertyValue propValue)
- Specified by:
set
in interfaceMutablePropertyValueSource
-
remove
public void remove(Property<?> prop)
- Specified by:
remove
in interfaceMutablePropertyValueSource
-
revert
public void revert(Property<?> prop)
- Specified by:
revert
in interfacePropertySetEdit
-
merge
public void merge(PropertySet other, boolean localOnly)
Description copied from interface:Mergable
Merges the values from other collection into this one. Replaces any currently existing value with those from the other set.- Specified by:
merge
in interfaceMergable<T extends PropertySet>
- Specified by:
merge
in interfaceMutablePropertyValueSource
-
addPropertyChangeListener
public void addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
- Specified by:
addPropertyChangeListener
in interfaceTagEditController<T extends PropertySet>
-
removePropertyChangeListener
public void removePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
- Specified by:
removePropertyChangeListener
in interfaceTagEditController<T extends PropertySet>
-
fireChange
protected void fireChange(Property<?> property)
-
fireChange
protected void fireChange(java.lang.String propName)
-
isModified
public boolean isModified(Property<?> property)
- Specified by:
isModified
in interfacePropertySetEdit
-
getProperties
public java.util.Collection<Property<?>> getProperties()
- Specified by:
getProperties
in interfacePropertyValueSource
-
get
public <T> T get(Property<T> prop)
Description copied from interface:PropertyValueSource
Retrieves the value of the property, or null if this set doesn't contain that property.- Specified by:
get
in interfacePropertyValueSource
-
contains
public boolean contains(Property<?> prop)
- Specified by:
contains
in interfacePropertyValueSource
- Returns:
- True if the source contains a value for prop.
-
getOrDefault
public <T> T getOrDefault(Property<T> prop)
- Specified by:
getOrDefault
in interfacePropertyValueSource
- Returns:
- The value for prop or
Property.getDefaultValue()
if not present. Can return null if the value is null.
-
getOrElse
public <T> T getOrElse(Property<T> prop, T value)
Description copied from interface:PropertyValueSource
Get the value for a givenProperty
, or else fall back to value if it's not present.- Specified by:
getOrElse
in interfacePropertyValueSource
- Parameters:
prop
- TheProperty
for which a value is to be retrieved.value
- The value to default to if property isn't present.- Returns:
- The value of property if present, value if not. Can return null if the value is null.
-
isExtended
public boolean isExtended(Property<?> prop)
Description copied from interface:PropertySet
Returns whether this property set contains a value for the prop, and the prop was actually inherited. In other words, this is true if the property is inherited, and an override value is present.- Specified by:
isExtended
in interfacePropertySet
-
isInherited
public boolean isInherited(Property<?> prop)
Description copied from interface:PropertySet
Indicates whether the property was inherited from a parent type.- Specified by:
isInherited
in interfacePropertySet
-
getValues
public java.util.List<PropertyValue> getValues()
Description copied from interface:PropertyValueSource
Returns the opaque PropertyValue objects. This can be useful when you want to avoid the strict type checking of the value, and it's important to note that if the property is bound, the value will be a BoundValue. Be very careful about overriding, and make sure to maintain the methodology of using getProperties to iterate and get (or getOrDefault), to get the value, because those are all handled differently by BoundPropertySets, ExtendedPropertySets, etc.- Specified by:
getValues
in interfacePropertyValueSource
-
iterator
public java.util.Iterator<PropertyValue> iterator()
- Specified by:
iterator
in interfacejava.lang.Iterable<T extends PropertySet>
-
-