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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
|
r<refentry>
<refnamediv>
<refname>
AspectJ Development Environment (AJDE) support for JBuilder
</refname>
<refpurpose>
OpenTool extension Borland's <ulink url="http://www.borland.com/jbuilder">JBuilder IDE</ulink>.
</refpurpose>
</refnamediv>
<refsect1>
<title>Overview</title>
<para>
For release-specific documentation refer to the <ulink url="http://aspectj.org/doc/dist/changes.html"> changes file</ulink>.
</para>
<para>
AJDE for JBuilder will allow you to:
<itemizedlist>
<listitem>
<para>compile AspectJ and Java files within the
IDE</para>
</listitem>
<listitem>
<para>browse the structure of your AspectJ
program</para>
</listitem>
<listitem>
<para>set up a compile configuration that determine which
files will be passed to the compiler</para>
</listitem>
</itemizedlist>
</para>
</refsect1>
<refsect1>
<title>Installation and Project Setup</title>
<para>
<command>Install procedure:</command> use the installer to place the
"ajdeForJBuilder.jar" and "aspectjrt.jar" into JBuilder's lib/ext
directory. This will also install the two html files
"LICENCE-AJDEJBUILDER.html" and "README-AJDEJBUILDER.html".
</para>
<para>
<command>Uninstall procedure:</command> remove "ajdeForJBuilder.jar"
and "aspectjrt.jar" (and the two html files, if you like) from the
"lib/ext" directory.
</para>
<para>
<command>Project setup:</command> follow the normal procedure for
JBuilder project setup (for an example of this please refer to the
example below). However, note that all of the source files to be
passed to the compiler must be added to your project either as files or
within a package that is added to the project. This is necessary
because -- unlike a pure Java compiler -- ajc does not search the
SOURCEPATH for classes.
</para>
<imageobject>
<imagedata fileref="jbuilder-building.gif" />
</imageobject>
<para>
<command>Starting and stopping AJDE:</command> select "Start AJDE" in
the "AspectJ" section of the "Tools" menu, or just click on the "AJDE"
(<inlinemediaobject id="ajdebutton">
<imageobject>
<imagedata fileref="startAjde.gif" />
</imageobject>
</inlinemediaobject>) button (label 1 in the first screenshot). This
will enable AJDE commands and will replace JBuilder's structure view
with the AspectJ Browser. To disable AJDE select "Stop AJDE" in the
same menu, or click the "AJDE" button again.
</para>
</refsect1>
<refsect1>
<title>Compiling and Running the Project</title>
<para>
To compile the project select "Build project with ajc" from the AspectJ
toolbar, or click <ctrl>F11 while the editor pane is active. All
of the files contained in your project and within any packages and
subpackages that have been added to your project will be compiled. You
may also select a different configuration (as with label 2 in the first
screenshot). Then, structure of the currently visited file is shown
(see label 3 in the first scrrenshot). If there is a compile error,
the clickable error message is available (as with label 4 in the first
screenshot).
</para>
<para>
To run the project select "Run Project" from the AspectJ toolbar, or
click <ctrl>F12 while the editor pane is active. Note that the
"AspectJ Runtime" library must be added to your project in order to
run. If the library is not added you will see a
"java.lang.NoClassDefFoundError: org/aspectj/lang/Signature" error.
The library is created automatically for you from the runtime
in "jbuilderdir/lib/ext". You can also create a new library
to use the runtime from a different location. If you have not added the
library to the "Required Libraries" of your project it will be added
automatically when you restart JBuilder.
</para>
<para>
JBuilder7 users please note: when you set up a run/debug configuration
you must select the "Build Target" (at the bottom of the
"Runtime Properties" dialog) to be "<None>". This will ensure
that the Java compiler is not invoked on your AspectJ sources
before running or debugging the project.
</para>
</refsect1>
<refsect1>
<title>Navigating the Program Structure</title>
<imageobject>
<imagedata fileref="jbuilder-structureNavigation.gif" />
</imageobject>
<para>
Navigation of program structure is provided by the AspectJ Browser, so apart from a JBuilder
look and feel, the extra navigation AspectJ allows work as described
there. In particular, you can use views with labels 1, 2 and 4 of the
second screenshot to navigate structure using the blue links, and you
can set filtering and navigate history using the toolbar shown by label
3 of the second screenshot.
</para>
</refsect1>
<refsect1>
<title>Manipulating Build Configurations</title>
<para>
Build configurations can be manipulated adding, removing, and
editing build configuration files. The AspectJ Browser is used to select the
current build configuration. Configurations are represented by
".lst" files which are described in the <xref linkend="ajc">ajc</xref> documentation.
</para>
<imageobject>
<imagedata fileref="jbuilder-configs.gif" />
</imageobject>
<refsect2>
<title>Adding and Removing Build Configurations</title>
<para>
By default all of the files contained in your project and
within any packages and subpackages that have been added to
your project will be compiled. In order to compile a different
configuration first add it to the project (by selecting
"Add Files / Packages..." in the "Project"
menu, and selecting the desired build configuration file (see
label 1 in the third screenshot).
</para>
</refsect2>
<refsect2>
<title>Editing Build Configurations</title>
<para>
Double click a build configuration file in JBuilder's
"Project Pane" in order to edit it. Configurations
can be edited as either text or in the graphical designer (see
labels 2 and 3 in the third screenshot)
</para>
</refsect2>
</refsect1>
<refsect1>
<title>Example: Setting up the "Spacewar" Sample Project</title>
<para>
To set up the Spacewar example first download it the <ulink url="http://aspectj.org/dl">examples distribution</ulink>. Then
<orderedlist>
<listitem>
<para>launch JBuilder</para>
</listitem>
<listitem>
<para>in the "File" menu select "New
project"</para>
</listitem>
<listitem>
<para>Select the location of the "aspectj/examples"
directory for the project. This is because the Spacewar
example uses both the "spacewar" and "coordination"
packages, so we set up the project where it can get at both
packages.
</para>
</listitem>
<listitem>
<para>
Choose a "jpr" project, either by typing in "Spacewar.jpr"
as the project name, or by typing "Spacewar" as the project
name and "jpr" as the type. Make sure "aspectj/examples"
is still the directory for the project. </para>
</listitem>
<listitem>
<para>click "Finish"</para>
</listitem>
<listitem>
<para>in the "Project" menu select "Project
properties..."</para>
</listitem>
<listitem>
<para>set the "Output path" entry to be the directory
where you want your classes to go</para>
</listitem>
<listitem>
<para>set the "Output path" entry to be the directory
where you want your classes to go</para>
</listitem>
<listitem>
<para>add "aspectjrt.jar" as a required library for
the project. This library is located in
"<jbuilder-install-directory>/lib/ext".
</para>
</listitem>
<listitem>
<para>
in the "Source" tab select the entry and click
"Edit" (by default JBuilder will set this directory to be
"examples/src" which does not exist)</para>
</listitem>
<listitem>
<para>
Select the "examples" directory for the
Souce. </para>
</listitem>
<listitem>
<para>click "OK" to close the "Project
Properties"dialog</para>
</listitem>
<listitem>
<para>in the leftmost pane you will notice
"Spacewar.jpr", right click this and select "Add to
project" in the popup, then "Add class/package..." in
thenext popup. Or directly choose "Add
files/packages". </para>
</listitem>
<listitem>
<para><cntrl> select the "spacewar" and
"coordination" packages and then click "OK"; this will add
the two packages to your project</para>
</listitem>
<listitem>
<para>click the "Build Project" button
(<inlinemediaobject>
<imageobject>
<imagedata fileref="jbuilder-build.gif" />
</imageobject>
</inlinemediaobject>)
to compile the project</para>
</listitem>
<listitem>
<para>open the Structure View to browse the structure
of the program</para>
</listitem>
<listitem>
<para>click the "Run Project" button to play
Spacewar (make sure that you have set up the runtime
library as described above)</para>
</listitem>
<listitem>
<para>if you have not selected a class to run, you
will be prompted to do so: select the class
"spacewar.Game". </para>
</listitem>
<listitem>
<para>AspectJ related build options can be
manipulated in the "AJDE settings" window
</para>
<imageobject>
<imagedata fileref="jbuilder-buildOptions.gif" />
</imageobject>
</listitem>
</orderedlist>
</para>
</refsect1>
</refentry>
<!-- Local variables: -->
<!-- fill-column: 79 -->
<!-- compile-command: "ant -quiet dev-html" -->
<!-- sgml-local-ecat-files: devguide.ced -->
<!-- sgml-parent-document:("devguide.sgml" "book" "refentry") -->
<!-- End: -->
|