blob: 99d737553d749d36089b44ef4cb604dfaddafe7d [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html>
<head>
<meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2005. 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">
<link rel="stylesheet" href="../book.css" charset="ISO-8859-1" type="text/css">
<title>
Setting code formatting preferences
</title>
<script language="JavaScript" src="PLUGINS_ROOT/org.eclipse.help/livehelp.js"> </script>
</head>
<body>
<h1>
Setting code formatting preferences
</h1>
<ol>
<li>
Open the
<a class="command-link" href='javascript:executeCommand("org.eclipse.ui.window.preferences(preferencePageId=org.eclipse.jdt.ui.preferences.CodeFormatterPreferencePage)")'>
<img src="PLUGINS_ROOT/org.eclipse.help/command_link.png">
<strong>Java &gt; Code Style &gt; Formatter</strong></a> preference page.
</li>
<li>
Select a profile and click the <strong>Show</strong> or <strong>Edit</strong> button to configure it, or press <strong>New</strong> to create a new profile.
</li>
<li>
In the dialog, select the code formatting conventions that you want the formatter to follow.
</li>
<li>
Note that at the right side of the page, you can observe an example effect of each individual code formatting option and see a preview of what your formatted code will look
like.
</li>
<li>
Click <strong>OK</strong> when you are done.
</li>
</ol>
<p>
<strong>Note:</strong> Code formatter settings can also be configured per project:
</p>
<ol>
<li>
Select a java project, open the pop-up menu and choose <strong>Properties</strong>.
</li>
<li>
Select the <strong>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>
</ol>
<p>
<img src="../images/ngrelc.png" alt="Related concepts" border="0">
</p>
<p>
<a href="../concepts/concepts-1.htm">Java development tools (JDT)</a>
</p>
<p>
<img border="0" src="../images/ngrelt.png" alt="Related tasks">
</p>
<p>
<a href="tasks-66.htm">Formatting Java code</a><br>
<a href="tasks-67.htm">Formatting files or portions of code</a><br>
<a href="tasks-230.htm">Using the Formatter Application</a>
</p>
<p>
<img border="0" src="../images/ngrelr.png" alt="Related reference">
</p>
<p>
<a href="../reference/ref-17.htm">Code Formatter preferences</a>
</p>
</body>
</html>