Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 1.421 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
1.421
Dung lượng
19,81 MB
Nội dung
Eclipse: Building Commercial-Quality Plug-ins, Second Edition By Eric Clayberg, Dan Rubel Publisher: Addison Wesley Professional Pub Date: March 22, 2006 Print ISBN-10: 0-321-42672-X Print ISBN-13: 978-0-321-42672-7 Pages: 864 Table of Contents | Index "I'm often asked, 'What are the best books about Eclipse?' Number one on my list, every time, is Eclipse: Building Commercial-Quality Plug-ins I find it to be the clearest and most relevant book about Eclipse for the real-world software developer Other Eclipse books focus on the internal Eclipse architecture or on repeating the Eclipse documentation, whereas this book is laser focused on the issues and concepts that matter when you're trying to build a product." Bjorn Freeman-Benson Director, Open Source Process, Eclipse Foundation "As the title suggests, this massive tome is intended as a guide to best practices for writing Eclipse plug-ins I think in that respect it succeeds handily Before you even think about distributing a plug-in you've written, read this book." Ernest Friedman-Hill Sheriff, JavaRanch.com "Eclipse: Building Commercial-Quality Plug-ins was an invaluable training aid for all of our team members In fact, training our team without the use of this book as a base would have been virtually impossible It is now required reading for all our developers and helped us deliver a brand-new, very complex product on time and on budget thanks to the great job this book does of explaining the process of building plug-ins for Eclipse." Bruce Gruenbaum "This is easily one of the most useful books I own If you are new to developing Eclipse plug-ins, it is a 'must-have' that will save you lots of time and effort You will find lots of good advice in here, especially things that will help add a whole layer of professionalism and completeness to any plug-in The book is very focused, well-structured, thorough, clearly written, and doesn't contain a single page of 'waffly page filler.' The diagrams explaining the relationships between the different components and manifest sections are excellent and aid in understanding how everything fits together This book goes well beyond Actions, Views, and Editors, and I think everyone will benefit from the authors' experience I certainly have." Tony Saveski "The authors of this seminal book have decades of proven experience with the most productive and robust software engineering technologies ever developed Their experiences have now been well applied to the use of Eclipse for more effective Java development A must-have for any serious software engineering professional!" Ed Klimas "Just wanted to also let you know this is an excellent book! Thanks for putting forth the effort to create a book that is easy to read and technical at the same time!" Brooke Hedrick "The key to developing great plug-ins for Eclipse is understanding where and how to extend the IDE, and that's what this book gives you It is a must for serious plug-in developers, especially those building commercial applications I wouldn't be without it." -Brian Wilkerson "If you're looking for just one Eclipse plug-in development book that will be your guide, this is the one While there are other books available on Eclipse, few dive as deep as Eclipse: Building Commercial-Quality Plug-ins." Simon Archer Eclipse has established itself as a dominant force in the application-development space Key to the success of Eclipse is the ability of developers to extend its functionality using plug-ins This new edition of Eclipse: Building Commercial-Quality Plug-ins is the definitive, start-tofinish guide to building commercial-quality Eclipse plug-ins, with an emphasis on adding the sophistication and polish that paying customers demand The book provides both a quick introduction to using Eclipse for new users and a reference for experienced Eclipse users wishing to expand their knowledge and improve the quality of their Eclipse-based products Revised to take advantage of pure Eclipse 3.1 and 3.2 APIs, this widely praised bestseller presents detailed, practical coverage of every aspect of plug-in development and specific solutions for the challenges developers are most likely to encounter All code examples, relevant API listings, diagrams, and screen captures have been updated Some Eclipse concepts such as actions, views, and editors have not changed radically, but now have additional functionality and capabilities Other areas, such as the Eclipse plug-in infrastructure, have changed drastically due to the Eclipse shift towards an OSGibased infrastructure This edition is fully updated to address these new advances for Eclipse developers Includes a quick introduction to Eclipse for experienced Java programmers Serves as a systematic reference for experienced Eclipse users Introduces all the tools you need to build Eclipse and Rational plug-ins Explains the Eclipse architecture and the structure of plug-ins and extension points Offers practical guidance on building Eclipse user interfaces with SWT and JFace Shows how to use change tracking, perspectives, builders, markers, natures, and more Covers internationalization, help systems, features, and branding This book is designed for anyone who wants a deep understanding of Eclipse, and every experienced developer interested in extending Eclipse or the Rational Software Development Platform Eclipse: Building Commercial-Quality Plug-ins, Second Edition By Eric Clayberg, Dan Rubel Publisher: Addison Wesley Professional Pub Date: March 22, 2006 Print ISBN-10: 0-321-42672-X Print ISBN-13: 978-0-321-42672-7 Pages: 864 Table of Contents | Index Copyright Praise for Eclipse: Building Commercial-Quality Plug-ins The Eclipse Series Foreword Foreword Preface Chapter 1 Using Eclipse Tools Section 1.1 Getting Started Section 1.2 The Eclipse Workbench Section 1.3 Setting Up Your Environment Section 1.4 Creating a Project Section 1.5 Navigating Section 1.6 Searching Section 1.7 Writing Code Section 1.8 Team Development Using CVS Section 1.9 Running Applications Section 1.10 Introduction to Debugging Section 1.11 Introduction to Testing Section 1.12 Summary Chapter 2 A Simple Plug-in Example Section 2.1 The Favorites Plug-in Section 2.2 Creating a Plug-in Project Section 2.3 Reviewing the Generated Code Section 2.4 Building a Product Section 2.5 Installing and Running the Product Section 2.6 Debugging the Product Section 2.7 PDE Views Section 2.8 Writing Plug-in Tests Section 2.9 Summary Chapter 3 Eclipse Infrastructure Section 3.1 Structural Overview Section 3.2 Plug-in Directory or JAR file Section 3.3 Plug-in Manifest Section 3.4 Plug-in Class Section 3.5 Plug-in Model Section 3.6 Logging Section 3.7 Eclipse Plug-ins Section 3.8 Summary Chapter 4 The Standard Widget Toolkit Section 4.1 SWT History and Goals Section 4.2 SWT Widgets Section 4.3 Layout Management Section 4.4 Resource Management Section 4.5 Summary Chapter 5 JFace Viewers Section 5.1 List-Oriented Viewers Section 5.1.1 Label providers Section 5.1.2 Content providers Section 5.1.3 Viewer sorters Section 5.1.4 Viewer filters Section 5.1.5 StructuredViewer class Section 5.1.6 ListViewer class Section 5.1.7 TableViewer class Section 5.1.8 TreeViewer class Section 5.2 Text Viewers Section 5.3 Summary Chapter 6 Actions Section 6.1 IAction versus IActionDelegate Section 6.2 Workbench Window Actions Section 6.3 Object Actions Section 6.4 View Actions Section 6.5 Editor Actions Section 6.6 Key Bindings Section 6.7 RFRS Considerations Section 6.8 Summary Chapter 7 Views Section 7.1 View Declaration Section 7.2 View Part Section 7.3 View Actions Section 7.4 Linking the View Section 7.5 Saving View State Section 7.6 Testing Section 7.7 Image Caching Section 7.8 Auto-sizing Table Columns Section 7.9 RFRS Considerations Section 7.10 Summary Chapter 8 Editors Section 8.1 Editor Declaration Section 8.2 Editor Part Section 8.3 Editing Section 8.4 Editor Lifecycle Section 8.5 Editor Actions Section 8.6 Linking the Editor Section 8.7 RFRS Considerations Section 8.8 Summary Chapter 9 Resource Change Tracking Section 9.1 IResourceChangeListener Section 9.2 Processing Change Events Section 9.3 Batching Change Events Section 9.4 Progress Monitor Section 9.5 Delayed Changed Events Section 9.6 Summary Chapter 10 Perspectives Section 10.1 Creating a Perspective Section 10.2 Enhancing an Existing Perspective Section 10.3 RFRS Considerations Section 10.4 Summary Chapter 11 Dialogs and Wizards Section 11.1 Dialogs Section 11.2 Wizards Section 11.3 RFRS Considerations Section 11.4 Summary Chapter 12 Preference Pages Section 12.1 Creating a Preference Page Section 12.2 Preference Page APIs Section 12.3 Preference APIs Section 12.4 RFRS Considerations Section 12.5 Summary Chapter 13 Properties Section 13.1 Creating Properties Section 13.2 Displaying Properties in the Properties Dialog Section 13.3 Displaying Properties in the Properties View Section 13.4 Property Pages Reused as Preference Pages Section 13.5 RFRS Considerations Section 13.6 Summary Chapter 14 Builders, Markers, and Natures Section 14.1 Builders Section 14.2 Markers Section 14.3 Natures Section 14.4 RFRS Considerations Section 14.5 Summary Chapter 15 Implementing Help Section 15.1 Using Help Section 15.2 Implementing Help Section 15.3 Context-Sensitive Help (F1) Section 15.4 Accessing Help Programmatically Section 15.5 Cheat Sheets Section 15.6 RFRS Considerations Section 15.7 Summary Chapter 16 Internationalization Section 16.1 Externalizing the Plug-in Manifest Section 16.2 Externalizing Plug-in Strings Section 16.3 Using Fragments Section 16.4 Summary Chapter 17 Creating New Extension Points Section 17.1 The Extension Point Mechanism Section 17.2 Defining an Extension Point Section 17.3 Code Behind an Extension Point Section 17.4 Extension Point Documentation Section 17.5 Using the Extension Point Section 17.6 RFRS Considerations Section 17.7 Summary Chapter 18 Features, Branding, and Updates Section 18.1 Feature Projects Section 18.2 Branding Section 18.3 Update Sites Section 18.4 RFRS Considerations Section 18.5 Summary Chapter 19 Building a Product Section 19.1 A Brief Introduction to Ant Section 19.2 Building the Favorites Product Section 19.3 Summary Chapter 20 Advanced Topics Section 20.1 Advanced SearchReference Projects Section 20.2 Accessing Internal Code Section 20.3 Adapters Section 20.4 Opening a Browser or Creating an Email Section 20.5 Types Specified in an Extension Point Section 20.6 Modifying Eclipse to Find Part Identifiers Section 20.7 Label Decorators Section 20.8 Background TasksJobs API Section 20.9 Plug-in ClassLoaders Section 20.10 Early Startup Section 20.11 Rich Client Platform Section 20.12 Conclusion Appendix A Eclipse Plug-ins and Resources Section A.1 Plug-ins Section A.2 Resources Appendix B Ready for Rational Software Trademarks Index Copyright Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks Where those designations appear in this book, and the publisher was aware of a trademark claim, the designations have been printed with initial capital letters or in all capitals The authors and publisher have taken care in the preparation of this book, but make no expressed or implied warranty of any kind and assume no responsibility for errors or omissions No liability is assumed for incidental or consequential damages in connection with or arising out of the use of the information or programs contained herein The publisher offers excellent discounts on this book when ordered in quantity for bulk purchases or special sales, which may include electronic versions and/or custom covers and content particular to your business, training goals, marketing focus, and branding interests For more information, please contact: U.S Corporate and Government Sales (800) 382-3419 corpsales@pearsontechgroup.com For sales outside the United States please contact: International Sales international@pearsoned.com Visit us on the Web: www.awprofessional.com This Book Is Safari Enabled The Safari® Enabled icon on the cover of your favorite technology book means the book is available through Safari Bookshelf When you buy this book, you get free access to the online edition for 45 days Safari Bookshelf is an electronic reference library that lets you easily search thousands of technical books, find code samples, download chapters, and access technical information whenever and wherever you need it To gain 45-day Safari Enabled access to this book: Go to http://www.awprofessional.com/safarienabled Complete the brief registration form Enter the coupon code CBIN-7SNH-GN25-UVHZ-SLX7 If you have difficulty registering on Safari Bookshelf or accessing the online edition, please e-mail customerservice@safaribooksonline.com Library of Congress Cataloging-in-Publication Data Clayberg, Eric Eclipse : building commercial-quality plugins / Eric Clayberg, Dan Rubel. 2nd ed p cm Includes bibliographical references and index ISBN 0-321-42672-X (pbk : alk paper) Computer software-Development Java (Computer program language) I Rubel, Dan II Ti QA76.76.D47C574 2006 005.1 dc22 2006004362 Index [SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Z] VA Assist 2nd VAME Variables view Verify event VerifyEvent VerifyKeyListener VerifyListener verifyText version feature plugin 2nd Version checking Version Synchronization dialog View createPartControl identifier selection provider site view category 2nd class 2nd icon 2nd id 2nd 3rd name 2nd relationship relative visible VIEW_ID ViewContentProvider viewContribution class icon id targeted toolbarPath tooltip Viewer viewerContribution extension id targetID ViewerFilter class 2nd 3rd extends subclasses Viewers CheckboxTableViewer CheckboxTreeViewer content providers filters label providers list example list-oriented ListViewers overview sorters StructuredViewer TableViewer example TableViewers text TextViewer example TextViewer subclasses TreeViewer example TreeViewers ViewerSorter class 2nd 3rd 4th extends subclasses ViewFilter ViewLabelProvider ViewPart class 2nd classes Views action actions active view Ant attributes Bookmarks Breakpoints category Console 2nd 3rd 4th 5th 6th content provider context menu createPartControl CVS Repositories 2nd Debug 2nd declaration detached direct edit Display 2nd dispose editors vs views Error Log 2nd Expressions 2nd fast views Favorites filter flicker global actions Hierarchy init inline edit introduction IViewActionDelegate 2nd Java Package JUnit keyboard label provider linking Members 2nd 3rd Memory menu Navigator 2nd 3rd 4th 5th 6th 7th 8th 9th New Search 2nd obtaining progress monitor opening opening an editor Outline 2nd 3rd 4th Package Explorer 2nd 3rd 4th Packages 2nd part PDE views Plug-in Plug-in Dependency Plug-in Registry Plug-ins Problems 2nd 3rd 4th 5th 6th 7th Progress Projects 2nd Properties 2nd 3rd 4th 5th reference Registers repositioning resizing RFRS saveState 2nd saving local information saving state selection selection listener selection provider 2nd setFocus show Show View sorting Tasks 2nd 3rd testing Threads and Monitor toolbar Type Hierarchy Types 2nd Variables 2nd viewerContribution Welcome viewShortcut ViolationResolutionGenerator visibility id targetID visible actionSet view VisualAge for Java IDE 2nd 3rd 4th 5th layout manager origins VisualAge Micro Edition VisualAge Smalltalk VisualWorks VM arguments Index [SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Z] waitForJobs 2nd 3rd Watch command Web Browser preferences Web delivery web directory Web page, opening programmatically Web resources location field Web Resources options WebBrowserEditor Welcome view Widget class 2nd classes events widgetDefaultSelected Widgets constructors disposal Hierarchy Layout lifecycle Resource Management style bits SWT UI Thread widgetSelected 2nd 3rd 4th 5th 6th 7th 8th Window CANCEL OK Window > Customize Perspective 2nd 3rd Window > Open Perspective > Debug command Window > Open Perspective > Java Browsing Window > Open Perspective > Java command Window > Open Perspective > Other command Window > Open Perspective command Window > Preferences command Window > Reset Perspective command Window > Show View > Other command 2nd 3rd Window > Show View command 2nd Window menu items Open Perspective Show View WindowBuilder Pro 2nd 3rd windowImages Windows registry Wizard class extends wizard class 2nd icon id 2nd name 2nd WizardDialog 2nd 3rd 4th WizardPage 2nd Wizards API buttons class hierarchy content content area Default Plug-in Project described dialog settings error message example example page Export extension points Externalize Strings Extract Strings Feature Updates help IExportWizard IImportWizard INewWizard 2nd IWizard IWizardContainer IWizardPage Java Class Java Package Wizard Java Project JUnit TestCase launching look and feel manually launching message nested New Extension 2nd 3rd 4th 5th 6th 7th New Extension Point New Fragment Project New Plug-in Project New Project 2nd 3rd 4th new project switches perspective open new file in editor page content based on prior page Plug-in project progress monitor Reference Projects RFRS setErrorMessage setHelpAvailable setMessage setNeedsProgressMonitor setVisible show new object warning message WizardDialog WizardSelectionPage Workbench CVS CVS label decorators File Extension Associations layout customization local history navigating obtaining progress monitor overview page preferences progress service refactoring Runtime status bar templates writing code Workbench window actions menu workbench.xml file WorkbenchAdapter WorkbenchHelp WorkbenchHelpSystem30 WorkbenchLabelProvider 2nd WorkbenchPart 2nd WorkbenchPartLabelProvider worked 2nd 3rd Working set name field Working set scope Working Sets defined New Working Set dialog Select Working Sets dialog Workspace addSaveParticipant administration defined launch configuration plug-ins metadata 2nd 3rd modify operation scope Workspace preferences 2nd WorkspaceModifyOperation class 2nd extends Writing Code Index [SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Z] XDoclet Support XML IMemento reading and writing XMLBuddy 2nd XMLMemento XMLRootElementContentDescriber XP-like pair programming Index [SYMBOL] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Z] ZIP file ... Key to the success of Eclipse is the ability of developers to extend its functionality using plug-ins This new edition of Eclipse: Building Commercial- Quality Plug-ins is the definitive, start-tofinish guide to building commercial- quality Eclipse plug-ins, with an emphasis on adding... involved in building commercial- quality extensions for the Eclipse and the IBM Software Development Platform (SDP)IBM's commercial version of Eclipsedevelopment environments To us, "commercial- quality" is synonymous with "commercial- grade"... Copyright Praise for Eclipse: Building Commercial- Quality Plug-ins The Eclipse Series Foreword Foreword Preface Chapter 1 Using Eclipse Tools Section 1.1 Getting Started Section 1.2 The Eclipse Workbench