<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> <HTML> <HEAD> <META HTTP-EQUIV="Content-Type" CONTENT="text/html;CHARSET=iso-8859-1"> <TITLE>Software::Pretty Printer</TITLE> </HEAD> <BODY> <P> <TABLE BORDER="0"> <TR> <TD WIDTH="150" ALIGN="LEFT" VALIGN="TOP" ROWSPAN="3" BGCOLOR="#DDDDDD"> <IMG SRC="JRefactory.jpg" ALT="Author: Mike Atkinson"> <A HREF="chrissoft.html">Software</A> <BR> <UL> <LI> Pretty Printer<BR> <LI> <A HREF="csrefactory.html">JRefactory</A><BR> <LI> <A HREF="csprint.html">Printing</A> <BR> <LI> <A HREF="cselixirext.html">Elixir Extensions</A> <BR> <LI> <A HREF="cslineno.html">Line Numbering</A> <BR> <LI> <A HREF="csmetrics.html">Metrics</A> <BR> <LI> <A HREF="csstub.html">Stub Generator</A> <BR> <LI> <A HREF="csdevutil.html">Dev Utilities</A> <BR> <LI> <A HREF="csr-roadmap.html">Roadmap</A> <BR> <LI> <A HREF="csrtodo.html">Requested Features</A> <BR> </UL> <A HREF="csr-releasenotes.html">Release Notes</A> <BR> <A HREF="chrisdown.html"><B>Download</B></A> <BR> <B><A HREF="authors.html">Contributors</A></B> <BR> </TD> <TD WIDTH="35" ALIGN="LEFT" VALIGN="TOP"> <P><A HREF="cspretty.html"><IMG SRC="left.gif" WIDTH="30" HEIGHT="30" ALIGN="BOTTOM" ALT="Previous Page" BORDER="2"></A> </TD> <TD ALIGN="CENTER"> <H2 ALIGN="CENTER">Software::Pretty Printer - IDE plugins </TD> <TD WIDTH="35" ALIGN="RIGHT" VALIGN="TOP"> <P ALIGN="RIGHT"><A HREF="ant-task.html"><IMG SRC="right.gif" WIDTH="30" HEIGHT="30" ALIGN="BOTTOM" ALT="Next Page" BORDER="2"></A> </TD> </TR> <TR> <TD COLSPAN="3"> <H4>Elixir IDE</H4> <P>Installation depends on the version of Elixir that you have.</P> <P><B>Version 2.4</B> If you have version Elixir version 2.4, then you place the jrefactory.jar file in <EM><Your Home Directory></EM><tt>/.ElixirIDE/2.4/ext</tt>.</P> <P><B>Version 2.2</B> If you have version 2.2, then add jrefactory.jar to your classpath. Then add the jrefactory.jar file to your classpath. You also need to edit the file named ide.scm in <EM><Your Home Directory></EM><tt>/.ElixirIDE/2.2</tt>. Add the following lines to the end of the file.</P> <TT> <PRE> ; Chris's Extensions start here (define prettyprint (method "prettyPrint" "org.acm.seguin.pretty.ElixirPrettyPrinter") ) (add-menu-item "Script|-") (add-menu-item "Script|Pretty Printer=(prettyprint)") (println "Done Chris's extensions") </PRE> </TT> <P><B>Version 2.0 or earlier</B> If you are using Elixir IDE 2.0 or earlier, and you want to use the latest release of the pretty printer, please contact me.</P> <P>With any version of Elixir IDE, to use the pretty printer select the Script menu item, then select Pretty Printer while the current window hold a java file.</P> <H4>NetBeans</H4> <P>To install this software, install the file JRefactoryModule.jar in the module directory.</P> <P>To use this software, open the .java file and the pretty printer option appears on the tools menu.</P> <H4>Symantec Visual Cafe</H4> <P>Note that this software is somewhat experimental.</P> <P>To install the software with Symantec's Visual Cafe version 3.0, place jrefactory.jar in <EM><Visual Cafe Directory></EM><tt>/bin/components</tt>. Then edit the sc.ini file in <EM><Visual Cafe Directory></EM><tt>/bin</tt>. Add to the end of the line that specifies the classpath, the following: </P> <TT> <PRE> ;%@P%\COMPONENTS\jrefactory.jar </PRE> </TT> <P>Once you restart Symantec's Visual Cafe, there will be a new menu option "Extensions" with one item "Pretty Printer". To run the pretty printer on the current viewed file, select Pretty Printer from the menu.</P> <P>Note for Visual Cafe only, the <A HREF="csprettysettings.html">pretty.settings</A> file is located in <TT>c:\visualcafe\.refactory</TT>.</P> <P>For Visual Cafe 4.0, there seems to be a problem reading a file from a disk, so I am unable to read the settings files. I'm working on this problem.</P> <H4>JBuilder 3.0 Foundation or JBuilder 3.5 or JBuilder 4.0</H4> <P>To use the pretty printer with JBuilder, the jrefactory.jar in <EM>JBuilderDir</EM>/lib/ext. See the file jbuilder.txt for more specific information.</P> <H4>JBuilder 3.0</H4> <P>To use the pretty printer with JBuilder, you will need to create a batch file. This file takes one input. It sets the classpath to include the pretty printer, and then runs the pretty printer on the input file. Here is a sample batch file.</P> <TT> <PRE> set classpath=c:\jars\jrefactory.jar java PrettyPrinter %1 </PRE> </TT> <P>Then edit the tools.cfg file in <EM><JBuilder Directory></EM><TT>/bin</TT> directory. You should add the following 4 lines to the end of the file.</P> <TT> <PRE> Pretty Printer c:\bin\pretty.bat . $(NodeName) </PRE> </TT> <P>Note that the second line is the path to the pretty printer batch file that you created. Also, each item in the tools.cfg file consists of 4 lines. The calculator item has nothing in the fourth line (it doesn't need anything).</P> <P>To use the pretty printer, save the file to disk. Then select tools from the menu and pretty printer.</P> <P>Debugging: If you don't see Pretty Printer on the tools menu and instead see "c:\bin\pretty.bat", then you need to insert a blank line before the PrettyPrinter line.</P> <H4>Kawa 5</H4> <P>This plugin is for Kawa 5 and will not work on previous versions though it will be fairly easy to port. I decided to write this plugin since I used to write my code in Kawa and then reopen it with the slow java editor jEdit just to add code comments. So one night I spend some minutes in creating this simple plugin and now I have pretty print feature in my Kawa - thanks to folks who created jrefactory (http://jrefactory.sf.net/).</P> <P>Instructions for installation:</P> <OL> <LI> Extract jrefactory.jar in <KAWA>\plugin directory. <LI> From "Customize" menu select "Commands" and then "Plugin Command" <LI> Press button "New" and write down "KawaPrettyPrint" for "Menu Name" <LI> Set "Main Class" to "org.acm.seguin.ide.kawa.KawaPrettyPrint" <LI> If you wish KawaPrettyPrint to automaticaly beautify your source on file save set "Arguments" to "-install" (without quotes) <LI> If you set "Arguments" to -install you may open Options tab and select "Execute command when Kawa starts". If you didn't set -install option then you may wish to select "Add command to right button menu in editor" <LI> Enjoy! </OL> <H4>jDeveloper 9i </H4> <P>This plugin is for Oracles jDeveloper 9.0.2 and will not work on previous versions.</P> <P>Installation and usage:</P> <OL> You only have to copy jrefactory.jar into <JDEV_HOME>/jdev/lib/ext directory. <br> (Re)Start jDeveloper, in the editor pane right-click on a Java file and choose "Reformat Code".<br> To configure the PrettyPrinter choose "PrettyPrinter Options" in the Tools menu.<br> <br> If you are working on a development team, you may want to have only one responsible person for configuring the PrettyPrinter settings.<br> If you want to do so, you can create a file ".NoConfig" in the <JDEV_HOME>/jdev/lib/ext/.Refactory dir.<br> With an existing ".NoConfig" file no "PrettyPrinter Options" menu item is shown in the Tools menu. </OL> </TD> </TR> <TR> <TD WIDTH="35"><A HREF="cspretty.html"><IMG SRC="left.gif" WIDTH="30" HEIGHT="30" ALIGN="BOTTOM" ALT="Previous Page" BORDER="2"></A></TD> <TD ALIGN="CENTER"> <P ALIGN="CENTER"><FONT SIZE="2" COLOR="#AAAAAA">Last Modified: October 7, 2003</FONT> </TD> <TD WIDTH="35" ALIGN="RIGHT"> <P ALIGN="RIGHT"><A HREF="ant-task.html"><IMG SRC="right.gif" WIDTH="30" HEIGHT="30" ALIGN="BOTTOM" ALT="Previous Page" BORDER="2"></A> </TD> </TR> </TABLE> </BODY> </HTML>