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

起步
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">
    
  
 
 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值