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

博客围绕Eclipse插件弹出菜单展开,介绍了开发方法,可通过查看现有文件中定义好的extension points寻找相似plug - in,还给出了plug - in.xml的示例代码,说明了鼠标选中特定元素时菜单显示规则,此外提到了插件国际化,可通过替换plugin.properties文件改变语言。

弹出菜单 Pop-up Menus
1)MONKEY SEE/MONKEY DO RULE
 Always start by copying the structure of a similar plug-in.
 寻找相似的plug-in的方法
   通过查看现有文件中已经定义好的 extension points.
   Since the popupMenus extension point is defined by the org.eclipse.ui plug-in we open its plugin.xml file in   the manifest editor. On the Extension Points tab of the manifest editor we can see the extension points   defined in this plug-in and (more to our purpose here) where they are used.
   
2)关于plug-in.xml

<extension point="org.eclipse.ui.popupMenus">
  <objectContribution
    id="org.eclipse.contribution.junit.runtest"
    --当鼠标作选中的元素为“Type (classes and interfaces)”类型的时候才在popupMenus显示“Run Test”
    objectClass="org.eclipse.jdt.core.IType">
    <action
      id="org.eclipse.contribution.junit.runtest.action"
      label="Run Test"
      --鼠标只选中一个"Type"元素的时候才显示“Run Test”
      enablesFor="1"
      class="org.eclipse.compare.internal.AddFromHistoryAction">
    </action>
  </objectContribution>
</extension>

3)国际化
  Labels beginning with "%" will be used as a key into plugin.properties file. Replacing this file allows you to change the language of the plug-in .

 

绝版的书,貌似淘宝还能找到。原来只有页码,边看边加的目录,有一半花了一晚上添加的目录,方便看了。 《Eclipse插件开发》由浅入深、有重点、有针对性地介绍了Eclipse插件开发技术,全书分为4篇共24章。第一篇介绍Eclipse平台界面开发的基础知识,包括SWT控件的使用、界面布局、事件处理等内容;第篇是插件开发核心技术,主要介绍插件开发的核心知识要点,包括行为(Action)、视图(ViewPart)、编辑器(Editor)、透视图(Perspective)等10章的内容;第三篇主要讲述插件开发的高级内容,包括开发高级内容、富客户端平台技术(RCP)、Draw2d,以及GEF介绍与实现等4个章节;第四篇则围绕插件开发和GEF应用两个主题,精心设计了两个程序开发实例,使读者能更加全面地理解插件开发相关技术。 目录: 第一篇 开发基础 第1章 Eclipse平台简介 1.1 Eclipse集成开发环境(IDE)介绍 1.1.1 安装及使用Eclipse IDE 1.1.2 为Eclipse IDE安装中文语言包 1.1.3 IDE的环境设置 1.1.4 使用帮助系统 1.2 什么是Eclipse 1.3 SWT/JFace技术 1.4 插件技术和OSGi 1.5 RCP技术 1.6 EMF技术 1.7 GEF技术 1.8 本章小结 第2章 SWT/JFace概述 第3章 SWT编程基础 第4章 使用基本控件与对话框 第5章 容器与布局管理器 第6章 界面开发工具 第7章 高级控件使用 第8章 SWT/Jface的事件处理 第篇 核心技术 第9章 Eclipse插件体系结构 第10章 开发 第一个插件项目 第11章 操作(Actions) 第12章 视图(Views) 第13章 编辑器(Editors) 第14章 透视图(Perspectives) 第15章 对话框和向导(DialogsWizards) 第16章 首选项(Preferences) 第17章 帮助内容(Help Contents) 第18章 备忘单(CheatSheet) 第三篇 高级进阶 第19章 插件开发高级内容 第20章 富客户端平台(RCP)技术 第21章 Draw2d 第22章 GEF介绍与实现 第四篇 综合实例 第23章 插件开发实例 第24章 GEF实例
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值