eclipse插件开发-新增联机帮助

在eclipse中,用户可以通过Help-Help Contents菜单来打开联机帮助文档。帮助文档可以包含大量信息,对用户比较友好。

 

本文介绍如何扩展eclipse联机帮助的内容。

 

1. 老规矩,首先创建个空的插件工程,本例工程名:com.page.demo.help

2. 添加扩展点org.eclipse.help.toc,plugin.xml如下

<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
   <extension
         point="org.eclipse.help.toc">
      <toc file="toc.xml" primary="true" />
   </extension>

</plugin>

  该扩展点关联了toc.xml,primary="true"表示其为主节点

3. toc.xml内容如下

<?xml version="1.0" encoding="UTF-8"?>

<toc label="Page's User Guide">
    <topic label="Overview" href="html/overview.html" />
    <topic label="pageUserGuide" href="html/pageUserGuide.html" />
</toc>

  该xml分为两块,分别对应两个html

4. 两个html内容

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Overview</title>
</head>
<body>
    <p>This is overview</p>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Page's User Guide</title>
</head>
<body>
    <p>Hello! My friend. This is Page's User Guide</p>
</body>
</html>

5. 运行效果

 

 

 

源码:https://gitee.com/pageone/eclipse-plugin

 

posted @ 2022-03-08 15:54  到三国卖栗子  阅读(101)  评论(0编辑  收藏  举报