aboutsummaryrefslogtreecommitdiffstats
path: root/swtmenubar/README
blob: cc9fa61d492a0c86c64d466315709197911b6307 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
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 <Android tree>/out/host/<platform>/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 <Android tree>/out/host/<platform>/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