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

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