Why struggle through messy code when you can beautify it quickly, easily and on the fly? With Polystyle you can beautify your files within moments and easily view
and edit your code without struggling through someone else's unorthodox coding style.
Polystyle is a source code beautifier provided with Multi-Edit v9.10 which learns your personal formatting style by
examining examples of your code. Since Polystyle learns your
style by looking at samples of code you've formatted, it's not only intuitive to use, but easily flexes it
muscles with the styles it can format.
Polystyle provides several predefined styles as well as a GUI
Configuration Tool making setup quick and easy. Languages which are currently supported include C/C++, C#,
CMAC, CSS, HTML, Java, JavaScript, JSP, PHP, Pascal/Delphi, Perl, Python.
Worried about using Polystyle from within ME? Don't! It's a snap. Simply click on Tools | Format
Code and Polystyle will do the rest. Once you've run
through the setup, your code formatter configurations are easily accessed by selecting Tools | Config
Code Formatter.
**********************************************
**********Polystyle Walkthrough*****************
Polystyle Is Simple To Use
In this walkthough you'll be taken through the short steps it takes to define your style and format your
source code.
Unformatted Source
Let's start with a simple use case. Imagine you have the following java code you want to format:
//new
item = new JMenuItem("New");
item.setMnemonic(KeyEvent.VK_N);
item.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
System.out.println("New window");
framework.makeNewWindow();
}
});
menu.add(item);
...
Reformatted Result
Polystyle uses examples of code to find out how you
like your code styled. You may either use the Graphical Styler to style your example file using
mouse clicks alone, or you may edit your example file directly for more control over your style. Let's
use Polystyle's predefined 2-space indent GNU style
to format our file.
(Note that you can also edit your example file directly and customize your style.) Here's the result:
//new
item = new JMenuItem ("New");
item.setMnemonic (KeyEvent.VK_N);
item.addActionListener (new ActionListener()
{
public
void
actionPerformed (ActionEvent e)
{
System.out.println ("New window");
framework.makeNewWindow ();
}
});
menu.add (item);
...
Configuring Polystyle - Step 1: Define Your Examples
When you install Polystyle, the Configuration Tool is invoked to allow you
to define your personal style. You have several options to do this.
Option 1 allows you to define your style easily using the Graphical Styler
and create a consistent style without having to edit an example file.
Option 2 allows you maximum flexibility, by editing the example
files, you can define nearly any style imaginable.
Option 3 allows you to quickly select a predefined
industry-standard style without having to edit any configuration files.
Option 4 allows you browse all the Polystyle's prepackaged styles.
Option 1: Define Styles using the Graphical Styler
The Graphical Styler has several categories of options for each style. When
you click a style option, the preview is instantly recreated.
Configuring Polystyle - Step 2: Set Global Preferences
Here you may quickly set up various preferences, as shown below:
Configuring Polystyle - Step 3: Run Polystyle
There are a number of ways to invoke Polystyle, as shown below:

Take Polystyle For A Spin!
Polystyle has a demo version if you haven't had a
chance to check it out yet. Use the link below.
[ ...Download... ]
**********END Polystyle Walkthrough*************
**********************************************
Special Note
Multi-Edit users will find a new Support Forum Topic, "Polystyle"
at the following link:
http://www.multiedit.com/forums/viewforum.php?f=19
Multi Edit Software, Inc. and Polystyle would like to
request that our Polystyle users take a moment to view this newly created forum topic and provide us with your
comments, feature requests, bug reports and questions. Your participation in the forum discussions on
Polystyle will help us to mold the product to better fit your needs and to address problems or questions which
may arise with using Polystyle.
Until next time,
The Support Team
As always, any suggestions for a future tech article are always welcome at the following email address:
Team Email: support@multieditsoftware.com