According to the project’s webpage, the goal of the Mobile Tools for Java (MTJ) project is to extend existing Eclipse frameworks to support mobile device Java application development. The intention is to develop frameworks that can be extended by tool vendors and tools that can be used by third-party mobile Java application developers.
At the beginning of 2008, the project was “rebooted.” It went from version 0.7 to 0.1. The goal now seems to be to extend the functionality of EclipseME version 1.7.9.
6.4.2 Tools for Mobile Linux (TmL)
The Tools for mobile Linux (TmL) project intends to “address the gap where existing Eclipse projects do not entirely satisfy the needs of developers of applications for mobile devices,” according to the project’s webpage. The initial scope focuses on building a device emulator framework supported by a VNC Viewer for graphic display visualization and a simulated end-to-end environment to test enterprise applications.
Summary
In this chapter we’ve looked at a couple of features of the Device Software Development Platform (DSDP), an Eclipse project specifically focused on issues of embedded software development. We started out by looking at how Eclipse handles software updates and installing extensions. Using update sites makes the process of extending Eclipse relatively painless and transparent because the update mechanism takes care of resolving any dependencies in the software you want to install. You can also instruct Eclipse to automatically check for new updates to installed software on a regular basis.
DSDP itself is divided into several subprojects. The Remote System Explorer (RSE) is a collection of tools that allows you to work with resources such as files and folders on remote systems. You can copy files to and from the remote system with a simple drag-and-drop paradigm, edit files directly on the remote system, and run and debug applications remotely.
The Native Application Builder (NAB) enables you to develop platform-independent graphical applications in an intuitive and graphical manner. NAB is an Eclipse wrapper for WideStudio/MWT, an open source project focused on developing platform-independent graphical applications for embedded devices. You can create and test your application on your host environment initially, and then rebuild it for the appropriate target environment.
There are two other subprojects under DSDP that focus on aspects of mobile device development. These are still in a very early “incubation” phase.
Up to this point we’ve talked about how to use the features that are already available in Eclipse. Suppose you want to add some new functionality to Eclipse. The next chapter looks at the process of developing Eclipse plug-ins.
CHAPTER 7
Plug-In Development Environment (PDE)
As has been mentioned before, Eclipse is built on the notion of plug-ins that define its functionality beyond the base platform. So in order to extend Eclipse’s functionality, you need to create one or more additional plug-ins. As an embedded C developer, you may never need to extend Eclipse, but if you do, this chapter will serve as a starting point.
Perhaps not surprisingly, Eclipse provides a powerful, easy-to-use tool, the Plug-in Development Environment (PDE), to assist in creating new plug-ins. PDE hides many of the excruciating details of plug-in development.
7.1 Installing the PDE
PDE itself is of course a collection of plug-ins that must be downloaded and installed into Eclipse just as we did with the DSDP in the last chapter. PDE depends on the Eclipse Java Development Toolkit, JDT. That, too, needs to be downloaded and installed. The JDT in turn depends upon the Java Development Kit (JDK) from Sun Microsystems.
The update site for the Plug-in Development Environment is part of the Ganymede update bundle under Java Development. Just select Eclipse Plug-in Development Environment and click Install…. JDT and any other plug-ins that PDE requires will be installed.
There does appear to be a “gotcha” that wasn’t in Eclipse 3.3. PDE does not recognize that it needs the Eclipse SDK and Eclipse Platform SDK in order to function, so you have to explicitly install those from the Eclipse Project Update Site.
The final step in installing PDE is to install the Java Development Kit from Sun Microsystems. Go to http://java.sun.com/javase/downloads/index.jsp and Download→JDK 6 Update 7. On the next page select Linux as your platform (unless you’re running Eclipse under Windows), agree to the Java SE Development Kit 6 License Agreement, and click Continue. You are then presented with a choice of downloading a self-extracting binary or a self-extracting RPM. I chose the binary.
7.2 So What Is a Plug-In?
It might help to think of Eclipse as the software equivalent of a USB hub. Plug a device into a USB hub and the system automatically figures out what it is and how to drive it. Likewise, when a plug-in is installed into Eclipse, the system determines what the plug-inis capable of doing and what it depends on, so that things get loaded in the proper order.
The core of a plug-in is Java code, so in order to develop truly useful plug-ins, you’ll need to know Java. This book is not the place to learn it. The Resources section at the end of the chapter can point you to Java resources.
With the release of version 3.0, Eclipse adopted the OSGi[8] framework for modular, dynamic, Java components. The OSGi framework defines a dynamic component model that allows applications or components, in the form of “bundles,” to be remotely installed, started, stopped, updated, and uninstalled without requiring a system reboot. An Eclipse plug-in is the equivalent of an OSGi bundle.
7.2.1 Extensions and Extension Points
Fundamentally, extensions and extension points are how plug-ins communicate with the Eclipse platform and with each other. Conceptually, you can think of an extension point as a socket and an extension as a plug that mates with the socket.
Extension points define places where the Eclipse platform can be extended by plugging in additional functionality in the form of extensions. The current Eclipse platform exposes around 200 extension points in the following categories:
• Platform Runtime: Controls the global behavior of Eclipse itself. If you wanted to write an application based on the Eclipse platform, this is the place to start.
• Workspace: Contains extension points for managing projects, such as resource builders (build tools), markers, project life-cycle behavior, and team behavior.
• Platform Text: Facilities for extending editors.
• Workbench: Manages the user interface. This is the largest class of extension points and includes things like support for new views and editors, key bindings, drag-and-drop operations, and additional panels in the Preferences dialog.
• Team: Extension points to manage sharing of project resources, such as folders and files, among team members.
• Debug: Controls application launching as well as debugging. Includes extension points for both behavior and user interface functionality.
• Console: A set of three extension points for managing console views.
• User Assistance (in other words, Help): Facilities to extend the Eclipse Help engine. You can add new HTML help pages and cheat sheets, extend the table of contents, and access the search engine.
8
OSGi originally stood for Open Services Gateway initiative. At some point that term was dropped, and now the organization and its specifications are simply referred to as OSGi.