- 所有已知的实现类:
StyleContext,StyleSheet
- 封闭类:
AbstractDocument
public static interface AbstractDocument.AttributeContext
可用于允许 MutableAttributeSet 实现使用可插入属性压缩技术的接口。属性集的每个变异都可用于将先前的 AttributeSet 实例与另一个交换,从而保留 AttributeSet 保持不变的可能性。 StyleContext 类提供了一个实现。此类提供的 Element 实现使用此接口提供其 MutableAttributeSet 实现,以便可以采用不同的 AttributeSet 压缩技术。应实施方法
getAttributeContext 以返回负责实施所需压缩技术的对象。
- 参见:
-
方法总结
修饰符和类型方法描述addAttribute(AttributeSet old, Object name, Object value) 向给定集合添加一个属性,并返回新的代表集合。addAttributes(AttributeSet old, AttributeSet attr) 向元素添加一组属性。获取一个空的 AttributeSet。void回收属性集。removeAttribute(AttributeSet old, Object name) 从集合中移除一个属性。removeAttributes(AttributeSet old, Enumeration<?> names) 删除元素的一组属性。removeAttributes(AttributeSet old, AttributeSet attrs) 删除元素的一组属性。
-
方法详情
-
addAttribute
向给定集合添加一个属性,并返回新的代表集合。- 参数:
old- 旧属性集name- 非空属性名称value- 属性值- 返回:
- 更新后的属性集
- 参见:
-
addAttributes
向元素添加一组属性。- 参数:
old- 旧属性集attr- 要添加的属性- 返回:
- 更新后的属性集
- 参见:
-
removeAttribute
从集合中移除一个属性。- 参数:
old- 旧属性集name- 非空属性名称- 返回:
- 更新后的属性集
- 参见:
-
removeAttributes
删除元素的一组属性。- 参数:
old- 旧属性集names- 属性名称- 返回:
- 更新后的属性集
- 参见:
-
removeAttributes
删除元素的一组属性。- 参数:
old- 旧属性集attrs- 属性- 返回:
- 更新后的属性集
- 参见:
-
getEmptySet
AttributeSet getEmptySet()获取一个空的 AttributeSet。- 返回:
- 属性集
-
reclaim
回收属性集。这是 MutableAttributeSet 标记它不再需要特定不可变集的一种方式。这仅在没有弱引用的 1.1 中是必需的。 1.1 实现将在其 finalize 方法中调用它。- 参数:
a- 要回收的属性集
-