- 所有超接口:
-
AttributeSet,MutableAttributeSet
- 所有已知实现类:
-
StyleContext.NamedStyle
与文档中的元素关联的属性集合。由于这些通常用于将字符和段落样式与元素关联,因此提供了用于此目的的操作。与元素关联的其他自定义属性实际上是存在于层次结构中的名称-值对,如果在本地找不到名称(键),则将请求转发给父级。常用属性被分离出来以促进更高效的替代实现。
-
Nested Class Summary
Nested classes/interfaces declared in interface javax.swing.text.AttributeSet
AttributeSet.CharacterAttribute, AttributeSet.ColorAttribute, AttributeSet.FontAttribute, AttributeSet.ParagraphAttribute -
Field Summary
Fields declared in interface javax.swing.text.AttributeSet
NameAttribute, ResolveAttribute -
Method Summary
Modifier and TypeMethodDescriptionvoid添加一个监听器以跟踪属性何时已更改。getName()获取样式的名称。void移除正在跟踪属性更改的监听器。Methods declared in interface javax.swing.text.AttributeSet
containsAttribute, containsAttributes, copyAttributes, getAttribute, getAttributeCount, getAttributeNames, getResolveParent, isDefined, isEqualMethods declared in interface javax.swing.text.MutableAttributeSet
addAttribute, addAttributes, removeAttribute, removeAttributes, removeAttributes, setResolveParent
-
Method Details
-
getName
String getName()获取样式的名称。样式不需要被命名,因此如果样式没有关联的名称,则返回null。- 返回:
- 名称
-
addChangeListener
添加一个监听器以跟踪属性何时已更改。- 参数:
-
l- 更改监听器
-
removeChangeListener
移除正在跟踪属性更改的监听器。- 参数:
-
l- 更改监听器
-