I am looking for a way indent the java source code automatically. I have a tool which generates java code from other language. Now, I want to indent the generated code. Please tell me how can I do that? in an other maner, how can i do exactely what ctl+shift+m do automatiquely? i can not use CTRL + SHIFT + F and CTRL + SHIFT + M
-
Possible duplicate of stackoverflow.com/questions/996646/…Guillaume Polet– Guillaume Polet2012-05-02 09:34:48 +00:00Commented May 2, 2012 at 9:34
-
I replaced the title question with something that actually had some relevance to the question you actually asked. In the future, please make sure the title and what you ask have some relationship.Ira Baxter– Ira Baxter2012-05-02 10:15:50 +00:00Commented May 2, 2012 at 10:15
3 Answers
As your tag says, you are using Eclipse , you can use CTRL + SHIFT + F to indent the code.
Moreover as you are asking about replacing fully qualified name to import statement then no such thing exists in Eclipse as of now. ( Correct me if I am wrong ).
But you can still select the fully qualified name and press CTRL + SHIFT + M to import the class.
1 Comment
See our Java Formatter for a tool that handles all dialects of Java, including version 7.
2 Comments
You can select a project/folder/package in Package Explorer and format all the contents in one go using Source > Format (Ctrl+Shift+F). Or you can also configure a Clean up or a Save Action.