-
- All Known Implementing Classes:
- StyleContext, StyleSheet
- Enclosing class:
- AbstractDocument
public static interface AbstractDocument.AttributeContext
An interface that can be used to allow MutableAttributeSet implementations to use pluggable attribute compression techniques. Each mutation of the attribute set can be used to exchange a previous AttributeSet instance with another, preserving the possibility of the AttributeSet remaining immutable. An implementation is provided by the StyleContext class. The Element implementations provided by this class use this interface to provide their MutableAttributeSet implementations, so that different AttributeSet compression techniques can be employed. The methodgetAttributeContext
should be implemented to return the object responsible for implementing the desired compression technique.- See Also:
StyleContext
-
-
Method Summary
Methods Modifier and Type Method and Description AttributeSet
addAttribute(AttributeSet old, Object name, Object value)
Adds an attribute to the given set, and returns the new representative set.AttributeSet
addAttributes(AttributeSet old, AttributeSet attr)
Adds a set of attributes to the element.AttributeSet
getEmptySet()
Fetches an empty AttributeSet.void
reclaim(AttributeSet a)
Reclaims an attribute set.AttributeSet
removeAttribute(AttributeSet old, Object name)
Removes an attribute from the set.AttributeSet
removeAttributes(AttributeSet old, AttributeSet attrs)
Removes a set of attributes for the element.AttributeSet
removeAttributes(AttributeSet old, Enumeration<?> names)
Removes a set of attributes for the element.
-
-
-
Method Detail
-
addAttribute
AttributeSet addAttribute(AttributeSet old, Object name, Object value)
Adds an attribute to the given set, and returns the new representative set.- Parameters:
old
- the old attribute setname
- the non-null attribute namevalue
- the attribute value- Returns:
- the updated attribute set
- See Also:
MutableAttributeSet.addAttribute(java.lang.Object, java.lang.Object)
-
addAttributes
AttributeSet addAttributes(AttributeSet old, AttributeSet attr)
Adds a set of attributes to the element.- Parameters:
old
- the old attribute setattr
- the attributes to add- Returns:
- the updated attribute set
- See Also:
MutableAttributeSet.addAttribute(java.lang.Object, java.lang.Object)
-
removeAttribute
AttributeSet removeAttribute(AttributeSet old, Object name)
Removes an attribute from the set.- Parameters:
old
- the old attribute setname
- the non-null attribute name- Returns:
- the updated attribute set
- See Also:
MutableAttributeSet.removeAttribute(java.lang.Object)
-
removeAttributes
AttributeSet removeAttributes(AttributeSet old, Enumeration<?> names)
Removes a set of attributes for the element.- Parameters:
old
- the old attribute setnames
- the attribute names- Returns:
- the updated attribute set
- See Also:
MutableAttributeSet.removeAttributes(java.util.Enumeration<?>)
-
removeAttributes
AttributeSet removeAttributes(AttributeSet old, AttributeSet attrs)
Removes a set of attributes for the element.- Parameters:
old
- the old attribute setattrs
- the attributes- Returns:
- the updated attribute set
- See Also:
MutableAttributeSet.removeAttributes(java.util.Enumeration<?>)
-
getEmptySet
AttributeSet getEmptySet()
Fetches an empty AttributeSet.- Returns:
- the attribute set
-
reclaim
void reclaim(AttributeSet a)
Reclaims an attribute set. This is a way for a MutableAttributeSet to mark that it no longer need a particular immutable set. This is only necessary in 1.1 where there are no weak references. A 1.1 implementation would call this in its finalize method.- Parameters:
a
- the attribute set to reclaim
-
-
Document created the 11/06/2005, last modified the 04/03/2020
Source of the printed document:https://www.gaudry.be/en/java-api-rf-javax/swing/text/abstractdocument.attributecontext.html
The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.
References
These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author This site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.