public static interface AbstractDocument.AttributeContext
Documents.
Replicating AttributeSets throughout a Document can
be very expensive. Implementations of this interface are intended to
provide intelligent management of AttributeSets, eliminating
costly duplication.StyleContext| Modifier and Type | Method and Description |
|---|---|
AttributeSet |
addAttribute(AttributeSet old,
Object name,
Object value)
Returns an
AttributeSet that contains the attributes
of old plus the new attribute specified by
name and value. |
AttributeSet |
addAttributes(AttributeSet old,
AttributeSet attributes)
|
AttributeSet |
getEmptySet()
Returns an empty
AttributeSet. |
void |
reclaim(AttributeSet attributes)
Called to indicate that the attributes in
attributes are
no longer used. |
AttributeSet |
removeAttribute(AttributeSet old,
Object name)
|
AttributeSet |
removeAttributes(AttributeSet old,
AttributeSet attributes)
Removes all attributes in
attributes from old
and returns the resulting AttributeSet. |
AttributeSet |
removeAttributes(AttributeSet old,
Enumeration<?> names)
Removes all attributes specified by
names from
old and returns the resulting AttributeSet. |
AttributeSet addAttribute(AttributeSet old, Object name, Object value)
AttributeSet that contains the attributes
of old plus the new attribute specified by
name and value.old - the attribute set to be merged with the new attributename - the name of the attribute to be addedvalue - the value of the attribute to be addedAttributeSet addAttributes(AttributeSet old, AttributeSet attributes)
old - the set of attributes where to add the new attributesattributes - the attributes to be addedAttributeSet that contains the attributes
of old plus the new attributes in
attributesAttributeSet getEmptySet()
AttributeSet.AttributeSetvoid reclaim(AttributeSet attributes)
attributes are
no longer used.attributes - the attributes are no longer usedAttributeSet removeAttribute(AttributeSet old, Object name)
old - the attribute set from which an attribute is removedname - the name of the attribute to be removedold minus the attribute
specified by nameAttributeSet removeAttributes(AttributeSet old, AttributeSet attributes)
attributes from old
and returns the resulting AttributeSet.old - the set of attributes from which to remove attributesattributes - the attributes to be removed from oldold minus the attributes in
attributesAttributeSet removeAttributes(AttributeSet old, Enumeration<?> names)
names from
old and returns the resulting AttributeSet.old - the set of attributes from which to remove attributesnames - the names of the attributes to be removed from
oldold minus the attributes in
attributes