blob: ba91d21d73ab8c4525fb05f20c78fb5ec1911e4a [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html>
<head>
<meta name="copyright" content="Copyright (c) Red Hat Incorporated 2006. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." >
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css">
<title>
Generating a config file for the formatter application
</title>
<link rel="stylesheet" href="../book.css" charset="ISO-8859-1" type="text/css">
</head>
<body>
<h1>
Generating a config file for the formatter application
</h1>
<p>
Generating a config file for the formatter application involves modifying the code formatter settings
for a Java project and copying org.eclipse.jdt.core.prefs out of the .settings directory for that project.
</p>
<ol>
<li>
Select a Java project, open the pop-up menu and choose <strong>Properties</strong>.
</li>
<li>
Select the <strong>Java Code Style &gt; Formatter</strong> page and check <strong>Enable project specific settings</strong>.
</li>
<li>
Select or edit a profile as explained above.
</li>
<li>
Click <strong>OK</strong> when you are done.
</li>
<li>
Use either a file manager or the command line to copy <b><code>workspace/YourJavaProject/.settings/org.eclipse.jdt.core.prefs</code></b>
to a new location.
</li>
<li>
If the files you want to format are using 1.5 constructs, you must add the following lines inside the preference file you just created:
<blockquote><code>
org.eclipse.jdt.core.compiler.compliance=1.5<br>
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5<br>
org.eclipse.jdt.core.compiler.source=1.5<br>
</code>
</blockquote>
</li>
</ol>
<p>
<img src="../images/ngrelr.png" alt="Related reference" border="0" >
</p>
<p>
<a href="../reference/ref-17.htm">Code Formatter</a><br>
</p>
</body>
</html>