PageRenderTime 41ms CodeModel.GetById 36ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms


HTML | 43 lines | 43 code | 0 blank | 0 comment | 0 complexity | 42b752cbbc75c94f0bd3d633d2b983d9 MD5 | raw file
 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.65.1"><link rel="home" href="index.html" title="jEdit 4.2 User's Guide"><link rel="up" href="macro-index.html" title="Appendix F. Macros Included With jEdit"><link rel="previous" 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></div></div><p>
 2    These macros handle text formatting and generation tasks that are
 3    particularly useful in writing Java code.
 4</p><div class="itemizedlist"><ul type="disc"><li><p><tt class="filename">Create_Constructor.bsh</tt></p><p>
 5        Inserts constructor for the class at the current caret position.
 6    </p></li><li><p><tt class="filename">Get_Class_Name.bsh</tt></p><p>
 7        Inserts a Java class name based upon the buffer's file name.
 8    </p></li><li><p><tt class="filename">Get_Package_Name.bsh</tt></p><p>
 9        Inserts a plausible Java package name for the current buffer.
10    </p><p>
11        The macro compares the buffer's path name with the elements of the
12        classpath being used by the jEdit session.  An error message will be
13        displayed if no suitable package name is found. This macro will not
14        work if jEdit is being run as a JAR file without specifying a
15        classpath; in that case the classpath seen by the macro consists
16        solely of the JAR file.
17    </p></li><li><p><tt class="filename">Java_File_Save.bsh</tt></p><div class="abstract"><p class="title"><b>Abstract</b></p><p>Acts as a wrapper script to the Save As action. If the buffer
18      is a new file, it scans the first 250 lines for a Java class or interface
19      declaration. On finding one, it extracts the appropriate filename to be
20      used in the Save As dialog.</p></div></li><li><p><tt class="filename">Make_Get_and_Set_Methods.bsh</tt></p><p>
21        Creates <tt class="function">getXXX()</tt> or <tt class="function">setXXX()</tt>
22        methods that can be pasted into the buffer text.
23    </p><p>
24        This macro presents a dialog that will &#8220;<span class="quote">grab</span>&#8221; the names
25        of instance variables from the caret line of the current buffer
26        and paste a corresponding <tt class="function">getXXX()</tt> or
27        <tt class="function">setXXX()</tt> method to one of two text areas in the
28        dialog.  The text can be edited in the dialog and then pasted into the
29        current buffer using the <span><b class="guilabel">Insert...</b></span> buttons.  If
30        the caret is set to a line containing something other than an instance
31        variable, the text grabbing routine is likely to generate nonsense.
32    </p><p>
33        As explained in the notes accompanying the source code, the macro
34        uses a global variable which can be set to configure the macro to work
35        with either Java or C++ code.  When set for use with C++ code,
36        the macro will also write (in commented text) definitions of
37        <tt class="function">getXXX()</tt> or <tt class="function">setXXX()</tt>
38        suitable for inclusion in a header file.
39    </p></li><li><p><tt class="filename">Preview_Javadoc_of_Buffer.bsh</tt></p><p>
40      Create and display API documentation for the current buffer.
41    </p><p>
42    The macro includes various configuration variables you can change; see the comment at the beginning of the macro source for details.
43  </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>