Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 33870 Details for
Bug 75333
[format] standalone code reformatter
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Patch with manually cleaned up paths
codeformatter.patch (text/plain), 26.33 KB, created by
Igor Foox
on 2006-01-31 11:53:47 EST
(
hide
)
Description:
Patch with manually cleaned up paths
Filename:
MIME Type:
Creator:
Igor Foox
Created:
2006-01-31 11:53:47 EST
Size:
26.33 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: plugins/org.eclipse.jdt.core/plugin.xml >=================================================================== >RCS file: plugins/org.eclipse.jdt.doc.user/org.eclipse.jdt.core/plugin.xml,v >retrieving revision 1.83 >diff -u -r1.83 plugins/org.eclipse.jdt.core/plugin.xml >--- plugins/org.eclipse.jdt.core/plugin.xml 24 Jan 2006 15:49:36 -0000 1.83 >+++ plugins/org.eclipse.jdt.core/plugin.xml 29 Jan 2006 02:23:10 -0000 >@@ -164,7 +164,18 @@ > <fileTypes extension="jardesc" type="text"/> > <fileTypes extension="zip" type="binary"/> > </extension> >- >+ >+<!-- =================================================================================== --> >+<!-- Extension: Java Code Formatter --> >+<!-- =================================================================================== --> >+<extension >+ id="JavaCodeFormatter" >+ point="org.eclipse.core.runtime.applications"> >+ <application> >+ <run class="org.eclipse.jdt.core.formatter.CodeFormatterApplication" /> >+ </application> >+</extension> >+ > <!-- =================================================================================== --> > <!-- Extension: Java Content Types --> > <!-- =================================================================================== --> >Index: plugins/org.eclipse.jdt.core/formatter/org/eclipse/jdt/core/formatter/CodeFormatter.java >=================================================================== >RCS file: plugins/org.eclipse.jdt.doc.user/org.eclipse.jdt.core/formatter/org/eclipse/jdt/core/formatter/CodeFormatter.java,v >retrieving revision 1.11 >diff -u -r1.11 CodeFormatter.java >--- plugins/org.eclipse.jdt.core/formatter/org/eclipse/jdt/core/formatter/CodeFormatter.java 23 Mar 2005 21:40:56 -0000 1.11 >+++ plugins/org.eclipse.jdt.core/formatter/org/eclipse/jdt/core/formatter/CodeFormatter.java 29 Jan 2006 02:23:10 -0000 >@@ -79,7 +79,7 @@ > * level of zero or below has no effect. > * @param lineSeparator the line separator to use in formatted source, > * if set to <code>null</code>, then the platform default one will be used. >- * @return the text edit >+ * @return the text edit or <code>null</code> if the given string cannot be formatted. > * @throws IllegalArgumentException if offset is lower than 0, length is lower than 0 or > * length is greater than source length. > */ >Index: plugins/org.eclipse.jdt.core/formatter/org/eclipse/jdt/core/formatter/FormatterAppMessages.properties >=================================================================== >RCS file: plugins/org.eclipse.jdt.core/formatter/org/eclipse/jdt/core/formatter/FormatterAppMessages.properties >diff -N plugins/org.eclipse.jdt.core/formatter/org/eclipse/jdt/core/formatter/FormatterAppMessages.properties >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ plugins/org.eclipse.jdt.core/formatter/org/eclipse/jdt/core/formatter/FormatterAppMessages.properties 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,43 @@ >+/******************************************************************************* >+ * Copyright (c) 2004 Ben Konrath <ben@bagu.org> >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * Ben Konrath <ben@bagu.org> - initial implementation >+ *******************************************************************************/ >+ >+CommandLine.start=Starting format job ... >+CommandLine.done=Done. >+CommandLine.config.file=Configuration Name: {0} >+CommandLine.formatting=Formatting: {0} >+ >+CommandLine.usage=Usage: {0} [ OPTIONS ] <files> >+ >+CommandLine.files=<files> >+CommandLine.files.msg1=Java source files and/or directories to format. >+CommandLine.files.msg2=Only files ending with {0} will be formatted in the given directory. >+ >+CommandLine.options=OPTIONS: >+CommandLine.config={0} <file> >+CommandLine.config.msg1=Use the formatting style from the specified properties file. >+CommandLine.config.msg2=Refer to the help documentation to find out how to generate this file. >+CommandLine.help=Display this message. >+CommandLine.quiet=Only print error messages. >+CommandLine.verbose=Be verbose about the formatting job. >+ >+CommandLineError.file={0} does not exsit. Please specify only valid Java Source files. >+CommandLineError.config=There was problem reading the config file, {0}. >+CommandLineError.file.dir=You must specify at least one file or dirctory to format. >+CommandLineError.quiet.verbose=You cannot use the options {0} and {1} together. >+ >+Exception.io=Caught IOExecption: >+Exception.bad.location=Caught BadLocationException: >+Exception.skip=Skipping File. >+ >+ConfigFile.reading.error=Error Reading config file. >+ >+Edit.problem=The Eclipse formatter had a problem {0}, Skipping. >+ >Index: plugins/org.eclipse.jdt.core/formatter/org/eclipse/jdt/core/formatter/CodeFormatterApplication.java >=================================================================== >RCS file: plugins/org.eclipse.jdt.core/formatter/org/eclipse/jdt/core/formatter/CodeFormatterApplication.java >diff -N plugins/org.eclipse.jdt.core/formatter/org/eclipse/jdt/core/formatter/CodeFormatterApplication.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ plugins/org.eclipse.jdt.core/formatter/org/eclipse/jdt/core/formatter/CodeFormatterApplication.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,317 @@ >+/******************************************************************************* >+ * Copyright (c) 2004 Ben Konrath <ben@bagu.org> >+ * Copyright (c) 2006 Red Hat Incorporated >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * Ben Konrath <ben@bagu.org> - initial implementation >+ * Red Hat Incorporated - improvements based on comments from JDT developers >+ *******************************************************************************/ >+ >+package org.eclipse.jdt.core.formatter; >+ >+import java.io.BufferedReader; >+import java.io.BufferedWriter; >+import java.io.File; >+import java.io.FileInputStream; >+import java.io.FileReader; >+import java.io.FileWriter; >+import java.io.IOException; >+import java.io.Writer; >+import java.text.MessageFormat; >+import java.util.ArrayList; >+import java.util.MissingResourceException; >+import java.util.Properties; >+import java.util.ResourceBundle; >+ >+import org.eclipse.core.runtime.IPlatformRunnable; >+import org.eclipse.core.runtime.Platform; >+import org.eclipse.jdt.core.ToolFactory; >+import org.eclipse.jdt.internal.core.util.Util; >+import org.eclipse.jface.text.BadLocationException; >+import org.eclipse.jface.text.Document; >+import org.eclipse.jface.text.IDocument; >+import org.eclipse.text.edits.TextEdit; >+ >+/** >+ * Implements an Eclipse Application for org.eclipse.jdt.core.JavaCodeFormatter. >+ * >+ * There are a couple improvments that could be made: >+ * 1. Make a list of all the files first so that a file does not get formatted twice. >+ * 2. Use a text based progress monitor for output. >+ * >+ * @author Ben Konrath <bkonrath@redhat.com> >+ * @since 3.2 >+ */ >+public class CodeFormatterApplication implements IPlatformRunnable { >+ >+ /** >+ * Deals with the messages in the properties file (cut n' pasted from a >+ * generated class). >+ */ >+ private final static class FormatterAppMessages { >+ private static final String BUNDLE_NAME = "org.eclipse.jdt.core.formatter.FormatterAppMessages";//$NON-NLS-1$ >+ >+ private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME); >+ >+ public static String getString(String key) { >+ try { >+ return RESOURCE_BUNDLE.getString(key); >+ } catch (MissingResourceException e) { >+ return '!' + key + '!'; >+ } >+ } >+ >+ public static String getFormattedString(String key, String arg) { >+ return getFormattedString(key, new String[] { arg }); >+ } >+ >+ public static String getFormattedString(String key, String[] args) { >+ return MessageFormat.format(getString(key), args); >+ } >+ } >+ >+ /** >+ * Return a Java Properties file representing the options that are in the specified config file. >+ */ >+ public Properties readConfig(String filename) { >+ FileInputStream reader = null; >+ try { >+ reader = new FileInputStream(new File(filename)); >+ final Properties formatterOptions = new Properties(); >+ formatterOptions.load(reader); >+ return formatterOptions; >+ } catch (IOException e) { >+ Util.log(e, FormatterAppMessages.getString("ConfigFile.reading.error")); //$NON-NLS-1$ >+ } finally { >+ try { >+ if (reader != null) >+ reader.close(); >+ } catch (IOException e) { /* ignore */ } >+ } >+ return null; >+ } >+ >+ /** >+ * Runs the Java code formatter application >+ */ >+ public Object run(Object args) throws Exception { >+ >+ ArrayList fileList = processCommandLine((String[]) args); >+ >+ // nothing to do >+ if (fileList == null || fileList.isEmpty()) >+ return EXIT_OK; >+ >+ if (!quiet) { >+ if (configName != null) >+ System.out.println(FormatterAppMessages.getFormattedString("CommandLine.config.file", configName)); //$NON-NLS-1$ >+ System.out.println(FormatterAppMessages.getString("CommandLine.start")); //$NON-NLS-1$ >+ } >+ >+ // format the list of files and/or directories >+ while (!fileList.isEmpty()) { >+ File file = (File) fileList.remove(0); >+ >+ if (file.isDirectory()) >+ formatDirTree(file); >+ else >+ formatFile(file); >+ } >+ >+ if (!quiet) { >+ System.out.println(FormatterAppMessages.getString("CommandLine.done")); //$NON-NLS-1$ >+ } >+ >+ return EXIT_OK; >+ } >+ >+ private void displayHelp(String message) { >+ System.err.println(message); >+ System.out.println(""); //$NON-NLS-1$ >+ displayHelp(); >+ } >+ >+ private String configName; >+ >+ /* >+ * The output will look like this: >+ * >+ * "Usage: eclipse -application org.eclipse.jdt.core.JavaCodeFormatter [ OPTIONS ] <files> >+ * <files> Java source files and/or directories to format. >+ * Only files ending with .java will be formatted in the given directory. >+ * OPTIONS: >+ * -config <file> Use the formatting style from the specified properties file. >+ * Refer to the help documentation to find out how to generate this file.. >+ * -help Display this message. >+ * -quiet Only print error messages. >+ * -verbose Be verbose about the formatting job. >+ */ >+ private void displayHelp() { >+ String binaryName = Platform.getOS().equals(Platform.OS_WIN32) ? "eclipse.exe" : "eclipse"; //$NON-NLS-1$ //$NON-NLS-2$ >+ >+ // this is UG-LY. is there a way to make this look nicer? >+ System.out.println(FormatterAppMessages.getFormattedString("CommandLine.usage", //$NON-NLS-1$ >+ binaryName + " -application org.eclipse.jdt.core.JavaCodeFormatter")); //$NON-NLS-1$ >+ System.out.println(""); //$NON-NLS-1$ >+ >+ System.out.println(" " + FormatterAppMessages.getString("CommandLine.files") //$NON-NLS-1$ //$NON-NLS-2$ >+ + "\t" + FormatterAppMessages.getString("CommandLine.files.msg1")); //$NON-NLS-1$ //$NON-NLS-2$ >+ System.out.println("\t\t" + FormatterAppMessages.getFormattedString("CommandLine.files.msg2", ".java")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ >+ >+ System.out.println(FormatterAppMessages.getString("CommandLine.options")); //$NON-NLS-1$ >+ System.out.println(" " + FormatterAppMessages.getFormattedString("CommandLine.config", ARG_CONFIG) //$NON-NLS-1$ //$NON-NLS-2$ >+ + "\t" + FormatterAppMessages.getString("CommandLine.config.msg1")); //$NON-NLS-1$ //$NON-NLS-2$ >+ System.out.println("\t\t\t" + FormatterAppMessages.getString("CommandLine.config.msg2")); //$NON-NLS-1$ //$NON-NLS-2$ >+ System.out.println(" " + ARG_HELP + "\t\t" + FormatterAppMessages.getString("CommandLine.help")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ >+ System.out.println(" " + ARG_QUIET + "\t\t" + FormatterAppMessages.getString("CommandLine.quiet")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ >+ System.out.println(" " + ARG_VERBOSE +"\t\t" + FormatterAppMessages.getString("CommandLine.verbose")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ >+ } >+ >+ private final String ARG_HELP = "-help"; //$NON-NLS-1$ >+ private final String ARG_CONFIG = "-config"; //$NON-NLS-1$ >+ private final String ARG_VERBOSE = "-verbose"; //$NON-NLS-1$ >+ private final String ARG_QUIET = "-quiet"; //$NON-NLS-1$ >+ private boolean verbose = false; >+ private boolean quiet = false; >+ >+ private ArrayList processCommandLine(String[] argsArray) { >+ >+ ArrayList args = new ArrayList(); >+ for (int i = 0; i < argsArray.length; i++) { >+ args.add(argsArray[i]); >+ } >+ >+ // look for flag-like args >+ if (args.remove(ARG_HELP)) { >+ displayHelp(); >+ return null; >+ } >+ if (args.remove(ARG_VERBOSE)) >+ verbose = true; >+ if (args.remove(ARG_QUIET)) >+ quiet = true; >+ >+ if (quiet && verbose) { >+ displayHelp(FormatterAppMessages.getFormattedString >+ ("CommandLineError.quiet.verbose", new String[] {ARG_QUIET, ARG_VERBOSE})); //$NON-NLS-1$ >+ return null; >+ } >+ args.remove("-pdelaunch"); //$NON-NLS-1$ >+ >+ // look for flag/param args >+ int index = args.indexOf(ARG_CONFIG); >+ if (index >= 0) { >+ args.remove(index); >+ String configFile = (String) args.remove(index); >+ options = readConfig(configFile); >+ if (options == null) { >+ displayHelp(FormatterAppMessages.getFormattedString("CommandLineError.config", configFile)); //$NON-NLS-1$ >+ return null; >+ } >+ } >+ >+ // only the files and directories should remain >+ ArrayList fileList = new ArrayList(); >+ while (!args.isEmpty()) { >+ String fileName = (String) args.remove(0); >+ File file = new File(fileName); >+ if (file.exists()) { >+ fileList.add(file); >+ } else { >+ displayHelp(FormatterAppMessages >+ .getFormattedString("CommandLineError.file", fileName)); //$NON-NLS-1$ >+ return null; >+ } >+ } >+ >+ if (fileList.isEmpty()) >+ displayHelp(FormatterAppMessages.getString("CommandLineError.file.dir")); //$NON-NLS-1$ >+ >+ return fileList; >+ } >+ >+ /** >+ * Recursively format the Java source code that is contained in the >+ * directory rooted at dir. >+ */ >+ private void formatDirTree(File dir) { >+ >+ File[] files = dir.listFiles(); >+ if (files == null) >+ return; >+ >+ for (int i = 0; i < files.length; i++) { >+ File file = files[i]; >+ if (file.isDirectory()) { >+ formatDirTree(file); >+ } else if (file.getPath().endsWith(".java")) { //$NON-NLS-1$ >+ formatFile(file); >+ } >+ } >+ } >+ >+ private Properties options = null; >+ >+ /** >+ * Format the given Java source file. >+ */ >+ private void formatFile(File file) { >+ >+ IDocument doc = new Document(); >+ try { >+ // read the file >+ final BufferedReader in = new BufferedReader(new FileReader(file)); >+ if (verbose) { >+ System.out.println(FormatterAppMessages.getFormattedString >+ ("CommandLine.formatting", file.getName())); //$NON-NLS-1$ >+ } >+ String line; >+ String contents = ""; //$NON-NLS-1$ >+ try { >+ while ((line = in.readLine()) != null) >+ contents = contents + System.getProperty("line.separator") + line; //$NON-NLS-1$ >+ } finally { >+ try { in.close(); } catch (IOException e) { /* ignore */ } >+ } >+ >+ // format the file (the meat and potatoes) >+ doc.set(contents); >+ TextEdit edit = ToolFactory.createCodeFormatter(options).format(CodeFormatter.K_COMPILATION_UNIT, >+ doc.get(), 0, doc.getLength(), 0, null); >+ if (edit != null) { >+ edit.apply(doc); >+ } else { >+ System.err.println(FormatterAppMessages.getFormattedString("Edit.problem", file.getName())); //$NON-NLS-1$ >+ return; >+ } >+ >+ // write the file >+ final Writer out = new BufferedWriter(new FileWriter(file, false)); >+ try { >+ out.write(doc.get()); >+ out.flush(); >+ } finally { >+ try { out.close(); } catch (IOException e) { /* ignore */ } >+ } >+ >+ } catch (IOException e) { >+ String errorMessage = FormatterAppMessages.getString("Exception.io") + " " //$NON-NLS-1$ //$NON-NLS-2$ >+ + e.getLocalizedMessage(); >+ Util.log(e, errorMessage); >+ System.err.println(errorMessage); >+ System.err.println(FormatterAppMessages.getString("Exception.skip")); //$NON-NLS-1$ >+ >+ } catch (BadLocationException e) { >+ String errorMessage = FormatterAppMessages.getString("Exception.bad.location") + " " //$NON-NLS-1$ //$NON-NLS-2$ >+ + e.getLocalizedMessage(); >+ Util.log(e, errorMessage); >+ System.err.println(errorMessage); >+ System.err.println(FormatterAppMessages.getString("Exception.skip")); //$NON-NLS-1$ >+ } >+ } >+ >+} >#P org.eclipse.jdt.doc.user >Index: plugins/org.eclipse.jdt.doc.user/tasks/tasks-68.htm >=================================================================== >RCS file: plugins/org.eclipse.jdt.doc.user/tasks/tasks-68.htm,v >retrieving revision 1.19 >diff -u -r1.19 plugins/org.eclipse.jdt.doc.user/tasks/tasks-68.htm >--- plugins/org.eclipse.jdt.doc.user/tasks/tasks-68.htm 23 Jun 2005 10:30:40 -0000 1.19 >+++ plugins/org.eclipse.jdt.doc.user/tasks/tasks-68.htm 29 Jan 2006 02:23:12 -0000 >@@ -64,6 +64,7 @@ > <p> > <a href="tasks-66.htm">Formatting Java code</a><br> > <a href="tasks-67.htm">Formatting files or portions of code</a> >+ <a href="tasks-230.htm">Using the Formatter Application</a> > </p> > <p> > <img border="0" src="../images/ngrelr.png" alt="Related reference"> >Index: topics_Tasks.xml >=================================================================== >RCS file: plugins/org.eclipse.jdt.doc.user/topics_Tasks.xml,v >retrieving revision 1.85 >diff -u -r1.85 plugins/org.eclipse.jdt.doc.user/topics_Tasks.xml >--- plugins/org.eclipse.jdt.doc.user/topics_Tasks.xml 23 Jun 2005 14:55:16 -0000 1.85 >+++ plugins/org.eclipse.jdt.doc.user/topics_Tasks.xml 29 Jan 2006 02:23:12 -0000 >@@ -310,4 +310,9 @@ > </topic> > </topic> > <anchor id="t_scrapbook" /> >+ <topic label="Using the Formatter Application" href="tasks/tasks-230.htm"> >+ <topic label="Running the Formatter Application" href="tasks/tasks-231.htm"></topic> >+ <topic label="Generating a config file for the Formatter Application" href="tasks/tasks-232.htm"></topic> >+ </topic> >+ > </toc> >\ No newline at end of file >Index: plugins/org.eclipse.jdt.doc.user/tasks/tasks-231.htm >=================================================================== >RCS file: plugins/org.eclipse.jdt.doc.user/tasks/tasks-231.htm >diff -N plugins/org.eclipse.jdt.doc.user/tasks/tasks-231.htm >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ plugins/org.eclipse.jdt.doc.user/tasks/tasks-231.htm 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,78 @@ >+<!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> >+ Running the Formatter Application >+ </title> >+ <link rel="stylesheet" href="../book.css" charset="ISO-8859-1" type="text/css"> >+ </head> >+ <body> >+ <h1> >+ Running the Formatter Application >+ </h1> >+ <p> >+ Running the Formatter Application is as simple as running the org.eclipse.jdt.core.JavaCodeFormatter application from the commandline: >+ <pre> >+ eclipse -vm <path to virtual machine> -application org.eclipse.jdt.core.JavaCodeFormatter [ OPTIONS ] <files> >+ </pre> >+ <table border="1" cellspacing="0" cellpadding="5" width="600"> >+ <tr> >+ <td width="25%"><files></td> >+ <td>Java source files and/or directories to format. Only files ending with .java will be formatted in the given directory.</td> >+ </tr> >+ </table> >+ </p> >+ <p> >+ <table border="1" cellspacing="0" cellpadding="5" width="600"> >+ <thead> >+ <tr> >+ <th><p>OPTIONS</p></th> >+ <th><p>Description</p></th> >+ </tr> >+ </thead> >+ <tbody> >+ <tr> >+ <td valign="top" width="25%"><p>-config <file></p></td> >+ <td valign="top"><p>Use the formatting style from the specified properties file. >+ Refer to <a href="tasks-232.htm">Generating a config file for the Formatter Application</a> >+ for details.</p> >+ </td> >+ </tr> >+ <tr> >+ <td valign="top" width="25%"><p>-help</p></td> >+ <td valign="top"><p>Display the help message.</p> >+ </td> >+ </tr> >+ <tr> >+ <td valign="top" width="25%"><p>-quiet</p></td> >+ <td valign="top"><p>Only print error messages.</p> >+ </td> >+ </tr> >+ <tr> >+ <td valign="top" width="25%"><p>-verbose</p></td> >+ <td valign="top"><p>Be verbose about the formatting job.</p> >+ </td> >+ </tr> >+ </tbody> >+ </table> >+ </p> >+ >+ <p> >+ <img src="../images/ngrelt.png" alt="Related tasks" border="0" > >+ </p> >+ <p> >+ <a href="tasks-66.htm">Formatting Java Code</a><br> >+ </p> >+ <p> >+ <img src="../images/ngrelr.png" alt="Related reference" border="0" > >+ </p> >+ <p> >+ <a href="../reference/ref-17.htm">CodeFormatter</a><br> >+ </p> >+ >+ </body> >+</html> >+ >Index: plugins/org.eclipse.jdt.doc.user/tasks/tasks-232.htm >=================================================================== >RCS file: plugins/org.eclipse.jdt.doc.user/tasks/tasks-232.htm >diff -N plugins/org.eclipse.jdt.doc.user/tasks/tasks-232.htm >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ plugins/org.eclipse.jdt.doc.user/tasks/tasks-232.htm 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,58 @@ >+<!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>Code Style > Formatter</strong> page and check <strong>Enable project specific sttings</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> >+ >+ </ol> >+ </p> >+ <p> >+ <img src="../images/ngrelt.png" alt="Related tasks" border="0" > >+ </p> >+ <p> >+ <a href="tasks-68.htm">Setting code formatting preferences</a><br> >+ </p> >+ <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> >+ >Index: plugins/org.eclipse.jdt.doc.user/tasks/tasks-230.htm >=================================================================== >RCS file: plugins/org.eclipse.jdt.doc.user/tasks/tasks-230.htm >diff -N plugins/org.eclipse.jdt.doc.user/tasks/tasks-230.htm >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ plugins/org.eclipse.jdt.doc.user/tasks/tasks-230.htm 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,35 @@ >+<!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> >+ Using the Formatter Application >+ </title> >+ <link rel="stylesheet" href="../book.css" charset="ISO-8859-1" type="text/css"> >+ </head> >+ <body> >+ <h1> >+ Using the Formatter Application >+ </h1> >+ <p> >+ The JDT has a commandline Eclipse Application that allows users to format Java source code either with >+ the Eclipse default code formatter options or with custom options. >+ </p> >+ <p> >+ <img src="../images/ngrelt.png" alt="Related tasks" border="0" > >+ </p> >+ <p> >+ <a href="tasks-66.htm">Formatting Java Code</a><br> >+ </p> >+ <p> >+ <img src="../images/ngrelr.png" alt="Related reference" border="0" > >+ </p> >+ <p> >+ <a href="../reference/ref-17.htm">CodeFormatter</a><br> >+ </p> >+ >+ </body> >+</html> >+
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 75333
:
17416
|
17493
|
18373
|
33430
|
33432
|
33760
| 33870 |
34106