JavaTM 2 Platform
Standard Ed. 6

javax.swing.text.html
类 CSS

java.lang.Object
  继承者 javax.swing.text.html.CSS
所有已实现的接口:
Serializable

public class CSS
extends Object
implements Serializable

CSS attributes 集定义为类型安全的枚举。HTML View 实现使用 CSS 属性来确定其呈现的方式。它还定义了 CSS/HTML/StyleConstant 之间的映射方法。任何 shorthand 属性(例如 font)都将被映射为 intrinsic 属性。

以下描述了呈现引擎所支持的 CSS 属性:

以下是已建模的属性,但当前未呈现。

注:目前我们尚未完全支持相对单元(除非另行说明),因此 p { margin-top:10% } 将被视为没有指定 margin-top(顶部空白)。

另请参见:
StyleSheet

嵌套类摘要
static class CSS.Attribute
          用作 AttributeSet 的键的定义,此属性集可存储 CSS 属性。
 
构造方法摘要
CSS()
           
 
方法摘要
static CSS.Attribute[] getAllAttributeKeys()
          返回所有可能的 CSS 属性键集合。
static CSS.Attribute getAttribute(String name)
          将字符串转换为 CSS.Attribute 对象。
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

CSS

public CSS()
方法详细信息

getAllAttributeKeys

public static CSS.Attribute[] getAllAttributeKeys()
返回所有可能的 CSS 属性键集合。


getAttribute

public static final CSS.Attribute getAttribute(String name)
将字符串转换为 CSS.Attribute 对象。如果给定名称没有属性,这将返回 null

参数:
name - 要获取类型安全枚举的 CSS 属性名称
返回:
返回 CSS.Attribute 对象,如果字符串不表示有效的属性键,则返回 null

JavaTM 2 Platform
Standard Ed. 6

提交错误或意见
有关更多的 API 参考资料和开发人员文档,请参阅 Java 2 SDK SE 开发人员文档。该文档包含更详细的、面向开发人员的描述,以及总体概述、术语定义、使用技巧和工作代码示例。

版权所有 2004 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。另请参阅文档重新分发政策