Eclipse RCP Tutorial: Lay out your view with FormLayout

Let’s say each widget has 4 sides, e.g., a button has top, bottom, left, and right. FormLayout works by using FormAttachments for each side of the widget. A FormAttachment specifies the position relative to the parent container or another widget in the same composite.

All of the following examples assume you know how to create a plug-in application with a view, as the code will work under createPartControl() method.

Read more

Eclipse Plug-in Development – Create a Perspective

A perspective is the container for a set of views and editors. The most commonly used perspective is probably “Java” which contains a set of views for Java development such as a package explorer, an editor, a console, etc. You can switch to another perspective by clicking “Window” -> “Open Perspective”. Switching perspectives let you … Read more

Eclipse PlatformUI Examples

In this tutorial, I will use examples to show you how to use the Eclipse PlatformUI class. PlatformUI is a final class defined in org.eclipse.ui package. It provides access function to the Eclipse Platform User Interface. All methods inside of PlatformUI class are static and the class can not be initialized. Example 1: Fetch current … Read more

Learn Eclipse RCP framework by using open source projects

Open source is not a new concept and you can find open source projects for almost all commonly used frameworks. In 2010, UCI published their project corpus which contains about 18,000 open source java projects. We can easily search and find projects that use popular frameworks such as Eclipse RCP, Struts 2, Spring, Android, etc. … Read more

Add JDBC Database Connection to an Eclipse Plug-in

When you add JDBC database connection to an Eclipse plug-in, you may get the following error message: Error message(partial): java.lang.ClassNotFoundException: com.mysql.jdbc.Driver at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal( at org.eclipse.osgi.internal.loader.BundleLoader.findClass( at org.eclipse.osgi.internal.loader.BundleLoader.findClass( at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass( at java.lang.ClassLoader.loadClass(Unknown Source) You may check again and again if the JDBC library has already added to the build path. That will not work, because JDBC … Read more

Eclipse RCP Tutorial: Commonly-used Eclipse Workbench Extension Points

1. What is a Workbench? The following diagram is from eclipse official site. In brief, when you open your eclipse, what you see is a workbench. It consists of a menu bar, a tool bar, a page which is composed by one or more views/editors. 2. Commonly Used Extension Points The following are commonly or … Read more

Eclipse RCP Tutorial: How to Add a Progress Bar

This tutorial is about eclipse Job and it consists two parts. The first part introduces how to make a progress bar by using a simple example. The second part briefly illustrates Eclipse Job for background processing. 1. A Simple Example of Progress Bar in Eclipse Suppose you have a working RCP application with a sample … Read more