41,99 €
Develop skills to build powerful plug-ins with Eclipse IDE through examples
This book is for Java developers familiar with Eclipse who need more from the IDE. This book will sharpen your confidence and make you a more productive developer with a tool that supports rather than limits you.
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.
Packed with plenty of examples so you're never stuck, or never left simply reading instructions, this book encourages you to get started immediately. This book is for developers who want to develop, not just learn.
Sie lesen das E-Book in den Legimi-Apps auf:
Seitenzahl: 533
Veröffentlichungsjahr: 2016
Copyright © 2016 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First edition: June 2013
Second published: July 2016
Production reference: 1280716
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78398-069-7
www.packtpub.com
Author
Dr Alex Blewitt
Reviewers
Carla Guillen
Tom Seidel
Commissioning Editor
Kartikey Pandey
Acquisition Editor
Denim Pinto
Content Development Editor
Deepti Thore
Technical Editor
Vivek Arora
Copy Editor
Vikrant Phadke
Project Coordinator
Shweta H Birwatkar
Proofreader
Safis Editing
Indexer
Hemangini Bari
Graphics
Disha Haria
Production Coordinator
Aparna Bhagat
Cover Work
Aparna Bhagat
The Eclipse platform is one of the world's most successful open source software projects. Millions of developers use Eclipse every day as their development tools. Millions of people use applications built on top of the Eclipse Rich Client Platform every day. The Eclipse community has hundreds of dedicated committers and thousands of contributors. Speaking on their behalf, I thank you for your interest in Eclipse, and wish you great success building your project with our free software platform. This book will provide you with an excellent introduction to the key aspects of the Eclipse platform, including the plug-in model, SWT, JFace, user interactions, and resources.
The success of the Eclipse platform has been based to a very large extent on its extensibility. Originally conceived as a platform for building integrated development environments, Eclipse quickly evolved into a platform for building portable desktop applications as well. For over a decade, the Eclipse Rich Client Platform has been one of the leading technologies for creating compelling user interfaces for business applications. The major refresh of the Eclipse application platform that came in 2012 with the launch of Eclipse 4 has seen even further adoption. The chapters on Eclipse 4 and styling your user interface do an excellent job of portraying those new features.
Eclipse projects are driven by great developers, and the Eclipse 4 project has had many important contributors. I would like to recognize the contributions of just a few: the present Eclipse platform leader Mike Wilson (IBM), and project leaders Dani Megert (IBM) and Lars Vogel (vogella), and past leaders John Arthorne (formerly IBM, now Shopify), and Boris Bokowski (formerly IBM, now Google). I would also like to recognize the special contributions to Eclipse 4 of Brian de Alwis, Oleg Besedin, Danail Branekov, Eric Moffatt, Bogdan Gheorghe, Paul Webster, Thomas Schindl, Remy Suen, Kai Tödter, and Lars Vogel.
As an open source product, Eclipse owes its success to the contributions of many people. I highly encourage everyone to follow the chapter on contributing to the Eclipse platform. The Eclipse community is a worldwide phenomenon, and we would love to welcome your contributions.
Alex Blewitt has been actively involved in the Eclipse community for many years. His knowledge of both the Eclipse platform and plug-in development is second to none. He has written an in-depth and fun-to-read introduction to plug-in development that I am sure will help many to build, test, deploy, and update their Eclipse-based products or applications. I am sure that you will find it to be an excellent addition to your Eclipse library.
Mike Milinkovich
Executive Director of the Eclipse Foundation
Dr Alex Blewitt has been developing Java applications since version 1.0 was released in 1996, and has been using the Eclipse platform since its first release as part of the IBM WebSphere Studio product suite. He got involved in the open source community as a tester when Eclipse 2.1 was being released for macOS, and then subsequently as an editor for EclipseZone, including being a finalist for Eclipse Ambassador in 2007. More recently, Alex has been writing for InfoQ, covering Java and specifically Eclipse and OSGi subjects.
He is co-founder of the Docklands.LJC, a regional branch of the London Java Community in the Docklands, and a regular speaker at conferences.
Alex currently works for an investment bank in London, and is a Director of Bandlem Limited. Alex blogs at https://alblue.bandlem.com and tweets as @alblue on Twitter, and is the author of both Mastering Eclipse 4 Plug-in Development, and Swift Essentials, both by Packt Publishing.
I'd like to thank my wife Amy who has been behind me for over fifteen years, supporting me during the development of this and other books. Behind every man is a great woman, and I wouldn't be where I am today if it were not for her.
I'd also like to thank my parents, Derek and Ann, for introducing me to technology at an early age with a ZX81 and setting me on a path and a career that would take me across the globe, even if my first company's name could have been better chosen.
Special thanks are due to Ann Ford, Carla Guillen, Jeff Maury and Peter Rice who provided detailed feedback about every chapter and the exercises therein for the first edition, and to Tom Seidel and Roberto Lo Giacco for the second edition. Without their diligence and attention, this book would contain many more errors than I would like. Thanks are also due to the Packt editing team, Kajal Thapar, Preeti Singh and Mohita Vyas for making this possible.
During the latter stages of the first edition of the book I was also fortunate enough to receive some good feedback and advice from Lars Vogel and Ian Bull, both of whom are heavily involved in the Eclipse platform. I am especially grateful for Lars' website at www.vogella.com which has been an invaluable resource.
Thanks to Scott James, David Jones and Charles Humble for all the help you have given me over the years. Thanks also to my Docklands.LJC co-founder Robert Barr who tweets from @DocklandsLJC.
Finally, congratulations to both Sam and Holly on all your achievements in music, maths and school. Keep up the good work!
Carla Guillen, PhD, works at the Leibniz Supercomputing Centre of the Bavarian Academy of Sciences in the field of performance and energy optimization of supercomputers. As part of the annual courses offered at the Leibniz Supercomputing Centre, she has been teaching a course on the use of the Eclipse IDE with the CDT and Photran plug-in for 4 years. Additionally, she reviewed a book on advanced Eclipse plug-in development in 2014.
Tom Seidel works as an independent software engineer with focus on projects using Eclipse technology. He has worked for over a decade with the Eclipse technology stack in many projects and nearly every industry. Furthermore, he is an Eclipse committer and an active member of the Eclipse community.
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at <[email protected]> for more details.
At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.
https://www2.packtpub.com/books/subscription/packtlib
Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can search, access, and read Packt's entire library of books.
This book is dedicated in memory of Anne Tongs (née Blewitt)
This book provides a general introduction to developing plug-ins for the Eclipse platform. No prior experience, other than Java, is necessary to be able to follow the examples presented in this book. By the end of the book, you should be able to create an Eclipse plug-in from scratch, as well as be able to create an automated build of those plug-ins.
Chapter 1, Creating Your First Plug-in, provides an overview of how to download Eclipse, set it up for plug-in development, create a sample plug-in, launch and debug it.
Chapter 2, Creating Views with SWT, provides an overview of how to build views with SWT, along with other custom SWT components such as system trays and resource management.
Chapter 3, Creating JFace Viewers, will show how to create views with JFace using TreeViewers and TableViewers, along with integration with the properties view and user interaction.
Chapter 4, Interacting with the User, interacts with the user, as well as the Jobs and Progress APIs, using commands, handlers, and menus.
Chapter 5, Storing Preferences and Settings, shows how to store preference information persistently, as well as displaying information via the Preferences pages.
Chapter 6, Working with Resources, tells how to load and create Resources in the workbench, as well as how to create a builder and nature for automated processing.
Chapter 7, Creating Eclipse 4 Applications, discusses the key differences between the Eclipse 3.x and Eclipse 4.x models, along with commands, handlers and menu items.
Chapter 8, Migrating to Eclipse 4.x, teaches how to efficiently migrate views created for Eclipse 3.x to the new Eclipse 4.x model.
Chapter 9, Styling Eclipse 4 Applications, discusses how to style the UI with CSS, and create widgets that can adjust to CSS styles.
Chapter 10, Creating Features, Update Sites, Applications, and Products, takes the plug-ins created so far in this book, aggregates them into features, publishes to update sites, and teaches you how applications and products are used to create standalone entities.
Chapter 11, Automated Testing of Plug-ins, teaches how to write automated tests that exercise Eclipse plug-ins, including both UI and non-UI components.
Chapter 12, Automated Builds with Tycho, shows how to build Eclipse plug-ins, features, update sites, applications, and products automatically with Maven Tycho.
Chapter 13, Contributing to Eclipse, discusses how to use Git to check out Eclipse code bases, how to report bugs with Bugzilla, and how to upload patches into Gerrit.
Appendix A, Using OSGi Services to Dynamically Wire Applications, looks at OSGi services as an alternative means of providing dependent services in an Eclipse or OSGi application.
Appendix B, Pop Quiz Answers, covers all the answers enlisted in the pop quiz sections in the book.
To run the exercises for this book, you will need a computer with an up-to-date operating system running Windows, Linux, or Mac OS X. Java also needs to be installed; JDK 1.8 is the current released version although the instructions should work for a newer version of Java.
This book has been tested with the Eclipse SDK (Classic/Standard) for Mars (4.5) and Neon (4.6). Newer versions of Eclipse may also work. Care should be taken to not install the Eclipse for RCP and RAP developers, as this will cause the applications created in Chapter 7, Understanding the Eclipse 4 Model and RCP Applications and Chapter 8, Migrating Views to the Eclipse 4 Model.
The first chapter explains how to get started with Eclipse, including how to obtain and install both Eclipse and Java.
This book is aimed at Java developers who are interested in learning how to create plug-ins, products and applications for the Eclipse platform.
This book will also be useful to those who already have some experience in building Eclipse plug-ins and want to know how to create automated builds using Maven Tycho, which has become the de facto standard for building Eclipse plug-ins.
Finally, those Eclipse developers who are familiar with the Eclipse 3.x model but are interested in learning about the changes that the Eclipse 4.x model brings will find the information presented in Chapter 8 a useful summary of what opportunities the new model provides.
In this book, you will find several headings that appear frequently (Time for action, What just happened?, Pop quiz, and Have a go hero).
To give clear instructions on how to complete a procedure or task, we use these sections as follows:
Instructions often need some extra explanation to ensure they make sense, so they are followed with these sections:
This section explains the working of the tasks or instructions that you have just completed.
You will also find some other learning aids in the book, for example:
These are short multiple-choice questions intended to help you test your own understanding.
These are practical challenges that give you ideas to experiment with what you have learned.
You will also find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.
Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "Running java -version should give output like this."
A block of code is set as follows:
Any command-line input or output is written as follows:
New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "Choose a workspace, which is the location in which projects are to be stored, and click on OK:"
Warnings or important notes appear in a box like this.
Tips and tricks appear like this.
Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of.
To send us general feedback, simply e-mail <[email protected]>, and mention the book's title in the subject of your message.
If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at www.packtpub.com/authors.
Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.
You can download the example code files for this book from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.
You can download the code files by following these steps:
You can also download the code files by clicking on the Code Files button on the book's webpage at the Packt Publishing website. This page can be accessed by entering the book's name in the Search box. Please note that you need to be logged in to your Packt account.
Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:
The code bundle for the book is also hosted on GitHub at https://github.com/alblue/com.packtpub.e4. We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!
We also provide you with a PDF file that has color images of the screenshots/diagrams used in this book. The color images will help you better understand the changes in the output. You can download this file from http://www.packtpub.com/sites/default/files/downloads/EclipsePluginDevelopmentBeginnersGuideSecondEdition_ColorImages.pdf.
Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.
To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.
Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.
Please contact us at <[email protected]> with a link to the suspected pirated material.
We appreciate your help in protecting our authors and our ability to bring you valuable content.
If you have a problem with any aspect of this book, you can contact us at <[email protected]>, and we will do our best to address the problem.
Eclipse – an IDE for everything and nothing in particular.
Eclipse is a highly modular application consisting of hundreds of plug-ins, and can be extended by installing additional plug-ins. Plug-ins are developed and debugged with the Plug-in Development Environment (PDE).
In this chapter we will:
Developing plug-ins requires an Eclipse development environment. This book has been developed and tested on Eclipse Mars 4.5 and Eclipse Neon 4.6, which was released in June 2016. Use the most recent version available.
Eclipse plug-ins are generally written in Java. Although it's possible to use other JVM-based languages (such as Groovy or Scala), this book will use the Java language.
There are several different packages of Eclipse available from the downloads page, each of which contains a different combination of plug-ins. This book has been tested with:
These contain the necessary Plug-in Development Environment (PDE) feature as well as source code, help documentation, and other useful features. The RCP and RAP package should not be used as it will cause problems with exercises in Chapter 7, Understanding the Eclipse 4 Model and RCP Applications.
It is also possible to install the Eclipse PDE feature in an existing Eclipse instance. To do this, go to the Help menu and select Install New Software, followed by choosing the General Purpose Tools category from the selected update site. The Eclipse PDE feature contains everything needed to create a new plug-in.
Eclipse is a Java-based application; it needs Java installed. Eclipse is distributed as a compressed archive and doesn't require an explicit installation step.
Note that Java comes in two flavors: a 32-bit installation and a 64-bit installation. If the running OS is 32-bit, then install the 32-bit JDK; alternatively, if the running OS is 64-bit, then install the 64-bit JDK.
On Linux, Eclipse requires GTK+ 2 or 3 to be installed. Most Linux distributions have a window manager based on GNOME, which provides GTK+ 2 or 3.
Eclipse needs Java to run, and so the first step involved in installing Eclipse is ensuring that an up-to-date Java installation is available. By default, Eclipse will find a copy of Java installed on the path or from one of the standard locations. It is also possible to specify a different Java by using the -vm command-line argument.
If the splash screen doesn't show, then the Eclipse version may be incompatible with the JDK (for example, a 64-bit JDK with a 32-bit Eclipse, or vice versa). Common error messages shown at the launcher may include Unable to find companion launcher or a cryptic message about being unable to find an SWT library.
On Windows, there is an additional eclipsec.exe launcher that allows log messages to be displayed on the console. This is sometimes useful if Eclipse fails to load and no other message is displayed. Other operating systems can use the eclipse command; and both support the -consolelog argument, which can display more diagnostic information about problems with launching Eclipse.
The Eclipse workspace is a directory used for two purposes: as the default project location, and to hold the .metadata directory containing Eclipse settings, preferences, and other runtime information. The Eclipse runtime log is stored in the .metadata/.log file.
The workspace chooser dialog has an option to set a default workspace. It can be changed within Eclipse by navigating to File | Switch Workspace. It can also be overridden by specifying a different workspace location with the -data command-line argument.
Finally, the welcome screen is useful for first-time users, but it is worth closing (rather than minimizing) once Eclipse has started.
In this task, Eclipse's plug-in wizard will be used to create a plug-in.
In PDE, every plug-in has its own individual project. A plug-in project is typically created with the new project wizard, although it is also possible to upgrade an existing Java project to a plug-in project by adding the PDE nature and the required files by navigating to Configure | Convert to plug-in project.
Creating a plug-in project is the first step towards creating a plug-in for Eclipse. The new plug-in project wizard was used with one of the sample templates to create a project.
Plug-ins are typically named inreverse domain name format, so these examples will be prefixed with com.packtpub.e4. This helps to distinguish between many plug-ins; the stock Eclipse IDE for Eclipse Committers comes with more than 450 individual plug-ins; the Eclipse-developed ones start with org.eclipse.
Conventionally, plug-ins that create additions to (or require) the use of the UI have .ui. in their name. This helps to distinguish those that don't, which can often be used headlessly. Of the more than 450 plug-ins that make up the Eclipse IDE for Eclipse Committers, approximately 120 are UI-related and the rest are headless.
The project contains a number of files that are automatically generated based on the content filled in the wizard. The key files in an Eclipse plug-in are:
This is one of the reasons Eclipse starts so quickly; by not needing to load or execute classes, it can scale by showing what's needed at the time, and then load the class on demand when the user invokes the action. Java Swing's Action class provides labels and tooltips programmatically, which can result in slower initialization of Swing-based user interfaces.
Q1. What is an Eclipse workspace?
Q2. What is the naming convention for Eclipse plug-in projects?
Q3. What are the names of the three key files in an Eclipse plug-in?
To test an Eclipse plug-in, Eclipse is used to run or debug a new Eclipse instance with the plug-in installed.
Eclipse can launch a new Eclipse application by clicking on the run icon, or via the Run menu.
Upon clicking on run in the toolbar (or via Run | Run As | Eclipse Application) a launch configuration is created, which includes any plug-ins open in the workspace. A second copy of Eclipse—with its own temporary workspace—will enable the plug-in to be tested and verify that it works as expected.
The run operation is intelligent, in that it launches an application based on what is selected in the workspace. If a plug-in is selected, it will offer the opportunity to run as an Eclipse Application; if a Java project with a class with a main method, it will run it as a standard Java Application; and if it has tests, then it will offer to run the test launcher instead.
However, the run operation can also be counter-intuitive; if clicked a second time, and in a different project context, then something other than the expected launched might be run.
A list of the available launch configurations can be seen by going to the Run menu, or by going to the dropdown to the right of the run icon. The Run | Run Configurations menu shows all the available types, including any previously run:
By default, the runtime workspace is kept between runs. The launch configuration for an Eclipse application has options that can be customized; in the preceding screenshot, the Workspace Data section in the Main tab shows where the runtime workspace is stored, and an option is shown that allows the workspace to be cleared (with or without confirmation) between runs.
Launch configurations can be deleted by clicking on the red delete icon on the top left, and new launch configurations can be created by clicking on the new icon. Each launch configuration has a type:
The launch configuration can be thought of as a pre-canned script that can launch different types of programs. Additional tabs are used to customize the launch, such as the environment variables, system properties, or command-line arguments. The type of the launch configuration specifies what parameters are required and how the launch is executed.
When a program is launched with the run icon, changes to the project's source code while it is running have no effect. However, as we'll see in the next section, if launched with the debug icon, changes can take effect.
If the target Eclipse is hanging or otherwise unresponsive, in the host Eclipse instance, the Console view (shown by navigating to Window | View | Show View | Other | General | Console menu) can be used to stop the target Eclipse instance.
Q1. What are the two ways of terminating a launched Eclipse instance?
Q2. What are launch configurations?
Q3. How are launch configurations created and deleted?
Now that the Eclipse plug-in is running, try the following:
Since it's rare that everything works first time, it's often necessary to develop iteratively, adding progressively more functionality each time. Secondly, it's sometimes necessary to find out what's going on under the cover when trying to fix a bug, particularly if it's a hard-to-track-down exception such as NullPointerException.
Fortunately, Eclipse comes with excellent debugging support, which can be used to debug both standalone Java applications as well as Eclipse plug-ins.
Debugging an Eclipse plug-in is much the same as running an Eclipse plug-in, except that breakpoints can be used, the state of the program can be updated, and variables and minor changes to the code can be made. Rather than debugging plug-ins individually, the entire Eclipse launch configuration is started in debug mode. That way, all the plug-ins can be debugged at the same time.
Although run mode is slightly faster, the added flexibility of being able to make changes makes debug mode much more attractive to use as a default.
Start the target Eclipse instance by navigating to Debug | Debug As | Eclipse Application, or by clicking on debug in the toolbar.
The debugger perspective will open whenever a breakpoint is triggered and the program will be paused. While it is paused, the target Eclipse is unresponsive. Any clicks on the target Eclipse application will be ignored, and it will show a busy cursor.
The built-in Eclipse debugger was used to launch Eclipse in debug mode. By triggering an action that led to a breakpoint, the debugger was revealed, allowing the local variables to be inspected.
When in the debugger, there are several ways to step through the code:
There is also a Run | Step into Selection menu item; it does not have a toolbar icon. It can be invoked with Ctrl + F5 (Alt + F5 on macOS) and is used to step into a specific expression.
When an Eclipse instance is launched in run mode, changes made to the source code aren't reflected in the running instance. However, debug mode allows changes made to the source to be reflected in the running target Eclipse instance.
By default, Eclipse ships with the Build Automatically option in Project menu enabled. Whenever changes are made to Java files, they are recompiled along with their dependencies if necessary.
When a Java program is launched in run mode, it will load classes on demand and then keep using that definition until the JVM shuts down. Even if the classes are changed, the JVM won't notice that they have been updated, and so no differences will be seen in the running application.
However, when a Java program is launched in debug mode, whenever changes to classes are made, Eclipse will update the running JVM with the new code if possible. The limits to what can be replaced are controlled by the JVM through theJava Virtual Machine Tools Interface (JVMTI). Generally, updating an existing method and adding a new method or field will work, but changes to interfaces and superclasses may not be.
The Hotspot JVM cannot replace classes if methods are added or interfaces are updated. Some JVMs have additional capabilities that can substitute more code on demand. Other JVMs, such as IBM's, can deal with a wider range of replacements.
Note that there are some types of changes that won't be picked up, for example, new extensions added to the plugin.xml file. In order to see these changes, it is possible to start and stop the plug-in through the command-line OSGi console, or restart Eclipse inside or outside of the host Eclipse to see the change.
When debugging using Step Into, the code will frequently go into Java internals, such as the implementation of Java collections classes or other internal JVM classes. These don't usually add value, so fortunately Eclipse has a way of ignoring uninteresting classes.
Step filters allow for uninteresting packages and classes to be ignored during step debugging.
Step Filters allows uninteresting packages to be skipped, at least from the point of debugging. Typically, JVM internal classes (such as those beginning with sun or sunw) are not helpful when debugging and can easily be ignored. This also avoids debugging through the ClassLoader as it loads classes on demand.
Typically it makes sense to enable all the default packages in the Step Filters dialog, as it's pretty rare to need to debug any of the JVM libraries (internal or public interfaces). This means that when stepping through code, if a common method such as toString is called, debugging won't step through the internal implementation.
It also makes sense to filter out simple setters and getters (those that just set a variable or those that just return a variable). If the method is more complex (like the getVariable method previously), then it will still stop in the debugger.
Constructors and static initializers can also be filtered specifically.
Although it's possible to place a breakpoint anywhere in a method, a special breakpoint type exists that can fire on method entry, exit, or both. Breakpoints can also be customized to only fire in certain situations or when certain conditions are met.
Method breakpoints allow the user to see when a method is entered or exited.
The breakpoint triggers at the time the method enters and subsequently when the method's return
