platform-ui-home/code-conventions/index.html

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (view) (download) (as text)

1 : tod 1.1 <html>
2 : cmclaren 1.4 <head>
3 :     <title>Code Conventions for the Platform UI Team</title>
4 :     <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
5 :     <link rel="stylesheet" href="http://dev.eclipse.org/default_style.css" type="text/css">
6 :     </head>
7 :     <body bgcolor="#FFFFFF" text="#000000">
8 :     <table border=0 cellspacing=5 cellpadding=2 width="100%" >
9 :     <tr>
10 :     <td align=LEFT valign=TOP colspan="2" bgcolor="#0080C0">
11 :     <b><font color="#FFFFFF" face="Arial,Helvetica">Code Conventions for the Platform UI Team</font></b>
12 :     </td>
13 :     </tr>
14 :     <tr>
15 :     <td align=right valign=top width="2%">
16 :     <img src="http://dev.eclipse.org/images/Adarrow.gif" border=0 height=16 width=16 alt = "Eclipse idea banner">
17 :     </td>
18 :     <td width="98%">
19 : dpollock 1.7 <p>The main Eclipse coding conventions can be found <a href="http://dev.eclipse.org/conventions.html">here</a>.</p>
20 :     <p>The Platform UI team separates the issue of coding
21 :     conventions into two components: formatting, and compiler
22 :     warnings and errors.</p>
23 :     <p>For formatting, all of our code is formatted using the
24 :     built-in "Java Conventions" formatter provided by JDT. All
25 :     of imports should be organized using the default settings.
26 :     We discourage the use of the "Sort Memebers" functionality;
27 :     however, if you are creating new files, feel free to use it
28 :     if you wish. Do not use "Sort Members" on existing
29 :     code.</p>
30 :     <p>For compiler settings, we recommend changing the
31 :     following items from "Ignore" to "Warning". As a note, it
32 :     is required that all Platform UI code (excluding code in
33 :     "org.eclipse.ui.tests") does not contain non-externalized
34 :     strings.
35 :     <ul>
36 :     <li>Style</li>
37 :     <ul>
38 :     <li>Indirect access to a static member</li>
39 :     <li>Possible accidental boolean assignment</li>
40 :     <li>Undocumented empty block</li>
41 :     </ul>
42 :     <li>Advanced</li>
43 :     <ul>
44 :     <li>Local variable declaration hides another field
45 :     or variable</li>
46 :     <li>Field declaration hides another field or
47 :     variable</li>
48 :     <li>Usage of non-externalized strings</li>
49 :     </ul>
50 :     <li>Unused Code</li>
51 :     <ul>
52 :     <li>Local variable is never read</li>
53 :     <li>Unused or unread private members</li>
54 :     <li>Usage of deprecated API</li>
55 :     <li>Unnecessary semicolon</li>
56 :     <li>Unnecessary cast or 'instanceof' operation</li>
57 :     </ul>
58 :     </ul>
59 :     <p>These settings can be imported from this
60 :     <a href="codeConventions.epf">file</a>.
61 : cmclaren 1.4 </td>
62 :     </tr>
63 :     </table>
64 :     </body>
65 : tod 1.1 </html>