}
@Override
protected PropertyMap createBindingsMap()
{
FlaggedPropertyMap bindings = new FlaggedPropertyMap()
{
@Override
public Object put(PropertyKey key, Object value)
{
if (value == null)
{
return remove(key);
}
else
{
Object o = super.put(key, value);
AttributeKey attrKey = getAttributeKey(key);
if (attrKey != null)
{
// If there's no local value, then we're not shadowing;
// set up a new ValueBindingBoundValue
if (getLocalProperty(key) == null)
{
ValueBinding binding = (ValueBinding) value;
_node.setAttributeValue(attrKey,
new ValueBindingBoundValue(binding));
}
}
return o;
}
}
public Object remove(PropertyKey key)
{
Object o = super.remove(key);
if (o == null)
return null;
AttributeKey attrKey = getAttributeKey(key);
if (attrKey != null)
{
// If there's no local value, then we're not shadowing,
// and the value is just null now
if (getLocalProperty(key) == null)
_node.setAttributeValue(attrKey, null);
}
return o;
}
};
bindings.setUseStateHolder(true);
return bindings;
}