aboutsummaryrefslogtreecommitdiffstats
path: root/docs/gscripts.txt
blob: e3f5d18bd7adfa30b1d5ee3aecd18f11e844cb79 (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
This file describes the "gscripts" folder in ADT (Android Eclipse Plugin).


----------
- Overview
----------

ADT is the Android Eclipse Plugin. The plugin delivers a new editor, called
the the Graphical Layout Editor (a.k.a. GLE2), to visually edit Android layout
XML files.

Details on how to handle the various Android views and layouts is not
hardcoded in the GLE2 itself. Instead it is differed to a bunch of Groovy
scripts.


(TODO: expand/replace with a better overview of implementation... goal is
to use this a doc for 3rd-party projects to implement their own rules.)



-------------
- Groovy tips
-------------


- Debugging:

If you run ADT in debug mode and want to trace into Groovy
methods, you need to tell Eclipse where to find the Groovy source code.

To do this:
- in Eclipse, import an existing project
- Select the project at <android-source-tree>/prebuilt/common/groovy/
- This will add a new Eclipse project named "GroovySrc" which contains
  a single zip file with the groovy source.
- ADT is already pre-configured to find the Groovy source in the GroovySrc
  project.



- Private methods:

Be careful when adding new helper methods in the BaseView
or BaseLayout classes.

Due to the way Groovy looks up methods, private methods will *not* be found by
same-class methods if invoked by a derived class in the context of a closure
(which is about the case of all these helper methods.)