This tutorial explains how to work with the Eclipse source code. It assumes that you are already familiar with using the Eclipse IDE.
1. Accessing the Eclipse source code
This description helps you to access the underlying structure and source code of an Eclipse application.
2. Identifying who contributes user interface components
2.1. Plug-in Spy for UI parts
You can activate the Plug-in Spy by pressing Alt+Shift+F1 in the Eclipse IDE. It gives you information about the currently selected user interface component. This way you can get immediate access to the plug-in which is currently running.
Click on any of the linked elements to obtain more information about that element. For example, if you click on the contributing plug-in the tool opens the manifest editor for this plug-in.
2.2. Menu spy
Press Alt+Shift+F2 and select a menu entry or click a toolbar entry to see information about this element.
2.3. SWT Spy
SWT Spy for Eclipse is a tool that prints out information about the widget under the cursor. Currently, this includes style, layout and parent information. See SWT Development Tools homepage for more information.
2.4. Layout Spy
With Eclipse 4.7 PDE has added the SWT Layout Spy. Press Ctrl+Alt+Shift+F9 on any window to activate it.
Select Control to pick a control to inspect.
Show Overlay you activate an overlay that shows an outline around the selected control (red rectangle) and its child (yellow rectangle).
You can navigate the controls with
Open Child and
To find a control which boundary is misaligned now navigate to a control thats outline is correct but its child isn’t. Check the value of computeSize. If the result of computeSize is correct, the problem is in the parent layout or its attributes. Otherwise the problem is in the child widget.
2.5. Debugging GTK elements with GtkInspector
GtkInspector is a tool that allows you to debug GTK+ applications.
It was introduced in GTK+ 3.14.
To start Eclipse with the GtkInspector start it with an environment variable set.
You can also start the GtkInspector for an already running program. To do this you have to enable the inspector key bindings. Under ubuntu you might have to install an additional package to make this option available.
sudo apt-get install libgtk-3-dev
Run this command in your terminal to activate the setting.
gsettings set org.gtk.Settings.Debug enable-inspector-keybinding true
After this the keybinding are activated.
See CSS for GTK for more information. == Enable access to plug-ins
2.6. Filtering by the Java tools
The Eclipse Java tools limit the scope of search related activities based on your projects. By default, Eclipse includes elements from opened projects including their dependencies as well as elements from the standard Java library.
For example, the Open Type dialog Ctrl+Shift+T does not find the
ISources interface, if it is not referred to by project in your workspace.
As plug-in developer you want to have access to all classes in your current target platform. The target platform is the set of plug-ins against you develop. By default, the plug-ins from the Eclipse IDE installation are used as target platform.
2.7. Include all plug-ins in Java search
You can include all classes from the current target platform to be relevant for the Eclipse Java tools via the following setting:
3. Find the plug-in for a certain class
You frequently have to find the plug-in for a given class. The Eclipse IDE makes it easy to find the plug-in for a class. After enabling the Include all plug-ins from target into Java Search setting in the Eclipse IDE preferences you can use the Open Type dialog Ctrl+Shift+T to find the plug-in for a class. The JAR file is shown in this dialog and the prefix of the JAR file is typically the plug-in which contains this class.
4. Finding classes and plug-ins
4.1. Open Plug-in artifact
Use the Ctrl+Shift+A shortcut to search for an extension point.
Definition and usage of an extension point have different icons.
For example, to see which plug-in defines the
org.eclipse.menu.ui extension point,
enter it in the dialog and select the entry with the blue icon.
4.2. Plug-in search
Plug-in Search allows you to perform a detailed search for extension points. Select themenu. You can specify what your are searching for as demonstrated in the following screenshot.
4.3. Plain text search
In case you have imported the source code of an Eclipse project into your workspace you can also use the plain text search. Select themenu entry and switch to the File Search tab.
As indicated in the following screenshot you can search for a text, use regular expressions and restrict which files to search by specifying a file name pattern. This is a very flexible way to search and allows you to find almost everything.
for key bindings
The tracing functionality of Eclipse allows to you trace which command is associated with a certain key binding. The following listing contains the trace options to enable that.
# turn on debugging for the org.eclipse.core.resources plugin. org.eclipse.ui/debug=true org.eclipse.ui/trace/keyBindings org.eclipse.ui/trace/keyBindings.verbose
6. About this website
7. Eclipse Source Code Resources
7.1. vogella GmbH training and consulting support
|TRAINING||SERVICE & SUPPORT|
The vogella company provides comprehensive training and education services from experts in the areas of Eclipse RCP, Android, Git, Java, Gradle and Spring. We offer both public and inhouse training. Whichever course you decide to take, you are guaranteed to experience what many before you refer to as “The best IT class I have ever attended”.
The vogella company offers expert consulting services, development support and coaching. Our customers range from Fortune 100 corporations to individual developers.
Appendix A: Copyright and License
Copyright © 2012-2016 vogella GmbH. Free use of the software examples is granted under the terms of the EPL License. This tutorial is published under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Germany license.