Java – how to set the default code format and template for a new workspace

Eclipse allows Java class files to use custom formats and templates The general way to change these settings is from the windows | Preferences menu and then the code style in the Java > Preferences dialog box The formatter controls how parentheses, indents, and so on work This template manages the types of file, class, and method titles that appear in new class files

I have two files for these settings. I must import and set them to take effect Sometimes I create a workspace and forget to set up a template Then format and select the wrong style or omit the boiler board if I don't capture it at check-in This will lead to non-standard files. If an error occurs, it may lead to merge conflicts with others, and vice versa

Can you easily modify eclipse to always use custom formats and templates by default when creating new workspaces? Even if I have to put XML somewhere in the eclipse folder and adjust some settings, I hope to be able to do this and provide the same instructions to the rest of my team

Solution

Look at workspace mechanical It synchronizes workspace properties on different workspaces So it's new You can copy the reference workspace configuration to the workspace mechanism directory and it will be automatically installed in the new workspace

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>