文档介绍:Eclipse插件开发系列--nature:
很久没有写插件开发的体会了.
网上很多的插件开发的文档,但是大多数都是插件XML介绍,还有就是hello ,..
哎,看了好几本这样的书,真的是浪费时间了.
项目的nature
如果有插件要创建项目,或者是在已有项目上增加JAVA特性, 里填加nature
.
<?xml version="" encoding="UTF-8"?>
<projectDescription>
<name>tomcatplugin</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<mand>
<.</name>
<arguments>
</arguments>
</mand>
<mand>
<.</name>
<arguments>
</arguments>
</mand>
<mand>
<.</name>
<arguments>
</arguments>
</mand>
</buildSpec>
<natures>
<.</nature>
<.</nature>
</natures>
</projectDescription>
其实,这就是一个XML文件,如果说拿着XML文件读入,然后,在nature里加点内容,其实也不难..,他完全不能按常理出牌..
不然的话,eclipse插件开发,..
但是这个文档里面的结构还是相当的有用.
因为…..
IProject proj = ();
这个就是获得了当前的Project.
IProjectDescription description = ();
这个就是上面文件里的<projectDescription> 了….至少这里是XML文件,还是eclipse项目的特性,然后写入文件,
的Jar里.
String[] prevNatures= ();
这个一看就知道是获得了
<natures>
<.</nature>
<.</nature>
</natures>
这一段了..
那么,就可以提供一个完整的函数.
public static void addNatur