Reputation: 1655
I have this code which I want to indent:
int[] myArray =
{ 1, 2, 3, 4, 5, 6 };
int theInt = 1;
String someString = "Hello";
double aDouble = 3.0;
I want the above code to be column indented, like this:
int[] myArray = { 1, 2, 3, 4, 5, 6 };
int theInt = 1;
String someString = "Hello";
double aDouble = 3.0;
I have tried different options in:
Windows > Preferences > Java > Code Style > Formatter
but I was unable to find the settings for above.
The = should be placed in center with respect to alignment
Thanks for replying.
Upvotes: 0
Views: 532
Reputation: 422
Go to same link as you mention window->prefernces->java->codestyle->formatter
and Click on Edit
Button.
and click on Align fields in columns see in image
Edit:
you need to create new profile in eclipse on the same link. you can to change built in eclipse profile. see image.
Edit: Save Action:
Upvotes: 2
Reputation: 2753
You can use
CTRL+SHIFT+F
in eclipse to get the above format you have asked and also you can use
CTRL+A and then CTRL+I
to have correct indentation in eclipse.
Thanks, Ankit Shah
Upvotes: 0