Book Image

Eclipse Plug-in Development Beginner's Guide - Second Edition

By : Alex Blewitt
Book Image

Eclipse Plug-in Development Beginner's Guide - Second Edition

By: Alex Blewitt

Overview of this book

Eclipse is used by everyone from indie devs to NASA engineers. Its popularity is underpinned by its impressive plug-in ecosystem, which allows it to be extended to meet the needs of whoever is using it. This book shows you how to take full advantage of the Eclipse IDE by building your own useful plug-ins from start to finish. Taking you through the complete process of plug-in development, from packaging to automated testing and deployment, this book is a direct route to quicker, cleaner Java development. It may be for beginners, but we're confident that you'll develop new skills quickly. Pretty soon you'll feel like an expert, in complete control of your IDE. Don't let Eclipse define you - extend it with the plug-ins you need today for smarter, happier, and more effective development.
Table of Contents (24 chapters)
Eclipse Plug-in Development Beginner's Guide Second Edition
Credits
Foreword
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Time for action – working with menus


Note that SWTBot works on a non-UI thread by default to avoid deadlock with modal dialogs and other user interface actions. If the tests need to interact with specific SWT widgets, it is necessary to invoke a Runnable via the UI thread.

To make this easier, the SWTBot framework has several helper methods that can provide a facade of the workspace, including the ability to click on buttons and show menus.

  1. Create a new test method in the UITest class called createProject with a @Test annotation.

  2. Create a new SWTWorkbenchBot instance.

  3. Use the menu method of the bot to navigate the File | Project... menus, and perform a click.

  4. Use the shell method of the bot to get the newly opened shell with a title of New Project. Activate the shell to ensure that it has focus.

  5. Use the tree method of the bot to find a tree in the shell, and expandNode the General node, and finally select the Project.

  6. Invoke the Next > button with a click. Note the space between the Next and...