学无止境  
日历
<2005年8月>
31123456
78910111213
14151617181920
21222324252627
28293031123
45678910
统计
  • 随笔 - 9
  • 文章 - 0
  • 评论 - 2
  • 引用 - 0

导航

常用链接

留言簿(2)

随笔分类

随笔档案

搜索

  •  

最新评论

阅读排行榜

评论排行榜

 
In this section I want to show the steps to define your own documentation plug-in to integrate your online documentation with Eclipse.
1. Create the help content as HTML files and store them in your plug-in directory. Normally we use doc in the name. If there are too many files, you can creat a ZIP file named doc.zip.
2. Decliare the HELP Table of Contents in your plug-in using the org.eclipse.help.toc extension point and specify the table of content files.

Example:
<extension point = "org.eclipse.help.toc">
    <toc     file ="DialogTOC.xml"/>
    <toc     file ="MoreTOC.xml"/>
    <toc     file ="TestTOC.xml"
                primary = "true"
                extradir = "lab">   
    </toc>
</extension>

The table of the contents will be described by one or more XML files. In this example, TestTOC.xml is the primary table of contents file, which describes the structure and order of the other files by linking them together.

Example: TestTOC.xml
<?xml version="1.0" encoding="UTF-8"?>
<?NLS TYPE="org.eclipse.help.toc"?>
<toc label="JDG2E: Help Example TOC">
    <link toc="DialogTOC.xml" />
    <anchor id="moreLabs" />
</toc>

3. Create the table of contents files by linking the topic together.

Example: MoreTOC.xml
<?xml version="1.0" encoding="UTF-8"?>
<?NLS TYPE="org.eclipse.help.toc"?>
<toc link_to="TestToc.xml#moreLabs"
  label="More interesting labs">
  <topic label="JDT Main Topic"  href="html/maintopic.html">
     <topic label="JDT Sub Topic" href="html/subtopic.html"/>
  </topic>
  <topic label="Extra Topic"  href="lab/doc1/info1.html">
    <topic label="Using the extradir attrib" href="lab/doc2/info2.html"/>
  </topic>
</toc>

In addition, you can invove the Eclipse Help system form any Java program indenpendent from Eclipse. This is called "standalone" mode. To do that, you simply use the Platform Runtime Binary version of Eclipse as opposed to the SDK and inovke the main methode in the class org.eclipse.help.internal.standalone.StandaloneHelp. Of course you should pass the location of the plugins directory,which includes the online contents, as a paramter.

(The example used is taken from the book "The JavaTM Developer's Guide to Eclipse".)
posted on 2005-08-29 21:28 lucia 阅读(384) 评论(0)  编辑  收藏 所属分类: Eclipse Plugin

只有注册用户登录后才能发表评论。


网站导航:
 
 
Copyright © lucia Powered by: 博客园 模板提供:沪江博客