📄 course1.htm
字号:
<p>返回浏览器的名字(例如“Microsoft Internet Explorer”)。</p>
<p>DhBrowser.getAppVersion</p>
<p>检取浏览器的版本号。</p>
<p class="title_2">语法</p>
<p>public String getAppVersion ()</p>
<p class="title_2">返回值</p>
<p>返回浏览器的版本号(例如“4.0 (compatible;MSIE 4.01;Windows95”)。</p>
<p>DhBrowser.getBrowserLanguage</p>
<p>检取浏览器语言设置。</p>
<p class="title_2">语法</p>
<p>public String getBrowserLanguage ()</p>
<p class="title_2">返回值</p>
<p>返回包含浏览器语言的字符串。</p>
<p>DhBrowser.getCookieEnabled</p>
<p>确定浏览器中是否使能客户端小应用(cookie)。</p>
<p class="title_2">语法</p>
<p>public boolean getCookieEnabled ()</p>
<p class="title_2">返回值</p>
<p>如果使能,就返回true;否则,就返回false。</p>
<p>DhBrowser.getCpuClass</p>
<p>检取CPU类型字符串。</p>
<p class="title_2">语法</p>
<p>public String getCpuClass ()</p>
<p class="title_2">返回值</p>
<p>返回CPU的类型,比如“x86”,“Alpha”或“Other”。</p>
<p>DhBrowser.getOnLine</p>
<p>确定浏览器是否连到了网络上。</p>
<p class="title_2">语法</p>
<p>public boolean getOnLine ()</p>
<p class="title_2">返回值</p>
<p>如果该浏览器连到了网络上就返回true;否则,就返回false。</p>
<p>DhBrowser.getPeer</p>
<p>检取该类底层的对等对象。</p>
<p class="title_2">语法</p>
<p>public IUnknown getPeer ()</p>
<p class="title_2">返回值</p>
<p>返回DhBrowser对象底层的对等对象。</p>
<p class="title_2">说明</p>
<p>该方法实现了IOmNavigator界面。调用该方法需要很高的技巧。通常,你并不需要直接使用该方法。</p>
<p>DhBrowser.getPlatform</p>
<p>检取平台的设置。</p>
<p class="title_2">语法</p>
<p>public String getPlatform ()</p>
<p class="title_2">返回值</p>
<p>返回平台字符串(例如“Win32”)。</p>
<p>DhBrowser.getSystemLanguage</p>
<p>检取系统语言设置。</p>
<p class="title_2">语法</p>
<p>public String getSystemLanguage ()</p>
<p class="title_2">返回值</p>
<p>返回包含系统语言的字符串(例如“en-us”)。</p>
<p>DhBrowser.getUserAgent</p>
<p>检取HTTP用户代理信息头字符串。</p>
<p class="title_2">语法</p>
<p>public String getUserAgent ()</p>
<p class="title_2">返回值</p>
<p>返回用户代理信息头字符串(例如“Mozilla/4.0(compatible;MSIE4.01;Windows 95”)。</p>
<p>DhBrowser.getUserLanguage</p>
<p>检取用户语言设置。</p>
<p class="title_2">语法</p>
<p>public String getUserLanguage ()</p>
<p class="title_2">返回值</p>
<p>返回包含用户语言的字符串(例如“en-us”)。</p>
<hr><p class="title_1"><a name="DhBulletedList类">DhBulletedList类</a></p>
<p>实现了HTML中排序和未排序项目符号和数字列表。</p>
<pre>Component
|
+-- DhStyleBase
|
+-- DhElement
|
+-- DhBaseContainer
|
+-- DhBulletedList</pre>
<p>package com.ms.wfc.html</p>
<p>public class DhBulletedList</p>
<p>extends DhBaseContainer</p>
<p>implements DhStringIDs</p>
<p class="title_2">说明</p>
<p>这是一个简单的容器类,可以给其添加项目,每个项目都将相应地收到自己的符号或数字序号。</p>
<p class="title_2">构造器</p>
<p>DhBulletedList.DhBulletedList</p>
<p>创建一个DhBulletedList对象。</p>
<p class="title_2">语法</p>
<p>public DhBulletedList ()</p>
<p>public DhBulletedList ( int listType )</p>
<p class="title_2">参数</p>
<p>listType</p>
<p>列表类型,可以是DhListType中定义的一个常量。</p>
<p>异常</p>
<p>如果listType不是类常量之一,就产生WFCInvalidEnumException异常。</p>
<p class="title_2">说明</p>
<p>缺省构造器创建项目符号列表(DhListType.BULLETED)。</p>
<p class="title_2">方法</p>
<p>DhBulletedList.addItem</p>
<p>将指定的元件添加到列表的末尾。</p>
<p class="title_2">语法</p>
<p>public void addItem ( DhElement e )</p>
<p class="title_2">参数</p>
<p>e</p>
<p>要添加的元件。</p>
<p>DhBulletedList.getAllElements</p>
<p>反复检取所有的子元件和它们的子元件。</p>
<p class="title_2">语法</p>
<p>public DhElement[] getAllElements()</p>
<p class="title_2">返回值</p>
<p>返回所有子元件的矩阵。</p>
<p>DhBulletedList.getElementIndex</p>
<p>如果所选定的元件是列表的直接子元件,就检取它的索引。</p>
<p class="title_2">语法</p>
<p>public int getElementIndex ( DhElement e )</p>
<p class="title_2">参数</p>
<p>e</p>
<p>要检取其索引值的元件。</p>
<p class="title_2">返回值</p>
<p>返回该元件的零基索引值,如果列表中没有该元件,就返回-1。</p>
<p>DhBulletedList.getItem</p>
<p>检取指定索引位置处的元件。</p>
<p class="title_2">语法</p>
<p>public DhElement getItem ( int index )</p>
<p class="title_2">参数</p>
<p>index</p>
<p>要检取元件的索引。</p>
<p>异常</p>
<p>如果index不在列表中,就产生WFCInvalidArgumentException异常。</p>
<p>DhBulletedList.getItems</p>
<p>检取列表中元件的矩阵。</p>
<p class="title_2">语法</p>
<p>public DhElement[] getItems ()</p>
<p class="title_2">返回值</p>
<p>返回列表中元件的矩阵。</p>
<p>DhBulletedList.getListType</p>
<p>检取当前的列表类型。</p>
<p class="title_2">语法</p>
<p>public int getListType ()</p>
<p class="title_2">返回值</p>
<p>返回DhListType中提供的一个常量。</p>
<p>请参阅:setListType</p>
<p>DhBulletedList.insertItem</p>
<p>在指定的列表索引位置处插入一个元件。</p>
<p class="title_2">语法</p>
<p>public void insertItem ( DhElement newElement, int index )</p>
<p class="title_2">参数</p>
<p>newElement</p>
<p>要插入的新元件。</p>
<p>index</p>
<p>该元件放置位置的零基索引。</p>
<p class="title_2">说明</p>
<p>如果索引值比0小或比列表中的元件数量大,该元件就插入在列表的末尾。</p>
<p>请参阅:remove</p>
<p>DhBulletedList.remove</p>
<p>从列表中删除指定的元件。</p>
<p class="title_2">语法</p>
<p>public int remove ( DhElement e )</p>
<p class="title_2">参数</p>
<p>e</p>
<p>要删除的元件。</p>
<p class="title_2">返回值</p>
<p>返回被删除元件的索引值。如果没有找到该元件,就返回-1。</p>
<p>请参阅:removeAll</p>
<p>DhBulletedList.removeAll</p>
<p>从列表中删除所有的元件。</p>
<p class="title_2">语法</p>
<p>public void removeAll ()</p>
<p>DhBulletedList.removeItem</p>
<p>从列表指定的索引位置处删除元件。</p>
<p class="title_2">语法</p>
<p>public void removeItem ( int index )</p>
<p class="title_2">参数</p>
<p>index</p>
<p>要删除元件的索引。</p>
<p class="title_2">返回值</p>
<p>返回被删除元件的索引值。</p>
<p>DhBulletedList.setItem</p>
<p>设置或替换指定索引位置上的项。</p>
<p class="title_2">语法</p>
<p>public void setItem ( int index, DhElement e )</p>
<p class="title_2">参数</p>
<p>index</p>
<p>要设置项的索引。如果该索引值比0小或比列表长度大,该项就添加到列表的末尾。</p>
<p>e</p>
<p>要添加到列表中的元件。</p>
<p class="title_2">说明</p>
<p>如果列表中没有所指定的索引,该项就添加到列表中。</p>
<p>DhBulletedList.setItems</p>
<p>设置列表中所有的项。</p>
<p class="title_2">语法</p>
<p>public void setItems ( DhElement[] elements )</p>
<p class="title_2">参数</p>
<p>elements</p>
<p>列表中新项的DhElement矩阵。</p>
<p class="title_2">说明</p>
<p>替换列表目前所有的项。</p>
<p>DhBulletedList.setListType</p>
<p>设置当前的列表类型。</p>
<p class="title_2">语法</p>
<p>public void setListType ( int newType )</p>
<p class="title_2">参数</p>
<p>newType</p>
<p>需要的列表类型,是DhListType中提供的常量之一。</p>
<p>请参阅:getListType</p>
<hr><p class="title_1"><a name="DhButton类">DhButton类</a></p>
<p>实现了HTML按钮控件。</p>
<pre>DhButtonBase
|
+-- DhButton</pre>
<p>package com.ms.wfc.html</p>
<p>public class DhButton</p>
<p>extends DhButtonBase</p>
<p class="title_2">说明</p>
<p>HTTP表单的内部或外部都可以使用该控件。</p>
<p class="title_2">构造器</p>
<p>DhButton.DhButton</p>
<p>创建一个按钮。</p>
<p class="title_2">语法</p>
<p>public DhButton ()</p>
<p>public DhButton ( String strText )</p>
<p class="title_2">参数</p>
<p>strText</p>
<p>新按钮的标签。</p>
<p class="title_2">说明</p>
<p>缺省构造器创建的按钮带有缺省的文本标签“button”</p>
<p class="title_2">方法</p>
<p>DhButton.getEnabled</p>
<p>检取按钮的使能状态。</p>
<p class="title_2">语法</p>
<p>public boolean getEnabled ()</p>
<p class="title_2">返回值</p>
<p>如果按钮使能,就返回true;否则,就返回false。</p>
<p>请参阅:setEnabled</p>
<p>DhButton.getText</p>
<p>检取按钮的标签。</p>
<p class="title_2">语法</p>
<p>public String getText ()</p>
<p class="title_2">返回值</p>
<p>返回当前的标签字符串。</p>
<p>请参阅:setText</p>
<p>DhButton.setEnabled</p>
<p>设置按钮单位使能状态。</p>
<p class="title_2">语法</p>
<p>public void setEnabled ( boolean f )</p>
<p class="title_2">参数</p>
<p>f</p>
<p>要使能按钮,就设置为true;否则,就设置为false。</p>
<p>请参阅:getEnabled</p>
<p>DhButton.setText</p>
<p>设置按钮的文本标签。</p>
<p class="title_2">语法</p>
<p>public void setText ( String strText )</p>
<p class="title_2">参数</p>
<p>strText</p>
<p>新的标签。</p>
<p>请参阅:getText</p>
<hr><p class="title_1"><a name="DhCantAddElementException类">DhCantAddElementException类</a></p>
<p>指明对命名元件的请求失败,因为所指定的命名元件不存在。</p>
<pre>RunTimeException
|
+ -- WFCException
|
+-- DhCantAddElementException</pre>
<p>package com.ms.wfc.html</p>
<p>public class DhCantAddElementException</p>
<p>extends WFCException</p>
<p class="title_2">构造器</p>
<p>DhCantAddElementException.DhCantAddElementException</p>
<p>创建一个DhCantAddElementException对象。</p>
<p class="title_2">语法</p>
<p>public DhCantAddElementException ()</p>
<p>public DhCantAddElementException ( String s )</p>
<p class="title_2">参数</p>
<p>s</p>
<p>异常的详细消息。</p>
<p class="title_2">说明</p>
<p>缺省构造器创建的异常没有详细消息。</p>
<hr><p class="title_1"><a name="DhCantModifyElementException类">DhCantModifyElementException类</a></p>
<p>指明试图修改只读元件,比如从服务器发送给客户端的对象。</p>
<pre>RunTimeException
|
+-- WFCException
|
+-- DhCantModifyElementException</pre>
<p>package com.ms.wfc.html</p>
<p>public class DhCantModifyElementException</p>
<p>extends WFCException</p>
<p class="title_2">说明</p>
<p>只在服务器应用程序上才产生这类异常。当试图对同一个元件执行多次DhModule.write操作时就产生该异常。在第一次调用write后,元件就成为只读的。</p>
<p class="title_2">构造器</p>
<p>DhCantModifyElementException.DhCantModifyElementException</p>
<p>创建一个DhCantModifyElementException对象。</p>
<p class="title_2">语法</p>
<p>public DhCantModifyElementException ()</p>
<p>public DhCantModifyElementException ( String detail )</p>
<p class="title_2">参数</p>
<p>detail</p>
<p>异常的详细消息。</p>
<p class="title_2">说明</p>
<p>缺省构造器创建的异常没有详细消息。</p>
<hr><p class="title_1"><a name="DhCell类">DhCell类</a></p>
<p>创建一个table单元。</p>
<pre>Component
|
+-- DhStyleBase
|
+-- DhElement
|
+-- DhBaseContainer
|
+-- DhForm
|
+-- DhCell</pre>
<p>package com.ms.wfc.html</p>
<p>public class DhCell</p>
<p>extends DhForm</p>
<p class="title_2">说明</p>
<p>你可以使用add方法给单元添加任何布局类型的任何多个元件。</p>
<p class="title_2">构造器</p>
<p>DhCell.DhCell</p>
<p>创建空的单元。</p>
<p class="title_2">语法</p>
<p>public DhCell ()</p>
<p>public DhCell ( String text )</p>
<p class="title_2">参数</p>
<p>text</p>
<p>单元的文本内容。</p>
<p class="title_2">方法</p>
<p>DhCell.add</p>
<p>给单元增加一个元件。</p>
<p class="title_2">语法</p>
<p>public void add ( DhElement e )</p>
<p class="title_2">参数</p>
<p>e</p>
<p>要添加的DhElement 元件。</p>
<p>请参阅:remove</p>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -