View | Details | Raw Unified | Return to bug 75333 | Differences between
and this patch

Collapse All | Expand All

(-)plugin.xml (-1 / +12 lines)
Lines 164-170 Link Here
164
	<fileTypes extension="jardesc" type="text"/>
164
	<fileTypes extension="jardesc" type="text"/>
165
	<fileTypes extension="zip" type="binary"/>
165
	<fileTypes extension="zip" type="binary"/>
166
</extension>
166
</extension>
167
      
167
168
<!-- =================================================================================== -->
169
<!-- Extension: Java Code Formatter                                                      -->
170
<!-- =================================================================================== -->
171
<extension
172
      id="JavaCodeFormatter"
173
      point="org.eclipse.core.runtime.applications">
174
      	<application>
175
      		<run class="org.eclipse.jdt.core.formatter.CodeFormatterApplication" />
176
		</application>
177
</extension>
178
168
<!-- =================================================================================== -->
179
<!-- =================================================================================== -->
169
<!-- Extension: Java Content Types                                                       -->
180
<!-- Extension: Java Content Types                                                       -->
170
<!-- =================================================================================== -->
181
<!-- =================================================================================== -->
(-)formatter/org/eclipse/jdt/core/formatter/CodeFormatter.java (-1 / +1 lines)
Lines 79-85 Link Here
79
	 *      level of zero or below has no effect.
79
	 *      level of zero or below has no effect.
80
	 * @param lineSeparator the line separator to use in formatted source,
80
	 * @param lineSeparator the line separator to use in formatted source,
81
	 *     if set to <code>null</code>, then the platform default one will be used.
81
	 *     if set to <code>null</code>, then the platform default one will be used.
82
	 * @return the text edit
82
	 * @return the text edit or <code>null</code> if the given string cannot be formatted.
83
	 * @throws IllegalArgumentException if offset is lower than 0, length is lower than 0 or
83
	 * @throws IllegalArgumentException if offset is lower than 0, length is lower than 0 or
84
	 * length is greater than source length.
84
	 * length is greater than source length.
85
	 */
85
	 */
(-)formatter/org/eclipse/jdt/core/formatter/FormatterAppMessages.properties (+43 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2004 Ben Konrath <ben@bagu.org>
3
 * All rights reserved. This program and the accompanying materials 
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 * 
8
 * Contributors:
9
 *     Ben Konrath <ben@bagu.org> - initial implementation
10
 *******************************************************************************/
11
12
CommandLine.start=Starting format job ...
13
CommandLine.done=Done.
14
CommandLine.config.file=Configuration Name: {0}
15
CommandLine.formatting=Formatting: {0}
16
17
CommandLine.usage=Usage: {0} [ OPTIONS ] <files>
18
19
CommandLine.files=<files>
20
CommandLine.files.msg1=Java source files and/or directories to format.
21
CommandLine.files.msg2=Only files ending with {0} will be formatted in the given directory.
22
23
CommandLine.options=OPTIONS:
24
CommandLine.config={0} <file>
25
CommandLine.config.msg1=Use the formatting style from the specified properties file.
26
CommandLine.config.msg2=Refer to the help documentation to find out how to generate this file.
27
CommandLine.help=Display this message.
28
CommandLine.quiet=Only print error messages.
29
CommandLine.verbose=Be verbose about the formatting job.
30
31
CommandLineError.file={0} does not exsit. Please specify only valid Java Source files.
32
CommandLineError.config=There was problem reading the config file, {0}.
33
CommandLineError.file.dir=You must specify at least one file or dirctory to format.
34
CommandLineError.quiet.verbose=You cannot use the options {0} and {1} together.
35
36
Exception.io=Caught IOExecption:
37
Exception.bad.location=Caught BadLocationException:  
38
Exception.skip=Skipping File.
39
40
ConfigFile.reading.error=Error Reading config file.
41
42
Edit.problem=The Eclipse formatter had a problem {0}, Skipping.
43
(-)formatter/org/eclipse/jdt/core/formatter/CodeFormatterApplication.java (+317 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2004 Ben Konrath <ben@bagu.org>
3
 * Copyright (c) 2006 Red Hat Incorporated
4
 * All rights reserved. This program and the accompanying materials 
5
 * are made available under the terms of the Eclipse Public License v1.0
6
 * which accompanies this distribution, and is available at
7
 * http://www.eclipse.org/legal/epl-v10.html
8
 * 
9
 * Contributors:
10
 *     Ben Konrath <ben@bagu.org> - initial implementation
11
 *     Red Hat Incorporated - improvements based on comments from JDT developers
12
 *******************************************************************************/
13
14
package org.eclipse.jdt.core.formatter;
15
16
import java.io.BufferedReader;
17
import java.io.BufferedWriter;
18
import java.io.File;
19
import java.io.FileInputStream;
20
import java.io.FileReader;
21
import java.io.FileWriter;
22
import java.io.IOException;
23
import java.io.Writer;
24
import java.text.MessageFormat;
25
import java.util.ArrayList;
26
import java.util.MissingResourceException;
27
import java.util.Properties;
28
import java.util.ResourceBundle;
29
30
import org.eclipse.core.runtime.IPlatformRunnable;
31
import org.eclipse.core.runtime.Platform;
32
import org.eclipse.jdt.core.ToolFactory;
33
import org.eclipse.jdt.internal.core.util.Util;
34
import org.eclipse.jface.text.BadLocationException;
35
import org.eclipse.jface.text.Document;
36
import org.eclipse.jface.text.IDocument;
37
import org.eclipse.text.edits.TextEdit;
38
39
/**
40
 * Implements an Eclipse Application for org.eclipse.jdt.core.JavaCodeFormatter.
41
 * 
42
 * There are a couple improvments that could be made:
43
 * 1. Make a list of all the files first so that a file does not get formatted twice.
44
 * 2. Use a text based progress monitor for output.
45
 * 
46
 * @author Ben Konrath <bkonrath@redhat.com>
47
 * @since 3.2
48
 */
49
public class CodeFormatterApplication implements IPlatformRunnable {
50
51
    /**
52
     * Deals with the messages in the properties file (cut n' pasted from a
53
     * generated class).
54
     */
55
    private final static class FormatterAppMessages {
56
        private static final String BUNDLE_NAME = "org.eclipse.jdt.core.formatter.FormatterAppMessages";//$NON-NLS-1$
57
58
        private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
59
60
        public static String getString(String key) {
61
            try {
62
                return RESOURCE_BUNDLE.getString(key);
63
            } catch (MissingResourceException e) {
64
                return '!' + key + '!';
65
            }
66
        }
67
68
        public static String getFormattedString(String key, String arg) {
69
            return getFormattedString(key, new String[] { arg });
70
        }
71
72
        public static String getFormattedString(String key, String[] args) {
73
            return MessageFormat.format(getString(key), args);
74
        }
75
    }
76
77
    /**
78
     * Return a Java Properties file representing the options that are in the specified config file.
79
     */
80
    public Properties readConfig(String filename) {
81
    	FileInputStream reader = null;
82
        try {
83
            reader = new FileInputStream(new File(filename));
84
            final Properties formatterOptions = new Properties();
85
            formatterOptions.load(reader);
86
            return formatterOptions;
87
        } catch (IOException e) {
88
            Util.log(e, FormatterAppMessages.getString("ConfigFile.reading.error")); //$NON-NLS-1$
89
        } finally {
90
        	try { 
91
        		if (reader != null) 
92
        			reader.close();  
93
        	} catch (IOException e) { /* ignore */ }
94
        }
95
        return null;
96
    }
97
    
98
    /**
99
     * Runs the Java code formatter application
100
     */
101
    public Object run(Object args) throws Exception {
102
        
103
        ArrayList fileList = processCommandLine((String[]) args);
104
        
105
        // nothing to do
106
        if (fileList == null || fileList.isEmpty())
107
        	return EXIT_OK;
108
       
109
        if (!quiet) {
110
        	if (configName != null)
111
        		System.out.println(FormatterAppMessages.getFormattedString("CommandLine.config.file", configName)); //$NON-NLS-1$
112
            System.out.println(FormatterAppMessages.getString("CommandLine.start")); //$NON-NLS-1$
113
        }
114
        
115
        // format the list of files and/or directories
116
        while (!fileList.isEmpty()) {
117
        	File file = (File) fileList.remove(0);
118
        		
119
            if (file.isDirectory())
120
                formatDirTree(file);
121
            else
122
                formatFile(file);    
123
        }
124
        
125
        if (!quiet) {
126
            System.out.println(FormatterAppMessages.getString("CommandLine.done")); //$NON-NLS-1$
127
        }
128
        
129
        return EXIT_OK;
130
    }
131
132
    private void displayHelp(String message) {
133
        System.err.println(message);
134
        System.out.println(""); //$NON-NLS-1$
135
        displayHelp();
136
    }
137
138
    private String configName;
139
    
140
    /*
141
     * The output will look like this:
142
     * 
143
     * "Usage: eclipse -application org.eclipse.jdt.core.JavaCodeFormatter [ OPTIONS ] <files>
144
     *     <files>		Java source files and/or directories to format.
145
     *					Only files ending with .java will be formatted in the given directory.
146
     *  OPTIONS:
147
     *	   -config <file>		Use the formatting style from the specified properties file.
148
     *							Refer to the help documentation to find out how to generate this file..
149
     *     -help				Display this message.
150
     *     -quiet				Only print error messages.
151
     *	   -verbose				Be verbose about the formatting job.   
152
     */
153
    private void displayHelp() {
154
        String binaryName = Platform.getOS().equals(Platform.OS_WIN32) ? "eclipse.exe" : "eclipse"; //$NON-NLS-1$ //$NON-NLS-2$
155
156
        // this is UG-LY. is there a way to make this look nicer?
157
        System.out.println(FormatterAppMessages.getFormattedString("CommandLine.usage", //$NON-NLS-1$
158
        		binaryName + " -application org.eclipse.jdt.core.JavaCodeFormatter")); //$NON-NLS-1$
159
        System.out.println(""); //$NON-NLS-1$
160
        
161
        System.out.println("   " + FormatterAppMessages.getString("CommandLine.files") //$NON-NLS-1$ //$NON-NLS-2$
162
                + "\t" + FormatterAppMessages.getString("CommandLine.files.msg1")); //$NON-NLS-1$ //$NON-NLS-2$
163
        System.out.println("\t\t" + FormatterAppMessages.getFormattedString("CommandLine.files.msg2", ".java")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
164
        
165
        System.out.println(FormatterAppMessages.getString("CommandLine.options")); //$NON-NLS-1$
166
        System.out.println("   " + FormatterAppMessages.getFormattedString("CommandLine.config", ARG_CONFIG) //$NON-NLS-1$ //$NON-NLS-2$ 
167
        		+ "\t" + FormatterAppMessages.getString("CommandLine.config.msg1")); //$NON-NLS-1$ //$NON-NLS-2$
168
        System.out.println("\t\t\t" + FormatterAppMessages.getString("CommandLine.config.msg2")); //$NON-NLS-1$ //$NON-NLS-2$
169
        System.out.println("   " + ARG_HELP + "\t\t" + FormatterAppMessages.getString("CommandLine.help")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
170
        System.out.println("   " + ARG_QUIET + "\t\t" + FormatterAppMessages.getString("CommandLine.quiet")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
171
        System.out.println("   " + ARG_VERBOSE +"\t\t" + FormatterAppMessages.getString("CommandLine.verbose")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ 
172
    }
173
    
174
    private final String ARG_HELP =    "-help"; //$NON-NLS-1$
175
    private final String ARG_CONFIG =  "-config"; //$NON-NLS-1$
176
    private final String ARG_VERBOSE = "-verbose"; //$NON-NLS-1$
177
    private final String ARG_QUIET = "-quiet"; //$NON-NLS-1$
178
    private boolean verbose = false;
179
    private boolean quiet = false;
180
    
181
    private ArrayList processCommandLine(String[] argsArray) {
182
183
        ArrayList args = new ArrayList();
184
        for (int i = 0; i < argsArray.length; i++) {
185
			args.add(argsArray[i]);
186
		}
187
        
188
        // look for flag-like args
189
        if (args.remove(ARG_HELP)) {
190
            displayHelp();
191
            return null;
192
        }
193
        if (args.remove(ARG_VERBOSE))
194
            verbose = true;
195
        if (args.remove(ARG_QUIET)) 
196
        	quiet = true;
197
        
198
        if (quiet && verbose) {
199
        	displayHelp(FormatterAppMessages.getFormattedString
200
        			("CommandLineError.quiet.verbose", new String[] {ARG_QUIET, ARG_VERBOSE})); //$NON-NLS-1$
201
        	return null;
202
        }
203
        args.remove("-pdelaunch"); //$NON-NLS-1$
204
205
        // look for flag/param args
206
        int index = args.indexOf(ARG_CONFIG);
207
        if (index >= 0) {
208
            args.remove(index);
209
            String configFile = (String) args.remove(index);
210
            options = readConfig(configFile);
211
            if (options == null) {
212
                displayHelp(FormatterAppMessages.getFormattedString("CommandLineError.config", configFile)); //$NON-NLS-1$
213
                return null;
214
            }
215
        }
216
217
        // only the files and directories should remain
218
        ArrayList fileList = new ArrayList();
219
        while (!args.isEmpty()) {
220
			String fileName = (String) args.remove(0);
221
			File file = new File(fileName);
222
			if (file.exists()) {
223
				fileList.add(file);
224
			} else {
225
				displayHelp(FormatterAppMessages
226
					.getFormattedString("CommandLineError.file", fileName)); //$NON-NLS-1$
227
				return null;
228
			}
229
		}
230
        
231
        if (fileList.isEmpty())
232
        	displayHelp(FormatterAppMessages.getString("CommandLineError.file.dir")); //$NON-NLS-1$
233
        	
234
        return fileList;
235
    }
236
237
    /**
238
     * Recursively format the Java source code that is contained in the
239
     * directory rooted at dir.
240
     */
241
    private void formatDirTree(File dir) {
242
243
        File[] files = dir.listFiles();
244
        if (files == null)
245
            return;
246
247
        for (int i = 0; i < files.length; i++) {
248
            File file = files[i];
249
            if (file.isDirectory()) {
250
                formatDirTree(file);
251
            } else if (file.getPath().endsWith(".java")) { //$NON-NLS-1$
252
                formatFile(file);
253
            }
254
        }
255
    }
256
257
    private Properties options = null;
258
259
    /**
260
     * Format the given Java source file.
261
     */
262
    private void formatFile(File file) {
263
        
264
        IDocument doc = new Document();
265
        try {
266
            // read the file
267
            final BufferedReader in = new BufferedReader(new FileReader(file));
268
            if (verbose) {           
269
                System.out.println(FormatterAppMessages.getFormattedString
270
                		("CommandLine.formatting", file.getName())); //$NON-NLS-1$
271
            }
272
            String line;
273
            String contents = ""; //$NON-NLS-1$
274
            try {
275
                while ((line = in.readLine()) != null)
276
                    contents = contents + System.getProperty("line.separator") + line; //$NON-NLS-1$
277
            } finally {
278
                try { in.close(); } catch (IOException e) { /* ignore */  }
279
            }
280
          
281
            // format the file (the meat and potatoes)
282
            doc.set(contents);
283
            TextEdit edit = ToolFactory.createCodeFormatter(options).format(CodeFormatter.K_COMPILATION_UNIT, 
284
            		doc.get(), 0, doc.getLength(), 0, null);
285
            if (edit != null) {
286
                edit.apply(doc);
287
            } else {            	
288
                System.err.println(FormatterAppMessages.getFormattedString("Edit.problem", file.getName())); //$NON-NLS-1$
289
                return;
290
            }
291
292
            // write the file
293
            final Writer out = new BufferedWriter(new FileWriter(file, false));
294
            try {
295
                out.write(doc.get());
296
                out.flush();
297
            } finally {
298
                try { out.close(); } catch (IOException e) { /* ignore */ }
299
            }
300
            
301
        } catch (IOException e) {
302
            String errorMessage = FormatterAppMessages.getString("Exception.io") + " " //$NON-NLS-1$ //$NON-NLS-2$
303
            	+ e.getLocalizedMessage();
304
            Util.log(e, errorMessage);
305
            System.err.println(errorMessage); 
306
            System.err.println(FormatterAppMessages.getString("Exception.skip")); //$NON-NLS-1$
307
            
308
        }  catch (BadLocationException e) {
309
            String errorMessage = FormatterAppMessages.getString("Exception.bad.location") + " " //$NON-NLS-1$ //$NON-NLS-2$
310
    			+ e.getLocalizedMessage();
311
            Util.log(e, errorMessage);
312
            System.err.println(errorMessage); 
313
            System.err.println(FormatterAppMessages.getString("Exception.skip")); //$NON-NLS-1$
314
        }
315
    }
316
317
}
(-)tasks/tasks-68.htm (+1 lines)
Lines 64-69 Link Here
64
    <p>
64
    <p>
65
      <a href="tasks-66.htm">Formatting Java code</a><br>
65
      <a href="tasks-66.htm">Formatting Java code</a><br>
66
       <a href="tasks-67.htm">Formatting files or portions of code</a>
66
       <a href="tasks-67.htm">Formatting files or portions of code</a>
67
       <a href="tasks-230.htm">Using the Formatter Application</a>
67
    </p>
68
    </p>
68
    <p>
69
    <p>
69
      <img border="0"  src="../images/ngrelr.png" alt="Related reference">
70
      <img border="0"  src="../images/ngrelr.png" alt="Related reference">
(-)topics_Tasks.xml (+5 lines)
Lines 310-313 Link Here
310
		</topic>
310
		</topic>
311
	</topic>
311
	</topic>
312
	<anchor id="t_scrapbook" />
312
	<anchor id="t_scrapbook" />
313
	<topic label="Using the Formatter Application" href="tasks/tasks-230.htm">
314
			<topic label="Running the Formatter Application" href="tasks/tasks-231.htm"></topic>
315
			<topic label="Generating a config file for the Formatter Application" href="tasks/tasks-232.htm"></topic>
316
	</topic>
317
	
313
</toc>
318
</toc>
(-)tasks/tasks-231.htm (+78 lines)
Added Link Here
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
2
<html>
3
  <head>
4
<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." >
5
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
6
    <meta http-equiv="Content-Style-Type" content="text/css">
7
    <title>
8
      Running the Formatter Application
9
    </title>
10
    <link rel="stylesheet" href="../book.css" charset="ISO-8859-1" type="text/css">
11
  </head>
12
  <body>
13
    <h1>
14
      Running the Formatter Application
15
    </h1>
16
    <p>
17
    Running the Formatter Application is as simple as running the org.eclipse.jdt.core.JavaCodeFormatter application from the commandline:
18
    <pre>
19
    eclipse -vm &lt;path to virtual machine&gt; -application org.eclipse.jdt.core.JavaCodeFormatter [ OPTIONS ] &lt;files&gt;
20
    </pre>
21
    <table border="1" cellspacing="0" cellpadding="5" width="600">
22
      <tr>
23
        <td width="25%">&lt;files&gt;</td> 
24
        <td>Java source files and/or directories to format. Only files ending with .java will be formatted in the given directory.</td>
25
      </tr>
26
    </table>
27
    </p>
28
    <p>
29
    <table border="1" cellspacing="0" cellpadding="5" width="600">
30
    	<thead>
31
		<tr>
32
			<th><p>OPTIONS</p></th>
33
			<th><p>Description</p></th>
34
		</tr>
35
	    </thead>
36
	    <tbody>
37
		<tr>
38
			<td valign="top" width="25%"><p>-config &lt;file&gt;</p></td>
39
			<td valign="top"><p>Use the formatting style from the specified properties file. 
40
			                    Refer to <a href="tasks-232.htm">Generating a config file for the Formatter Application</a>
41
			                    for details.</p>
42
			</td>
43
		</tr>
44
		<tr>
45
			<td valign="top" width="25%"><p>-help</p></td>
46
			<td valign="top"><p>Display the help message.</p>
47
			</td>
48
		</tr>
49
		<tr>
50
			<td valign="top" width="25%"><p>-quiet</p></td>
51
			<td valign="top"><p>Only print error messages.</p>
52
			</td>
53
		</tr>
54
		<tr>
55
			<td valign="top" width="25%"><p>-verbose</p></td>
56
			<td valign="top"><p>Be verbose about the formatting job.</p>
57
			</td>
58
		</tr>
59
		</tbody>
60
	</table>
61
    </p>
62
    
63
    <p>
64
      <img src="../images/ngrelt.png" alt="Related tasks" border="0" >
65
    </p>
66
    <p>
67
      <a href="tasks-66.htm">Formatting Java Code</a><br>
68
    </p>
69
    <p>
70
      <img src="../images/ngrelr.png" alt="Related reference" border="0" >
71
    </p>
72
    <p>
73
      <a href="../reference/ref-17.htm">CodeFormatter</a><br>
74
    </p>
75
    
76
  </body>
77
</html>
78
(-)tasks/tasks-232.htm (+58 lines)
Added Link Here
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
2
<html>
3
  <head>
4
<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." >
5
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
6
    <meta http-equiv="Content-Style-Type" content="text/css">
7
    <title>
8
      Generating a config file for the Formatter Application
9
    </title>
10
    <link rel="stylesheet" href="../book.css" charset="ISO-8859-1" type="text/css">
11
  </head>
12
  <body>
13
    <h1>
14
      Generating a config file for the Formatter Application
15
    </h1>
16
    <p>
17
    Generating a config file for the Formatter Application involves modifying the code formatter settings
18
    for a Java Project and copying org.eclipse.jdt.core.prefs out of the .settings directory for that project.
19
    </p>
20
    <ol>
21
      <li>
22
        Select a java project, open the pop-up menu and choose <strong>Properties</strong>.
23
      </li>
24
25
      <li>
26
        Select the <strong>Code Style &gt; Formatter</strong> page and check <strong>Enable project specific sttings</strong>.
27
      </li>
28
      <li>
29
        Select or edit a profile as explained above.
30
      </li>
31
32
      <li>
33
        Click <strong>OK</strong> when you are done.
34
      </li>
35
      
36
      <li>
37
        Use either a file manager or the command line to copy <b><code>workspace/YourJavaProject/.settings/org.eclipse.jdt.core.prefs</code></b>
38
        to a new location.
39
      </li>
40
      
41
    </ol>
42
    </p>
43
    <p>
44
      <img src="../images/ngrelt.png" alt="Related tasks" border="0" >
45
    </p>
46
    <p>
47
      <a href="tasks-68.htm">Setting code formatting preferences</a><br>
48
    </p>
49
    <p>
50
      <img src="../images/ngrelr.png" alt="Related reference" border="0" >
51
    </p>
52
    <p>
53
      <a href="../reference/ref-17.htm">Code Formatter</a><br>
54
    </p>
55
    
56
  </body>
57
</html>
58
(-)tasks/tasks-230.htm (+35 lines)
Added Link Here
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
2
<html>
3
  <head>
4
<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." >
5
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
6
    <meta http-equiv="Content-Style-Type" content="text/css">
7
    <title>
8
      Using the Formatter Application
9
    </title>
10
    <link rel="stylesheet" href="../book.css" charset="ISO-8859-1" type="text/css">
11
  </head>
12
  <body>
13
    <h1>
14
      Using the Formatter Application
15
    </h1>
16
    <p>
17
 	The JDT has a commandline Eclipse Application that allows users to format Java source code either with 
18
 	the Eclipse default code formatter options or with custom options.
19
    </p>
20
    <p>
21
      <img src="../images/ngrelt.png" alt="Related tasks" border="0" >
22
    </p>
23
    <p>
24
      <a href="tasks-66.htm">Formatting Java Code</a><br>
25
    </p>
26
    <p>
27
      <img src="../images/ngrelr.png" alt="Related reference" border="0" >
28
    </p>
29
    <p>
30
      <a href="../reference/ref-17.htm">CodeFormatter</a><br>
31
    </p>
32
    
33
  </body>
34
</html>
35

Return to bug 75333