您的位置:首页 > 编程语言 > Java开发

Eclipse插件开发学习笔记 (一)

2004-07-08 18:44 696 查看
起步
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">
    
  
 
 
 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息