- 所有父级接口:
AttributeSet
- 所有已知的子接口:
Style
- 所有已知的实现类:
AbstractDocument.AbstractElement,AbstractDocument.BranchElement,AbstractDocument.LeafElement,DefaultStyledDocument.SectionElement,HTMLDocument.BlockElement,HTMLDocument.RunElement,SimpleAttributeSet,StyleContext.NamedStyle
唯一属性的可变集合的通用接口。实现可能希望提供以下形式的构造函数:
public XXXAttributeSet(ConstAttributeSet source);
-
内部类总结
在接口 javax.swing.text.AttributeSet 中声明的嵌套类/接口
AttributeSet.CharacterAttribute, AttributeSet.ColorAttribute, AttributeSet.FontAttribute, AttributeSet.ParagraphAttribute -
字段摘要
在接口 javax.swing.text.AttributeSet 中声明的字段
NameAttribute, ResolveAttribute -
方法总结
修饰符和类型方法描述voidaddAttribute(Object name, Object value) 创建一个与此类似的新属性集,不同之处在于它包含具有给定名称和值的属性。voidaddAttributes(AttributeSet attributes) 创建一个与此类似的新属性集,不同之处在于它包含给定的属性和值。voidremoveAttribute(Object name) 删除具有给定name的属性。voidremoveAttributes(Enumeration<?> names) 删除具有给定names的属性集。voidremoveAttributes(AttributeSet attributes) 删除一组具有给定name的属性。voidsetResolveParent(AttributeSet parent) 设置解析父级。在接口 javax.swing.text.AttributeSet 中声明的方法
containsAttribute, containsAttributes, copyAttributes, getAttribute, getAttributeCount, getAttributeNames, getResolveParent, isDefined, isEqual
-
方法详情
-
addAttribute
创建一个与此类似的新属性集,不同之处在于它包含具有给定名称和值的属性。该对象必须是不可变的,或者不会被任何客户端改变。- 参数:
name- 名字value- 值
-
addAttributes
创建一个与此类似的新属性集,不同之处在于它包含给定的属性和值。- 参数:
attributes- 属性集
-
removeAttribute
删除具有给定name的属性。- 参数:
name- 属性名称
-
removeAttributes
删除具有给定names的属性集。- 参数:
names- 名称集
-
removeAttributes
删除一组具有给定name的属性。- 参数:
attributes- 属性集
-
setResolveParent
设置解析父级。如果未在本地定义属性,则这是要解析的属性集。- 参数:
parent- 父母
-