起步
1)访问Eclipse插件源文件的方法
File > Import... > External Plug-ins and Fragments > 进入下一页接受默认选项
> 在第三页中" Add All " > Finish.
其中"Workspace set up with binary projects but linked contents"的意思是说:
PDE 在workspace中创建的plug-in projects , 只是一个引用链接而非拷贝.
2)Here's the first rule of Eclipse:
CONTRIBUTION RULE : Everything is a contribution.
3)关于Plug-In Development Environment(PDE)
host workbench:edit the plug-in
run-time workbench:run the plug-in under development
If you write to System.out from inside a plug-in under development, the text appears in the host workbench, not the run-time workbench.
4)Plug-In的基本结构
Declaration/Implementation 分离:
一个 plug-in 被表示成一个含有如下内容的目录
plugin.xml— The manifest, a description of the contributions of the plug-in
Resources, like icons
Java code, in a JAR (optional)
5)关于plugin.xml 一个ToolBar按钮的样例
<plugin
id="org.eclipse.contribution.hello" --"new Plug-in project"时输入的id号
name="org.eclipse.contribution.hello" --Plug-in的名称,随意
version="1.0.0">
--按钮集的描述 point指向eclipse的按钮集, point对应Eclipse中的某种元素.
<extension point="org.eclipse.ui.actionSets">
--按钮的一个集合
id="org.eclipse.contribution.hello.actionSet"
label="Hello Action Set">
--按钮按下时会被调用到的Action
id="org.eclipse.contribution.hello.HelloAction"
label="Hello"
--To appear as a button, each action has to be associated with a toolbar path,a hint to Eclipse .
toolbarPath="helloGroup"
--Create the class implementing the interface IWorkbenchWindowActionDelegate
class="org.eclipse.contribution.hello.HelloAction">