The Eclipse Graphical Editor Framework (GEF)
Dan Rubel
Jaime Wren
Eric Clayberg
Upper Saddle River, NJ Boston Indianapolis San Francisco
New York Toronto Montreal London Munich Paris Madrid
Capetown Sydney Tokyo Singapore Mexico City
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
For sales outside the United States please contact:
International Sales
Visit us on the Web: informit.com/aw
Library of Congress Cataloging-in-Publication Data
Rubel, Dan.
The Eclipse Graphical Editor Framework (GEF) / Dan Rubel, Jaime Wren, Eric Clayberg.
p. cm.
Includes bibliographical references and index.
ISBN 0-321-71838-0 (pbk. : alk. paper)
1. Graphical user interfaces (Computer systems) 2. Graphic methods-Computer programs. 3.
Eclipse (Electronic resource) 4. Computer software-Development. I. Wren, Jaime. II. Clayberg, Eric. III. Title.
QA76.9.U83R814 2012
005.4'37--dc23
2011023246
Copyright 2012 Dan Rubel, Jaime Wren, and Eric Clayberg
All rights reserved. Printed in the United States of America. This publication is protected by copyright, and permission must be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. To obtain permission to use material from this work, please submit a written request to Pearson Education, Inc., Permissions Department, One Lake Street, Upper Saddle River, New Jersey 07458, or you may fax your request to (201) 236-3290.
ISBN-13: 978-0-321-71838-9
ISBN-10: 0-321-71838-0
Text printed in the United States on recycled paper at RR Donnelley in Crawfordsville, Indiana.
First printing, August 2011
To the women we love,
Kathy, Helene, and Karen
Praise for Clayberg and Rubels Eclipse Plug-ins, Third Edition
Dan Rubel and Eric Clayberg are the authors of one of the most highly regarded books in the history of Eclipse. Their Eclipse Plug-ins is generally considered the seminal book on how to extend the Eclipse platform.
Mike Milinkovich Executive Director, Eclipse Foundation
Im often asked, What are the best books about Eclipse? Number one on my list, every time, is Eclipse 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 youre trying to build a product.
Bjorn Freeman-Benson Former 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 youve written, read this book.
Ernest Friedman-Hill Marshall, JavaRanch.com
If youre 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 Plug-ins.
Simon Archer
Eclipse 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
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
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 doesnt 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
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 thats what this book gives you. It is a must for serious plug-in developers, especially those building commercial applications. I wouldnt be without it.
Brian Wilkerson
Foreword
The Eclipse Graphical Editor Framework (GEF) project supports the creation of rich graphical editors and views for Eclipse-based tools and Rich Client Platform (RCP) applications. GEFs three frameworksDraw2D, Zest, and GEFare amongst the most widely used within the Eclipse community and ecosystem.
Mighty oaks from little acorns grow is the story of the GEF project. In the context of the Eclipse community, GEF is a relatively small project. But the tools, applications, and products that have been enabled by GEF form a very long list indeed. Everything from mission planning for the Mars Rovers to most of the worlds commercial modeling tools make use of GEF. GEF is also widely re-used within the Eclipse community itself, and is leveraged by Eclipse projects such as GMF, Graphiti, AMP, Sphinx and Papyrus. It is a testament to the idea that a small, powerful, and open source framework can make an enormous impact on the industry.
A big part of the success of the GEF project and its three frameworks has been its long-term focus on being a platform. Although there has been a steady flow of innovative new features, the quality, stability, and backwards compatibility of the GEF project APIs have been a big part of its success. That level of commitment to the platformness (to coin a phrase) of a framework is the hallmark of a great project at Eclipse. It requires a great deal of commitment and discipline by the project team to accomplish.