javax.swing.text
Interface AbstractDocument.AttributeContext

All Known Implementing Classes:
StyleContext sample code for javax.swing.text.StyleContext definition code for javax.swing.text.StyleContext , StyleSheet sample code for javax.swing.text.html.StyleSheet definition code for javax.swing.text.html.StyleSheet
Enclosing class:
AbstractDocument sample code for javax.swing.text.AbstractDocument definition code for javax.swing.text.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 method getAttributeContext should be implemented to return the object responsible for implementing the desired compression technique.

See Also:
StyleContext sample code for javax.swing.text.StyleContext definition code for javax.swing.text.StyleContext

Method Summary
 AttributeSet sample code for javax.swing.text.AttributeSet definition code for javax.swing.text.AttributeSet addAttribute sample code for javax.swing.text.AbstractDocument.AttributeContext.addAttribute(javax.swing.text.AttributeSet, java.lang.Object, java.lang.Object) definition code for javax.swing.text.AbstractDocument.AttributeContext.addAttribute(javax.swing.text.AttributeSet, java.lang.Object, java.lang.Object) (AttributeSet sample code for javax.swing.text.AttributeSet definition code for javax.swing.text.AttributeSet  old, Object sample code for java.lang.Object definition code for java.lang.Object  name, Object sample code for java.lang.Object definition code for java.lang.Object  value)
          Adds an attribute to the given set, and returns the new representative set.
 AttributeSet sample code for javax.swing.text.AttributeSet definition code for javax.swing.text.AttributeSet addAttributes sample code for javax.swing.text.AbstractDocument.AttributeContext.addAttributes(javax.swing.text.AttributeSet, javax.swing.text.AttributeSet) definition code for javax.swing.text.AbstractDocument.AttributeContext.addAttributes(javax.swing.text.AttributeSet, javax.swing.text.AttributeSet) (AttributeSet sample code for javax.swing.text.AttributeSet definition code for javax.swing.text.AttributeSet  old, AttributeSet sample code for javax.swing.text.AttributeSet definition code for javax.swing.text.AttributeSet  attr)
          Adds a set of attributes to the element.
 AttributeSet sample code for javax.swing.text.AttributeSet definition code for javax.swing.text.AttributeSet getEmptySet sample code for javax.swing.text.AbstractDocument.AttributeContext.getEmptySet() definition code for javax.swing.text.AbstractDocument.AttributeContext.getEmptySet() ()
          Fetches an empty AttributeSet.
 void reclaim sample code for javax.swing.text.AbstractDocument.AttributeContext.reclaim(javax.swing.text.AttributeSet) definition code for javax.swing.text.AbstractDocument.AttributeContext.reclaim(javax.swing.text.AttributeSet) (AttributeSet sample code for javax.swing.text.AttributeSet definition code for javax.swing.text.AttributeSet  a)
          Reclaims an attribute set.
 AttributeSet sample code for javax.swing.text.AttributeSet definition code for javax.swing.text.AttributeSet removeAttribute sample code for javax.swing.text.AbstractDocument.AttributeContext.removeAttribute(javax.swing.text.AttributeSet, java.lang.Object) definition code for javax.swing.text.AbstractDocument.AttributeContext.removeAttribute(javax.swing.text.AttributeSet, java.lang.Object) (AttributeSet sample code for javax.swing.text.AttributeSet definition code for javax.swing.text.AttributeSet  old, Object sample code for java.lang.Object definition code for java.lang.Object  name)
          Removes an attribute from the set.
 AttributeSet sample code for javax.swing.text.AttributeSet definition code for javax.swing.text.AttributeSet removeAttributes sample code for javax.swing.text.AbstractDocument.AttributeContext.removeAttributes(javax.swing.text.AttributeSet, javax.swing.text.AttributeSet) definition code for javax.swing.text.AbstractDocument.AttributeContext.removeAttributes(javax.swing.text.AttributeSet, javax.swing.text.AttributeSet) (AttributeSet sample code for javax.swing.text.AttributeSet definition code for javax.swing.text.AttributeSet  old, AttributeSet sample code for javax.swing.text.AttributeSet definition code for javax.swing.text.AttributeSet  attrs)
          Removes a set of attributes for the element.
 AttributeSet sample code for javax.swing.text.AttributeSet definition code for javax.swing.text.AttributeSet removeAttributes sample code for javax.swing.text.AbstractDocument.AttributeContext.removeAttributes(javax.swing.text.AttributeSet, java.util.Enumeration) definition code for javax.swing.text.AbstractDocument.AttributeContext.removeAttributes(javax.swing.text.AttributeSet, java.util.Enumeration) (AttributeSet sample code for javax.swing.text.AttributeSet definition code for javax.swing.text.AttributeSet  old, Enumeration sample code for java.util.Enumeration definition code for java.util.Enumeration <?> names)
          Removes a set of attributes for the element.
 

Method Detail

addAttribute sample code for javax.swing.text.AbstractDocument.AttributeContext.addAttribute(javax.swing.text.AttributeSet, java.lang.Object, java.lang.Object) definition code for javax.swing.text.AbstractDocument.AttributeContext.addAttribute(javax.swing.text.AttributeSet, java.lang.Object, java.lang.Object)

AttributeSet sample code for javax.swing.text.AttributeSet definition code for javax.swing.text.AttributeSet  addAttribute(AttributeSet sample code for javax.swing.text.AttributeSet definition code for javax.swing.text.AttributeSet  old,
                          Object sample code for java.lang.Object definition code for java.lang.Object  name,
                          Object sample code for java.lang.Object definition code for java.lang.Object  value)
Adds an attribute to the given set, and returns the new representative set.

Parameters:
old - the old attribute set
name - the non-null attribute name
value - the attribute value
Returns:
the updated attribute set
See Also:
MutableAttributeSet.addAttribute(java.lang.Object, java.lang.Object) sample code for javax.swing.text.MutableAttributeSet.addAttribute(java.lang.Object, java.lang.Object) definition code for javax.swing.text.MutableAttributeSet.addAttribute(java.lang.Object, java.lang.Object)

addAttributes sample code for javax.swing.text.AbstractDocument.AttributeContext.addAttributes(javax.swing.text.AttributeSet, javax.swing.text.AttributeSet) definition code for javax.swing.text.AbstractDocument.AttributeContext.addAttributes(javax.swing.text.AttributeSet, javax.swing.text.AttributeSet)

AttributeSet sample code for javax.swing.text.AttributeSet definition code for javax.swing.text.AttributeSet  addAttributes(AttributeSet sample code for javax.swing.text.AttributeSet definition code for javax.swing.text.AttributeSet  old,
                           AttributeSet sample code for javax.swing.text.AttributeSet definition code for javax.swing.text.AttributeSet  attr)
Adds a set of attributes to the element.

Parameters:
old - the old attribute set
attr - the attributes to add
Returns:
the updated attribute set
See Also:
MutableAttributeSet.addAttribute(java.lang.Object, java.lang.Object) sample code for javax.swing.text.MutableAttributeSet.addAttribute(java.lang.Object, java.lang.Object) definition code for javax.swing.text.MutableAttributeSet.addAttribute(java.lang.Object, java.lang.Object)

removeAttribute sample code for javax.swing.text.AbstractDocument.AttributeContext.removeAttribute(javax.swing.text.AttributeSet, java.lang.Object) definition code for javax.swing.text.AbstractDocument.AttributeContext.removeAttribute(javax.swing.text.AttributeSet, java.lang.Object)

AttributeSet sample code for javax.swing.text.AttributeSet definition code for javax.swing.text.AttributeSet  removeAttribute(AttributeSet sample code for javax.swing.text.AttributeSet definition code for javax.swing.text.AttributeSet  old,
                             Object sample code for java.lang.Object definition code for java.lang.Object  name)
Removes an attribute from the set.

Parameters:
old - the old attribute set
name - the non-null attribute name
Returns:
the updated attribute set
See Also:
MutableAttributeSet.removeAttribute(java.lang.Object) sample code for javax.swing.text.MutableAttributeSet.removeAttribute(java.lang.Object) definition code for javax.swing.text.MutableAttributeSet.removeAttribute(java.lang.Object)

removeAttributes sample code for javax.swing.text.AbstractDocument.AttributeContext.removeAttributes(javax.swing.text.AttributeSet, java.util.Enumeration<?>) definition code for javax.swing.text.AbstractDocument.AttributeContext.removeAttributes(javax.swing.text.AttributeSet, java.util.Enumeration<?>)

AttributeSet sample code for javax.swing.text.AttributeSet definition code for javax.swing.text.AttributeSet  removeAttributes(AttributeSet sample code for javax.swing.text.AttributeSet definition code for javax.swing.text.AttributeSet  old,
                              Enumeration sample code for java.util.Enumeration definition code for java.util.Enumeration <?> names)
Removes a set of attributes for the element.

Parameters:
old - the old attribute set
names - the attribute names
Returns:
the updated attribute set
See Also:
MutableAttributeSet.removeAttributes(java.util.Enumeration) sample code for javax.swing.text.MutableAttributeSet.removeAttributes(java.util.Enumeration) definition code for javax.swing.text.MutableAttributeSet.removeAttributes(java.util.Enumeration)

removeAttributes sample code for javax.swing.text.AbstractDocument.AttributeContext.removeAttributes(javax.swing.text.AttributeSet, javax.swing.text.AttributeSet) definition code for javax.swing.text.AbstractDocument.AttributeContext.removeAttributes(javax.swing.text.AttributeSet, javax.swing.text.AttributeSet)

AttributeSet sample code for javax.swing.text.AttributeSet definition code for javax.swing.text.AttributeSet  removeAttributes(AttributeSet sample code for javax.swing.text.AttributeSet definition code for javax.swing.text.AttributeSet  old,
                              AttributeSet sample code for javax.swing.text.AttributeSet definition code for javax.swing.text.AttributeSet  attrs)
Removes a set of attributes for the element.

Parameters:
old - the old attribute set
attrs - the attributes
Returns:
the updated attribute set
See Also:
MutableAttributeSet.removeAttributes(java.util.Enumeration) sample code for javax.swing.text.MutableAttributeSet.removeAttributes(java.util.Enumeration) definition code for javax.swing.text.MutableAttributeSet.removeAttributes(java.util.Enumeration)

getEmptySet sample code for javax.swing.text.AbstractDocument.AttributeContext.getEmptySet() definition code for javax.swing.text.AbstractDocument.AttributeContext.getEmptySet()

AttributeSet sample code for javax.swing.text.AttributeSet definition code for javax.swing.text.AttributeSet  getEmptySet()
Fetches an empty AttributeSet.

Returns:
the attribute set

reclaim sample code for javax.swing.text.AbstractDocument.AttributeContext.reclaim(javax.swing.text.AttributeSet) definition code for javax.swing.text.AbstractDocument.AttributeContext.reclaim(javax.swing.text.AttributeSet)

void reclaim(AttributeSet sample code for javax.swing.text.AttributeSet definition code for javax.swing.text.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