Using the Eclipse project SwtMenuBar ------------------------------------ This project provides a platform-specific way to hook into the default OS menu bar. On MacOS, it allows an SWT app to have an About menu item and to hook into the default Preferences menu item. On Windows and Linux, an SWT Menu should be provided (typically named "Tools") into which the About and Options menu items will be added. Consequently the implementation contains platform-specific source folders for the Java files that rely on a platform-specific version of SWT.jar. Right now we have the following source folders: - src/ - Generic implementation for all platforms. - src-darwin/ - Implementation for MacOS Carbon. *Only* the default "src/" folder is declared in the project .classpath so that the project can be opened in Eclipse on any platform and still work. However that means that on MacOS the custom src-darwin folder is not used by default. 1- To build the library: Do not use Eclipse to build the library. Instead use the makefile: $ cd $TOP_OF_ANDROID_TREE $ . build/envsetup.sh && lunch sdk-eng $ make swtmenubar This will create a Jar in /out/host//framework/ that can then be included in the target application. 2- To use the library in a target application: Build the swtmenubar library as explained in step 1. In the target application, define a classpath variable in Eclipse: - Open Preferences > Java > Build Path > Classpath Variables - Create a new classpath variable named ANDROID_OUT_FRAMEWORK - Set its folder value to /out/host//framework Then add a variable to the Build Path of the target project: - Open Project > Properties > Java Build Path - Select the "Libraries" tab - Use "Add Variable" - Select ANDROID_OUT_FRAMEWORK - Select "Extend..." - Select swtmenubar.jar (which you previously built at step 1) Remember that if you then edit the SwtMenuBar project in Eclipse you will need to rebuild it using the command-line before the changes are propagated in the target applications that uses it. -- EOF