Eclipse 4 插件开发实战指南

需积分: 10 18 下载量 100 浏览量 更新于2024-07-21 收藏 6.99MB PDF 举报
"Eclipse 4 Plug-in Development by Example Beginner's Guide" 本书《Eclipse 4 Plug-in Development by Example Beginner's Guide》由Dr. Alex Blewitt撰写,旨在引导初学者进行Eclipse插件的开发、构建、测试、打包和发布。这本书涵盖了针对Eclipse 3.x和Eclipse 4.x平台的插件开发技术。 在Eclipse 4.x版本中,Eclipse引入了全新的插件系统和用户界面框架,这使得开发插件的方式与之前的版本有所不同。Eclipse 4.x的主要变化包括: 1. **RCP(Rich Client Platform)重构**:Eclipse 4.x对RCP进行了重大的架构调整,引入了组件化的设计,允许开发者更灵活地创建和组合UI元素。 2. **声明式服务(Declarative Services,DS)**:替代了传统的插件激活策略,DS允许开发者以XML方式声明服务及其依赖关系,简化了服务管理。 3. **新UI框架(e4)**:Eclipse 4.x引入了新的UI模型,基于MVC(Model-View-Controller)设计,使用EMF(Eclipse Modeling Framework)来定义模型,JSF(JavaServer Faces)类似的方式来定义视图,以及控制器层来处理用户交互。 4. **动态加载**:Eclipse 4.x支持动态加载和卸载插件,提高了系统的响应速度和灵活性。 通过这本书,读者将学习到如何: - **创建基本的Eclipse插件项目**:了解如何设置开发环境,创建新的Eclipse插件项目,并添加必要的元数据。 - **编写插件代码**:掌握如何编写扩展点,实现自定义功能,包括菜单、工具栏、透视图、视图等。 - **使用声明式服务**:学习如何声明服务,以及如何在插件之间共享和使用这些服务。 - **测试插件**:理解如何在Eclipse环境中调试和测试插件,确保其正确运行。 - **打包和部署**:学习如何将插件打包成可安装的更新站点或独立的RCP应用程序,以便分发给其他用户。 - **兼容性处理**:由于Eclipse 4.x与3.x有较大差异,书中还会讲解如何使插件同时兼容这两个版本的Eclipse。 在学习过程中,读者会接触到Eclipse插件开发的相关工具,如PDE(Plugin Development Environment),它是Eclipse集成开发环境的一部分,用于支持插件和RCP应用的开发。 此外,书中的示例代码和实践指导将帮助读者加深对Eclipse插件开发的理解,从而能够创建出高效、可维护的插件,丰富Eclipse的功能。 请注意,尽管出版商和作者已尽力确保书中信息的准确性,但因技术发展迅速,书中内容可能存在过时情况。因此,读者在实际开发中,还需要参考最新的Eclipse文档和社区资源,以获取最准确的技术信息。
2014-01-01 上传
How to develop, build, test, package, and release Eclipse plug-ins with features for Eclipse 3.x and Eclipse 4.x Overview Create plug-ins to extend the Eclipse runtime covering Eclipse 3.x and the changes required for Eclipse 4.x Plug-ins from design to distribution — wide coverage of the entire process No prior OSGi or Eclipse plug-in development experience necessary In Detail As a highly extensible platform, Eclipse is used by everyone from independent software developers to NASA. Key to this is Eclipse’s plug-in ecosystem, which allows applications to be developed in a modular architecture and extended through its use of plug-ins and features. "Eclipse Plugin Development by Example: Beginner's Guide" takes the reader through the full journey of plug-in development, starting with an introduction to Eclipse plug-ins, continued through packaging and culminating in automated testing and deployment. The example code provides simple snippets which can be developed and extended to get you going quickly. This book covers basics of plug-in development, creating user interfaces with both SWT and JFace, and interacting with the user and execution of long-running tasks in the background. Example-based tasks such as creating and working with preferences and advanced tasks such as well as working with Eclipse’s files and resources. A specific chapter on the differences between Eclipse 3.x and Eclipse 4.x presents a detailed view of the changes needed by applications and plug-ins upgrading to the new model. Finally, the book concludes on how to package plug-ins into update sites, and build and test them automatically. What you will learn from this book How to create plug-ins for Eclipse 3.x and 4.x and automatically test plug-ins with JUnit How to display tree and table information in views What are the specific differences between the Eclipse 3.x model and the Eclipse 4.x model How and when to build user interfaces from SWT and JFace How to run tasks in the background and update the user interface asynchronously How to build plug-ins, features and update sites with Maven Tycho and automate user interface tests with SWTBot How to store and obtain preferences, and how to integrate with the Preferences panel How to work with the Eclipse resources model for creating and updating files and reporting errors to the user Approach A Beginner's Guide following the "by Example" approach. There will be 5-8 major examples that will be used in the book to develop advanced plugins with the Eclipse IDE. Who this book is written for This book is for Java developers who are familiar with Eclipse as a Java IDE and are interested in learning how to develop plug-ins for Eclipse. No prior knowledge of Eclipse plug-in development or OSGi is necessary, although you are expected to know how to create, run, and debug Java programs in Eclipse. Product Details Paperback: 348 pages Publisher: Packt Publishing (June 20, 2013) Language: English ISBN-10: 1782160329 ISBN-13: 978-1782160328