Jindent - Java Source Code Formatter http://www.jindent.com
 



title

7 Jindent Plugins


Jindent can be integrated in the most common IDEs, text editors, version control systems and build tools.
Some of these integrations/plugins can be automatically installed through Jindent's installer and some have to be installed manually.

See the list below about Jindent's current plugin support:

IDEs

Name Installation
Eclipse installer
Netbeans installer
JDeveloper installer
IntelliJ IDEA installer
JBuilder installer


Text Editors

Name Installation
Text Pad manually
UltraEdit manually


Version Control System

Name Installation
CVS manually
WinCVS manually


Build Tools

Name Installation
Apache Ant installer



title

7.1 Eclipse Plugin


Introduction to Eclipse


Eclipse is an open source community whose projects are focused on providing an extensible development platform and application frameworks for building software. Eclipse provides extensible tools and frameworks that span the software development lifecycle, including support for modeling, language development environments for Java, C/C++ and others, testing and performance, business intelligence, rich client applications and embedded development. A large, vibrant ecosystem of major technology vendors, innovative start-ups, universities and research institutions and individuals extend, complement and support the Eclipse Platform.
Eclipse can be downloaded from: http://www.eclipse.org



Manual installation of Jindent's Eclipse plugin


If you have already used the Jindent installer to install the Jindent plugin for Eclipse then you can skip this section.

If not please proceed the following steps:
  1. In the Jindent installation directory you will find a /plugins/Eclipse31-36/ subdirectory. Change into this subdirectory and copy the located jar file to:
    $ECLIPSE_HOME_DIR/plugins/jindent.plugin.eclipse.4.x.x.jar
    or to:
    $ECLIPSE_HOME_DIR/dropins/jindent.plugin.eclipse.4.x.x.jar

That's all! The Eclipse plugin is installed now and you can start Eclipse to use the Jindent plugin.



Usage of Jindent's Eclipse plugin


Now start Eclipse to verify the proper installation of Jindent's plugin.

Formatting in Editor Window

If the Jindent plugin is installed properly then a Jindent menu item is available in the editor context menu of Eclipse. For verification open a file in the editor window. Click right button to open context menu. A menu item Format Editor Content With Jindent with the Jindent logo is now available.
Click on it to format your source code in current editor window.


Jindent menu item in editor's context menu
Jindent menu item in editor's context menu



Formatting in File Navigator

Click right button to open context menu in the file navigator. A menu item Format <filename> with the Jindent logo is available now.
Click on this item to format selected files or directories.


Jindent menu item in file navigator's context menu
Jindent menu item in file navigator's context menu



Configuring Jindent Settings

To configure Jindent's settings select menu item Preferences... in the Window menu. Now you can select item Jindent from the preferences tree.


Settings of Jindent plugin
Settings of Jindent plugin


To learn how to configure Jindent's settings and how to use Jindent's customizer please refer to section 'Settings' and 'Graphical User Interface' in this manual.
Of course the customizer's full preview and Help-On-Click support are enabled in this plugin!


Displaying Jindent Messages

Depending on the configuration of Jindent's settings several messages can appear after formatting process. In Eclipse these messages will be displayed in an integrated Jindent view. By clicking on a displayed message the corresponding editor opens up and shows the file causing this message.


Jindent messages, warnings and errors will be displayed in a view
Jindent messages, warnings and errors will be displayed in a view



Undo Jindent Formatting

All Jindent formattings are undo-able. To withdraw a formatting in the editor window just click on Undo in the Edit menu.


Click on Undo to withdraw Jindent's formatting
Click on Undo to withdraw Jindent's formatting



Add key shortcut for Jindent's formatting command

To enable a Jindent key shortcut to format the current editor content please select menu item Preferences... in the Window menu. Then click on tree item General and then item Keys.
Select command category Jindent - Source Code Formatter and Format Editor Content With Jindent as command name. Click on Editing Java Source in command's assignments section.
Now enter your prefered key sequence to invoke Jindent's command. The default value is CTRL + SHIFT + F. Finally choose key sequence assingment Editing Java Source - Format Editor Content With Jindent and click add button.


Choose Jindent's formatting command
Choose Jindent's formatting command



Click ok button to apply all new changes.


Connect Jindent's formatting command with your favourite key sequence
Connect Jindent's formatting command with your favourite key sequence



Now the key sequence binding is available in the Eclipse's Java editor.




Known Issues in Jindent's Eclipse plugin


Please note that Mac OS only supports a 100% proper version of an AWT-SWT bridge since JRE 1.5.0 Update 07. If you are a Mac OS user please use at least this version to run your Eclipse IDE. Otherwise a proper embedding of Swing components like Jindent's Eclipse preferences are not available on Mac operating systems.
Alternatively you can use the provided button to invoke Jindent's external Customizer to configure the Jindent plugin settings.
Note that you have to save your settings inside the Customizer to commit all changes to the Eclipse plugin.


On MacOS JRE older than version 1.5.0 Update 07 Jindent's preferences cannot be embedded into Eclipse
On MacOS JRE older than version 1.5.0 Update 07 Jindent's preferences cannot be embedded into Eclipse