PageRenderTime 38ms CodeModel.GetById 10ms RepoModel.GetById 0ms app.codeStats 0ms

/www/tags/NOV_07_2009/htdocs/users-guide/macros-java.html

#
HTML | 34 lines | 34 code | 0 blank | 0 comment | 0 complexity | 78d92b787644a16a690e6ce72dbc2524 MD5 | raw file
Possible License(s): BSD-3-Clause, AGPL-1.0, Apache-2.0, LGPL-2.0, LGPL-3.0, GPL-2.0, CC-BY-SA-3.0, LGPL-2.1, GPL-3.0, MPL-2.0-no-copyleft-exception, IPL-1.0
  1. <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Java Code Macros</title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2"><link rel="start" href="index.html" title="jEdit 4.3 User's Guide"><link rel="up" href="macro-index.html" title="Appendix F. Macros Included With jEdit"><link rel="prev" href="macros-interface.html" title="User Interface Macros"><link rel="next" href="macros-misc.html" title="Miscellaneous Macros"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Java Code Macros</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="macros-interface.html">Prev</a> </td><th width="60%" align="center">Appendix F. Macros Included With jEdit</th><td width="20%" align="right"> <a accesskey="n" href="macros-misc.html">Next</a></td></tr></table><hr></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="macros-java"></a>Java Code Macros</h2></div></div></div><p>These macros handle text formatting and generation tasks that are
  2. particularly useful in writing Java code.</p><div class="itemizedlist"><ul type="disc"><li><p><code class="filename">Create_Constructor.bsh</code></p><p>Inserts constructor for the class at the current caret
  3. position.</p></li><li><p><code class="filename">Get_Class_Name.bsh</code></p><p>Inserts a Java class name based upon the buffer's file
  4. name.</p></li><li><p><code class="filename">Get_Package_Name.bsh</code></p><p>Inserts a plausible Java package name for the current
  5. buffer.</p><p>The macro compares the buffer's path name with the
  6. elements of the classpath being used by the jEdit session. An
  7. error message will be displayed if no suitable package name is
  8. found. This macro will not work if jEdit is being run as a JAR
  9. file without specifying a classpath; in that case the classpath
  10. seen by the macro consists solely of the JAR file.</p></li><li><p><code class="filename">Java_File_Save.bsh</code></p><div class="abstract"><p class="title"><b>Abstract</b></p><p>Acts as a wrapper script to the Save As action. If the
  11. buffer is a new file, it scans the first 250 lines for a
  12. Java class or interface declaration. On finding one, it
  13. extracts the appropriate filename to be used in the Save As
  14. dialog.</p></div></li><li><p><code class="filename">Make_Get_and_Set_Methods.bsh</code></p><p>Creates <code class="function">getXXX()</code> or
  15. <code class="function">setXXX()</code> methods that can be pasted into
  16. the buffer text.</p><p>This macro presents a dialog that will &#8220;<span class="quote">grab</span>&#8221;
  17. the names of instance variables from the caret line of the
  18. current buffer and paste a corresponding
  19. <code class="function">getXXX()</code> or <code class="function">setXXX()</code>
  20. method to one of two text areas in the dialog. The text can be
  21. edited in the dialog and then pasted into the current buffer
  22. using the <span class="guilabel"><strong>Insert...</strong></span> buttons. If the caret
  23. is set to a line containing something other than an instance
  24. variable, the text grabbing routine is likely to generate
  25. nonsense.</p><p>As explained in the notes accompanying the source code,
  26. the macro uses a global variable which can be set to configure
  27. the macro to work with either Java or C++ code. When set for use
  28. with C++ code, the macro will also write (in commented text)
  29. definitions of <code class="function">getXXX()</code> or
  30. <code class="function">setXXX()</code> suitable for inclusion in a header
  31. file.</p></li><li><p><code class="filename">Preview_Javadoc_of_Buffer.bsh</code></p><p>Create and display API documentation for the current
  32. buffer.</p><p>The macro includes various configuration variables you can
  33. change; see the comment at the beginning of the macro source for
  34. details.</p></li></ul></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="macros-interface.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="macro-index.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="macros-misc.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">User Interface Macros </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Miscellaneous Macros</td></tr></table></div></body></html>