public static interface AbstractDocument.AttributeContext
Document
s.
Replicating AttributeSet
s throughout a Document
can
be very expensive. Implementations of this interface are intended to
provide intelligent management of AttributeSet
s, 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
attributes
AttributeSet getEmptySet()
AttributeSet
.AttributeSet
void 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 name
AttributeSet 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 old
old
minus the attributes in
attributes
AttributeSet 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
old
old
minus the attributes in
attributes