Is it possible to configure IDEA to use MY code style?


This is definitely not a top priority in any sense so if you guys are
busy with something more important please just disregard my question
It seems that your code template engine must be able to adopt a
coding style like the one below. The only difference is that class/method
etc.
names are located on separate lines and indented from Java keywords.
Multiple "if" conditions are also on separate lines with operator (&&, ||)
under
the "if" (it's actually a common rule: continuation string starts with
operator
aligned with the "=", "if" etc.)
I've been using this coding style for years and actually can recommend it to
anyone
because:

1. It's very ergonomic. You don't need to read something unreadable like
abstract public class ClassName extends BaseClass implements Interface1,
Interface2, ....
to catch the class name[s]. It's a well known fact that human eyes can
recognize shapes
much better than anything else. When you have to read a lot of code it
can
be very helpful.

2. It's very easy to use all sorts of macro/template processors with this
style.
A lazy guy like myself would prefer to invest a little effort and
generate up to 50%
of a big project code (like all object model and DB mapping classes)
automatically
rather than manually write and maintain thousands lines of
source code,
but again sometime it requires a machine-readable coding style....

3. I think it's more elegant (especially when you get used to it :-).

So is it difficult to make IDEA generate this?

Thanks in advance, Oleg
=======================================================================
package apm.form;

import java.util.*;
import java.util.List;

import java.awt.*;
import javax.swing.*;

import apm.layout.*;
import apm.common.*;

//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%/**

  • Created by IntelliJ IDEA.

  • User: oleg

  • Date: Nov 21, 2002

  • Time: 2:03:43 PM

  • To change this template use Options | File Templates.

*/
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%public class
ContainerForm
extends
ComponentForm
implements
IForm,
IComponent
{
//==========================================================================
====
protected Map formData = null;

//==========================================================================
public
ContainerForm(String name)
throws
IllegalArgumentException,
IllegalStateException
{
super(name);
........................
}

//----


/package/
ContainerForm(String name, Form[][] forms)
{
this(name);
init(forms);
}

//**************************************************************************
/package/ void
init(Form[][] forms)
{
int rows, cols;
...................
if(rows == 1
&& cols == 1)
layout = new MatrixCellLayout();
else if(rows == 1)
layout = new MatrixRowLayout(cols);
else if(cols == 1)
layout = new MatrixColumnLayout(rows);
else
layout = new MatrixLayout(rows, cols);
............................
xxx = yyy + zzz
+ aaa + bbb;
}
//==========================================================================
====
}//Field
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%



Please sign in to leave a comment.