JavaTM 2 Platform
Standard Ed. 6

javax.swing.text
接口 Style

所有超级接口:
AttributeSet, MutableAttributeSet
所有已知实现类:
StyleContext.NamedStyle

public interface Style
extends MutableAttributeSet

与文档中某个元素相关的属性集合。因为这些通常用于字符和段落样式与元素之间的关联,所以就提供了这方面的操作。取得与元素关联的其他自定义属性将有效地成为层次结构中的名称-值对,并且如果没有在本地找到名称(键),则会把请求转发给父级。常用的属性被分离了出来,以便采用更有效的替代实现。


嵌套类摘要
 
从接口 javax.swing.text.AttributeSet 继承的嵌套类/接口
AttributeSet.CharacterAttribute, AttributeSet.ColorAttribute, AttributeSet.FontAttribute, AttributeSet.ParagraphAttribute
 
字段摘要
 
从接口 javax.swing.text.AttributeSet 继承的字段
NameAttribute, ResolveAttribute
 
方法摘要
 void addChangeListener(ChangeListener l)
          添加一个侦听器,以便随时跟踪属性的更改。
 String getName()
          获取样式名称。
 void removeChangeListener(ChangeListener l)
          移除跟踪属性更改的侦听器。
 
从接口 javax.swing.text.MutableAttributeSet 继承的方法
addAttribute, addAttributes, removeAttribute, removeAttributes, removeAttributes, setResolveParent
 
从接口 javax.swing.text.AttributeSet 继承的方法
containsAttribute, containsAttributes, copyAttributes, getAttribute, getAttributeCount, getAttributeNames, getResolveParent, isDefined, isEqual
 

方法详细信息

getName

String getName()
获取样式名称。不要求命名样式,因此如果没有与此样式相关的名称,则返回 null

返回:
名称

addChangeListener

void addChangeListener(ChangeListener l)
添加一个侦听器,以便随时跟踪属性的更改。

参数:
l - 更改侦听器

removeChangeListener

void removeChangeListener(ChangeListener l)
移除跟踪属性更改的侦听器。

参数:
l - 更改侦听器

JavaTM 2 Platform
Standard Ed. 6

提交错误或意见

版权所有 2008 Sun Microsystems, Inc. 保留所有权利。请遵守GNU General Public License, version 2 only