当前位置:首页>>今日新闻

用Eclipse开发iPhone Web 应用程序3

繁简对译:[]  字体设置:[] 2008-08-22  作者:Adam Houghton  来源:21IC 中国电子网  阅读  次

清单 2. 定制 textRow CSS 扩展以正确显示静态文本   /* Adding a new row CSS style to iUi for displaying blocks of text */ position: relative; border-bottom: 1px solid #999999; -webkit-border-radius: 0; text-align: right;   } text-align: left; margin: 5px 8px 5px 10px; padding: 0px 0px 0px 0px;   }   fieldset > .textRow:last-child { border-bottom: none !important;   }   清单 3 显示了 java.math.BigDecimal 的一种构造方法的详细信息页面。   清单 3. 使用 textRow 元素的 HTML 详细信息页面   

public BigDecimal(long, MathContext)

Translates a long into a BigDecimal, with rounding according to the context settings. The scale of the BigDecimal, before any rounding, is zero.

Parameters

long val : long value to be converted to BigDecimal.

MathContext mc : the context to use.

Throws

ArithmeticException : if the result is inexact but the rounding mode is UNNECESSARY.

  
  
标记内的所有内容都位于圆角矩形内,textRow
用于分隔行。带有

标记的标题显示为列表上方的组标签。图 10 显示了最终页面。 图 10. java.math.BigDecimal 中的构造函数的详细视图   拥有三个导航级别和目标详细信息页面后,UI 就完成了。iDoc 使用户可以专注于具体任务。借助 iUi 框架和一些定制的 CSS,它看上去很像本机 iPhone 应用程序。   开发 iDoc   现在已经设计了 UI,接下来需要编写代码来生成 HTML 文件。创建一个插入到 Sun 的 javadoc 命令中的简单 doclet。我们的示例将使用标准 java.* 包,但是 iDoc 可以从任何源代码生成 Javadoc。使用 OpenJDK 源代码,因为它可以公开获得并且 GNU Public License (GPL) V2 许可证允许我们生成和发布其 Javadoc。   使用 iDoc,只需迭代包和类并调用方法打印上述格式的静态 HTML 页面。清单 4 显示打印目标详细信息页面的方法。

打印 收藏 关闭