NAB Project Properties
While building a native application is an instructive exercise, the real power of WideStudio/MWT and the NAB plug-in is the ability to rebuild the project for an embedded target environment. The target environment is configured and described in the project Properties dialog.
When you select Properties for an NAB project, you’ll find three additional entries in the navigation panel:
• NAB/MWT Platform SDK Environment
• NAB/MWT Project Class Library Settings
• NAB/MWT Project Settings
For now, we’ll take a look at the Project Settings dialog shown in Figure 6.18. There are three tabs. Target Settings has three items. Encoding lets you specify a character encoding if one is not explicitly specified in the program. Application type is one of Normal Application, Class Library, Netscape Plugin, or Console Application.
Figure 6.18: NAB/MWT Project Settings dialog.
The Target drop-down brings up a very extensive list of all the platforms supported by WideStudio/MWT (Figure 6.19). Of course, selecting anything other than Native assumes you have the appropriate cross-development tool chain, and have built the corresponding MWT runtime libraries.
Figure 6.19: NAB/MWT targets.
The Compiler Settings (Figure 6.20) and Linker Settings tabs take the place of the C/C++ Build→Settingsdialog for ordinary C/C++ projects. This is because NAB creates its own makefiles. Here is where you would specify a cross compiler for your embedded target. Note also that this is where Debug mode is enabled.
Figure 6.20: NAB project Compiler Settings.
The NAB/MWT Platform SDK Environment settings are an artifact of the original WideStudio IDE and are likely to be deleted in the next major update, according to the NAB project lead. Its functionality has effectively been supplanted by the Project Settings. Incidentally, T-Engine is a popular embedded platform in Japan that grew out of the TRON project.
6.4 Other DSDP Subprojects
Although they’re still in the incubation stage, it’s worth at least describing the remaining subprojects under the Device Software Development Platform. If you’re developing mobile devices, you might want to look into them.
6.4.1 Mobile Tools for Java (MTJ)
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.
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.
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.
Читать дальше