You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ajdejbuilder.xml 11KB

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