- 所有超级接口:
-
AttributeSet
- 所有已知子接口:
-
Style
- 所有已知实现类:
-
AbstractDocument.AbstractElement,AbstractDocument.BranchElement,AbstractDocument.LeafElement,DefaultStyledDocument.SectionElement,HTMLDocument.BlockElement,HTMLDocument.RunElement,SimpleAttributeSet,StyleContext.NamedStyle
一个可变的唯一属性集的通用接口。实现类可能需要提供以下形式的构造函数:
public XXXAttributeSet(ConstAttributeSet source);
-
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 TypeMethodDescriptionvoidaddAttribute(Object name, Object value) 创建一个类似于此属性集的新属性集,但包含具有给定名称和值的属性。voidaddAttributes(AttributeSet attributes) 创建一个类似于此属性集的新属性集,但包含给定的属性和值。voidremoveAttribute(Object name) 移除具有给定name的属性。voidremoveAttributes(Enumeration<?> names) 移除具有给定names的属性集。voidremoveAttributes(AttributeSet attributes) 移除具有给定name的一组属性。voidsetResolveParent(AttributeSet parent) 设置解析父级。Methods declared in interface javax.swing.text.AttributeSet
containsAttribute, containsAttributes, copyAttributes, getAttribute, getAttributeCount, getAttributeNames, getResolveParent, isDefined, isEqual
-
Method Details
-
addAttribute
创建一个类似于此属性集的新属性集,但包含具有给定名称和值的属性。对象必须是不可变的,或者不被任何客户端改变。- 参数:
-
name- 名称 -
value- 值
-
addAttributes
创建一个类似于此属性集的新属性集,但包含给定的属性和值。- 参数:
-
attributes- 属性集
-
removeAttribute
移除具有给定name的属性。- 参数:
-
name- 属性名称
-
removeAttributes
移除具有给定names的属性集。- 参数:
-
names- 名称集合
-
removeAttributes
移除具有给定name的一组属性。- 参数:
-
attributes- 属性集
-
setResolveParent
设置解析父级。这是要通过的属性集,如果本地未定义属性,则要解析的属性集。- 参数:
-
parent- 父级
-