private Object createTextDecoration(final AttributeSet old,
final Object key, final Object value) {
if (value instanceof String) {
return Attribute.TEXT_DECORATION.getConverter().toCSS(value);
}
TextDecoration oldValue =
(TextDecoration)old.getAttribute(Attribute.TEXT_DECORATION);
TextDecoration result = oldValue == null
? new TextDecoration()
: (TextDecoration)oldValue.clone();
if (key == StyleConstants.Underline) {
result.setUnderline(((Boolean)value).booleanValue());
}
if (key == StyleConstants.StrikeThrough) {
result.setLineThrough(((Boolean)value).booleanValue());
}
return result;
}