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

Collapse All | Expand All

(-)ui/org/eclipse/cdt/ui/tests/text/CAutoIndentTest.java (-8 / +69 lines)
Lines 32-37 Link Here
32
import org.eclipse.jface.text.IDocument;
32
import org.eclipse.jface.text.IDocument;
33
import org.eclipse.jface.text.IRegion;
33
import org.eclipse.jface.text.IRegion;
34
import org.eclipse.jface.text.TextUtilities;
34
import org.eclipse.jface.text.TextUtilities;
35
import org.eclipse.swt.widgets.Shell;
36
import org.eclipse.ui.PlatformUI;
35
37
36
/**
38
/**
37
 * Testing the auto indent strategies.
39
 * Testing the auto indent strategies.
Lines 71-77 Link Here
71
		public void type(char c) throws BadLocationException {
73
		public void type(char c) throws BadLocationException {
72
			TestDocumentCommand command = new TestDocumentCommand(fCaretOffset, 0, new String(new char[] { c }));
74
			TestDocumentCommand command = new TestDocumentCommand(fCaretOffset, 0, new String(new char[] { c }));
73
			customizeDocumentCommand(command);
75
			customizeDocumentCommand(command);
74
			fCaretOffset += command.exec(fDoc);
76
			fCaretOffset = command.exec(fDoc);
75
		}
77
		}
76
78
77
		private void customizeDocumentCommand(TestDocumentCommand command) throws BadLocationException {
79
		private void customizeDocumentCommand(TestDocumentCommand command) throws BadLocationException {
Lines 94-100 Link Here
94
		public void paste(String text) throws BadLocationException {
96
		public void paste(String text) throws BadLocationException {
95
			TestDocumentCommand command = new TestDocumentCommand(fCaretOffset, 0, text);
97
			TestDocumentCommand command = new TestDocumentCommand(fCaretOffset, 0, text);
96
			customizeDocumentCommand(command);
98
			customizeDocumentCommand(command);
97
			fCaretOffset += command.exec(fDoc);
99
			fCaretOffset = command.exec(fDoc);
98
		}
100
		}
99
101
100
		public void paste(int offset, String text) throws BadLocationException {
102
		public void paste(int offset, String text) throws BadLocationException {
Lines 110-122 Link Here
110
		public void backspace() throws BadLocationException {
112
		public void backspace() throws BadLocationException {
111
			TestDocumentCommand command = new TestDocumentCommand(fCaretOffset-1, 1, ""); //$NON-NLS-1$
113
			TestDocumentCommand command = new TestDocumentCommand(fCaretOffset-1, 1, ""); //$NON-NLS-1$
112
			customizeDocumentCommand(command);
114
			customizeDocumentCommand(command);
113
			fCaretOffset += command.exec(fDoc);
115
			fCaretOffset = command.exec(fDoc);
114
		}
116
		}
115
117
116
		public int getCaretOffset() {
118
		public int getCaretOffset() {
117
			return fCaretOffset;
119
			return fCaretOffset;
118
		}
120
		}
119
121
122
		public int setCaretOffset(int offset) {
123
			fCaretOffset = offset;
124
			if (fCaretOffset < 0)
125
				fCaretOffset = 0;
126
			else if (fCaretOffset > fDoc.getLength())
127
				fCaretOffset = fDoc.getLength();
128
			return fCaretOffset;
129
		}
130
		
131
		/**
132
		 * Moves caret right or left by the given number of characters.
133
		 * 
134
		 * @param shift Move distance.
135
		 * @return New caret offset.
136
		 */
137
		public int moveCaret(int shift) {
138
			return setCaretOffset(fCaretOffset + shift);
139
		}
140
120
		public int getCaretLine() throws BadLocationException {
141
		public int getCaretLine() throws BadLocationException {
121
			return fDoc.getLineOfOffset(fCaretOffset);
142
			return fDoc.getLineOfOffset(fCaretOffset);
122
		}
143
		}
Lines 167-178 Link Here
167
188
168
			owner = null;
189
			owner = null;
169
			caretOffset = -1;
190
			caretOffset = -1;
170
171
		}
191
		}
172
192
193
		/**
194
		 * Returns new caret position.
195
		 */
173
		public int exec(IDocument doc) throws BadLocationException {
196
		public int exec(IDocument doc) throws BadLocationException {
174
			doc.replace(offset, length, text);
197
			doc.replace(offset, length, text);
175
			return text.length() - length;
198
			return caretOffset != -1 ?
199
						caretOffset :
200
						offset + (text == null ? 0 : text.length());
176
		}
201
		}
177
	}
202
	}
178
203
Lines 188-199 Link Here
188
		return new TestSuite(CAutoIndentTest.class);
213
		return new TestSuite(CAutoIndentTest.class);
189
	}
214
	}
190
215
216
	protected void setUp() throws Exception {
217
		super.setUp();
218
		Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();  
219
		shell.forceActive();
220
		shell.forceFocus();
221
	}
222
	
191
	private AutoEditTester createAutoEditTester() {
223
	private AutoEditTester createAutoEditTester() {
192
		CTextTools textTools = CUIPlugin.getDefault().getTextTools();
224
		CTextTools textTools = CUIPlugin.getDefault().getTextTools();
193
		IDocument doc = new Document();
225
		IDocument doc = new Document();
194
		textTools.setupCDocument(doc);
226
		textTools.setupCDocument(doc);
195
		AutoEditTester tester = new AutoEditTester(doc, textTools.getDocumentPartitioning());
227
		AutoEditTester tester = new AutoEditTester(doc, textTools.getDocumentPartitioning());
196
		tester.setAutoEditStrategy(IDocument.DEFAULT_CONTENT_TYPE, new CAutoIndentStrategy());
228
		tester.setAutoEditStrategy(IDocument.DEFAULT_CONTENT_TYPE,
229
				                   new CAutoIndentStrategy(textTools.getDocumentPartitioning(), null));
197
		tester.setAutoEditStrategy(ICPartitions.C_MULTILINE_COMMENT, new CCommentAutoIndentStrategy());
230
		tester.setAutoEditStrategy(ICPartitions.C_MULTILINE_COMMENT, new CCommentAutoIndentStrategy());
198
		return tester;
231
		return tester;
199
	}
232
	}
Lines 202-211 Link Here
202
		AutoEditTester tester = createAutoEditTester(); //$NON-NLS-1$
235
		AutoEditTester tester = createAutoEditTester(); //$NON-NLS-1$
203
		tester.type("void main() {\n"); //$NON-NLS-1$
236
		tester.type("void main() {\n"); //$NON-NLS-1$
204
		assertEquals(1, tester.getCaretLine());
237
		assertEquals(1, tester.getCaretLine());
238
		// Nested statement is indented by one.
205
		assertEquals(1, tester.getCaretColumn());
239
		assertEquals(1, tester.getCaretColumn());
206
		tester.type("}\n"); //$NON-NLS-1$
240
		// The brace was closed automatically.
241
		assertEquals("}", tester.getLine(1)); //$NON-NLS-1$
242
		tester.type("if (expression1 &&\n"); //$NON-NLS-1$
207
		assertEquals(2, tester.getCaretLine());
243
		assertEquals(2, tester.getCaretLine());
208
		assertEquals(0, tester.getCaretColumn());
244
		// Continuation line is indented by two relative to the statement.
245
		assertEquals(3, tester.getCaretColumn());
246
		tester.type("expression2 &&\n"); //$NON-NLS-1$
247
		assertEquals(3, tester.getCaretLine());
248
		// Second continuation line is also indented by two relative to the statement.
249
		assertEquals(3, tester.getCaretColumn());
250
		tester.type("expression3) {"); //$NON-NLS-1$
251
		// Remember caret position.
252
		int offset = tester.getCaretOffset();
253
		// Press Enter
254
        tester.type("\n");  //$NON-NLS-1$
255
		assertEquals(4, tester.getCaretLine());
256
		// Nested statement is indented by one relative to the containing statement.
257
		assertEquals(2, tester.getCaretColumn());
258
		// The brace was closed automatically.
259
		assertEquals("\t}", tester.getLine(1)); //$NON-NLS-1$
260
		tester.type("int x = 5;"); //$NON-NLS-1$
261
		// Move caret back after the opening brace.
262
		tester.setCaretOffset(offset);
263
		// Press Enter
264
        tester.type("\n"); //$NON-NLS-1$
265
		assertEquals(4, tester.getCaretLine());
266
		// Nested statement is indented by one relative to the containing statement.
267
		assertEquals(2, tester.getCaretColumn());
268
        // No auto closing brace since the braces are already balanced.
269
		assertEquals("\t\tint x = 5;", tester.getLine(1)); //$NON-NLS-1$
209
	}
270
	}
210
271
211
	public void testDefaultAutoIndent() throws IOException, CoreException, BadLocationException {
272
	public void testDefaultAutoIndent() throws IOException, CoreException, BadLocationException {
(-)src/org/eclipse/cdt/internal/corext/util/CodeFormatterUtil.java (+79 lines)
Lines 12-20 Link Here
12
12
13
import java.util.Map;
13
import java.util.Map;
14
14
15
import org.eclipse.cdt.core.CCorePlugin;
15
import org.eclipse.cdt.core.ToolFactory;
16
import org.eclipse.cdt.core.ToolFactory;
16
import org.eclipse.cdt.core.formatter.CodeFormatter;
17
import org.eclipse.cdt.core.formatter.CodeFormatter;
18
import org.eclipse.cdt.core.formatter.CodeFormatterConstants;
19
import org.eclipse.cdt.core.model.ICProject;
17
import org.eclipse.cdt.ui.CUIPlugin;
20
import org.eclipse.cdt.ui.CUIPlugin;
21
18
import org.eclipse.core.runtime.Assert;
22
import org.eclipse.core.runtime.Assert;
19
import org.eclipse.jface.preference.IPreferenceStore;
23
import org.eclipse.jface.preference.IPreferenceStore;
20
import org.eclipse.jface.text.BadLocationException;
24
import org.eclipse.jface.text.BadLocationException;
Lines 34-40 Link Here
34
//		String str= format(CodeFormatter.K_EXPRESSION, "x", indent, null, "", (Map) null); //$NON-NLS-1$ //$NON-NLS-2$
38
//		String str= format(CodeFormatter.K_EXPRESSION, "x", indent, null, "", (Map) null); //$NON-NLS-1$ //$NON-NLS-2$
35
//		return str.substring(0, str.indexOf('x'));
39
//		return str.substring(0, str.indexOf('x'));
36
//	} 
40
//	} 
41
42
	/**
43
	 * Gets the current tab width.
44
	 * 
45
	 * @param project The project where the source is used, used for project
46
	 *        specific options or <code>null</code> if the project is unknown
47
	 *        and the workspace default should be used
48
	 * @return The tab width
49
	 */
50
	public static int getTabWidth(ICProject project) {
51
		/*
52
		 * If the tab-char is SPACE, FORMATTER_INDENTATION_SIZE is not used
53
		 * by the core formatter.
54
		 * We piggy back the visual tab length setting in that preference in
55
		 * that case.
56
		 */
57
		String key;
58
		if (CCorePlugin.SPACE.equals(getCoreOption(project, CodeFormatterConstants.FORMATTER_TAB_CHAR)))
59
			key= CodeFormatterConstants.FORMATTER_INDENTATION_SIZE;
60
		else
61
			key= CodeFormatterConstants.FORMATTER_TAB_SIZE;
37
		
62
		
63
		return getCoreOption(project, key, 4);
64
	}
65
66
	/**
67
	 * Returns the current indent width.
68
	 * 
69
	 * @param project the project where the source is used or <code>null</code>
70
	 *        if the project is unknown and the workspace default should be used
71
	 * @return the indent width
72
	 */
73
	public static int getIndentWidth(ICProject project) {
74
		String key;
75
		if (CodeFormatterConstants.MIXED.equals(getCoreOption(project, CodeFormatterConstants.FORMATTER_TAB_CHAR)))
76
			key= CodeFormatterConstants.FORMATTER_INDENTATION_SIZE;
77
		else
78
			key= CodeFormatterConstants.FORMATTER_TAB_SIZE;
79
		
80
		return getCoreOption(project, key, 4);
81
	}
82
83
	/**
84
	 * Returns the possibly <code>project</code>-specific core preference
85
	 * defined under <code>key</code>.
86
	 * 
87
	 * @param project the project to get the preference from, or
88
	 *        <code>null</code> to get the global preference
89
	 * @param key the key of the preference
90
	 * @return the value of the preference
91
	 */
92
	private static String getCoreOption(ICProject project, String key) {
93
		if (project == null)
94
			return CCorePlugin.getOption(key);
95
		return project.getOption(key, true);
96
	}
97
98
	/**
99
	 * Returns the possibly <code>project</code>-specific core preference
100
	 * defined under <code>key</code>, or <code>def</code> if the value is
101
	 * not a integer.
102
	 * 
103
	 * @param project the project to get the preference from, or
104
	 *        <code>null</code> to get the global preference
105
	 * @param key the key of the preference
106
	 * @param def the default value
107
	 * @return the value of the preference
108
	 */
109
	private static int getCoreOption(ICProject project, String key, int def) {
110
		try {
111
			return Integer.parseInt(getCoreOption(project, key));
112
		} catch (NumberFormatException e) {
113
			return def;
114
		}
115
	}
116
38
	/**
117
	/**
39
	 * Evaluates the edit on the given string.
118
	 * Evaluates the edit on the given string.
40
	 * @throws IllegalArgumentException If the positions are not inside the string, a
119
	 * @throws IllegalArgumentException If the positions are not inside the string, a
(-)src/org/eclipse/cdt/ui/PreferenceConstants.java (-1 / +50 lines)
Lines 161-166 Link Here
161
	public static final String EDITOR_TEXT_HOVER_MODIFIER_MASKS= "hoverModifierMasks"; //$NON-NLS-1$
161
	public static final String EDITOR_TEXT_HOVER_MODIFIER_MASKS= "hoverModifierMasks"; //$NON-NLS-1$
162
162
163
	/**
163
	/**
164
	 * A named preference that controls whether the 'close strings' feature
165
	 *  is   enabled.
166
	 * <p>
167
	 * Value is of type <code>Boolean</code>.
168
	 * </p>
169
	 */
170
	public final static String EDITOR_CLOSE_STRINGS= "closeStrings"; //$NON-NLS-1$
171
172
	/**
173
	 * A named preference that controls whether the 'wrap strings' feature is
174
	 * enabled.
175
	 * <p>
176
	 * Value is of type <code>Boolean</code>.
177
	 * </p>
178
	 */
179
	public final static String EDITOR_WRAP_STRINGS= "wrapStrings"; //$NON-NLS-1$
180
181
	/**
182
	 * A named preference that controls whether the 'escape strings' feature is
183
	 * enabled.
184
	 * <p>
185
	 * Value is of type <code>Boolean</code>.
186
	 * </p>
187
	 */
188
	public final static String EDITOR_ESCAPE_STRINGS= "escapeStrings"; //$NON-NLS-1$
189
190
	/**
191
	 * A named preference that controls whether the 'close brackets' feature is
192
	 * enabled.
193
	 * <p>
194
	 * Value is of type <code>Boolean</code>.
195
	 * </p>
196
	 */
197
	public final static String EDITOR_CLOSE_BRACKETS= "closeBrackets"; //$NON-NLS-1$
198
199
	/**
200
	 * A named preference that controls whether the 'close braces' feature is
201
	 * enabled.
202
	 * <p>
203
	 * Value is of type <code>Boolean</code>.
204
	 * </p>
205
	 */
206
	public final static String EDITOR_CLOSE_BRACES= "closeBraces"; //$NON-NLS-1$
207
208
	/**
164
	 * The id of the best match hover contributed for extension point
209
	 * The id of the best match hover contributed for extension point
165
	 * <code>javaEditorTextHovers</code>.
210
	 * <code>javaEditorTextHovers</code>.
166
	 *
211
	 *
Lines 412-417 Link Here
412
		store.setDefault(PreferenceConstants.EDITOR_FOLDING_METHODS, false);
457
		store.setDefault(PreferenceConstants.EDITOR_FOLDING_METHODS, false);
413
		store.setDefault(PreferenceConstants.EDITOR_FOLDING_MACROS, true);
458
		store.setDefault(PreferenceConstants.EDITOR_FOLDING_MACROS, true);
414
459
415
460
		store.setDefault(PreferenceConstants.EDITOR_CLOSE_STRINGS, true);
461
		store.setDefault(PreferenceConstants.EDITOR_CLOSE_BRACKETS, true);
462
		store.setDefault(PreferenceConstants.EDITOR_CLOSE_BRACES, true);
463
		store.setDefault(PreferenceConstants.EDITOR_WRAP_STRINGS, true);
464
		store.setDefault(PreferenceConstants.EDITOR_ESCAPE_STRINGS, false);
416
    }
465
    }
417
}
466
}
(-)src/org/eclipse/cdt/internal/ui/text/CSourceViewerConfiguration.java (-5 / +31 lines)
Lines 44-60 Link Here
44
import org.eclipse.jface.util.PropertyChangeEvent;
44
import org.eclipse.jface.util.PropertyChangeEvent;
45
import org.eclipse.swt.SWT;
45
import org.eclipse.swt.SWT;
46
import org.eclipse.swt.widgets.Shell;
46
import org.eclipse.swt.widgets.Shell;
47
import org.eclipse.ui.IEditorInput;
47
import org.eclipse.ui.editors.text.TextSourceViewerConfiguration;
48
import org.eclipse.ui.editors.text.TextSourceViewerConfiguration;
48
import org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants;
49
import org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants;
50
import org.eclipse.ui.texteditor.IDocumentProvider;
49
import org.eclipse.ui.texteditor.ITextEditor;
51
import org.eclipse.ui.texteditor.ITextEditor;
50
52
51
import org.eclipse.cdt.core.dom.ast.gnu.c.GCCLanguage;
53
import org.eclipse.cdt.core.dom.ast.gnu.c.GCCLanguage;
52
import org.eclipse.cdt.core.dom.ast.gnu.cpp.GPPLanguage;
54
import org.eclipse.cdt.core.dom.ast.gnu.cpp.GPPLanguage;
55
import org.eclipse.cdt.core.model.ICElement;
56
import org.eclipse.cdt.core.model.ICProject;
53
import org.eclipse.cdt.core.model.ILanguage;
57
import org.eclipse.cdt.core.model.ILanguage;
54
import org.eclipse.cdt.ui.CElementContentProvider;
58
import org.eclipse.cdt.ui.CElementContentProvider;
55
import org.eclipse.cdt.ui.CUIPlugin;
59
import org.eclipse.cdt.ui.CUIPlugin;
56
import org.eclipse.cdt.ui.ILanguageUI;
60
import org.eclipse.cdt.ui.ILanguageUI;
57
61
62
import org.eclipse.cdt.internal.ui.editor.CDocumentProvider;
58
import org.eclipse.cdt.internal.ui.editor.CEditor;
63
import org.eclipse.cdt.internal.ui.editor.CEditor;
59
import org.eclipse.cdt.internal.ui.editor.CElementHyperlinkDetector;
64
import org.eclipse.cdt.internal.ui.editor.CElementHyperlinkDetector;
60
import org.eclipse.cdt.internal.ui.editor.CSourceViewer;
65
import org.eclipse.cdt.internal.ui.editor.CSourceViewer;
Lines 64-70 Link Here
64
import org.eclipse.cdt.internal.ui.text.contentassist.ContentAssistPreference;
69
import org.eclipse.cdt.internal.ui.text.contentassist.ContentAssistPreference;
65
70
66
71
67
68
/**
72
/**
69
 * Configuration for an <code>SourceViewer</code> which shows C code.
73
 * Configuration for an <code>SourceViewer</code> which shows C code.
70
 */
74
 */
Lines 247-256 Link Here
247
	 * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getAutoEditStrategies(org.eclipse.jface.text.source.ISourceViewer, java.lang.String)
251
	 * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getAutoEditStrategies(org.eclipse.jface.text.source.ISourceViewer, java.lang.String)
248
	 */
252
	 */
249
	public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) {
253
	public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) {
250
		if(ICPartitions.C_MULTILINE_COMMENT.equals(contentType)) {
254
		String partitioning= getConfiguredDocumentPartitioning(sourceViewer);
251
			return new IAutoEditStrategy[] {new CCommentAutoIndentStrategy()};
255
		if (ICPartitions.C_MULTILINE_COMMENT.equals(contentType))
252
		}
256
			return new IAutoEditStrategy[] { new CCommentAutoIndentStrategy() };
253
		return new IAutoEditStrategy[] {new CAutoIndentStrategy()};
257
//		else if (ICPartitions.C_STRING.equals(contentType))
258
//			return new IAutoEditStrategy[] { new SmartSemicolonAutoEditStrategy(partitioning), new JavaStringAutoIndentStrategy(partitioning) };
259
		else
260
			return new IAutoEditStrategy[] { new CAutoIndentStrategy(partitioning, getProject()) };
254
	}
261
	}
255
262
256
	/**
263
	/**
Lines 303-308 Link Here
303
		return (String[]) vector.toArray(new String[vector.size()]);
310
		return (String[]) vector.toArray(new String[vector.size()]);
304
	}
311
	}
305
312
313
	private ICProject getProject() {
314
		ITextEditor editor= getEditor();
315
		if (editor == null)
316
			return null;
317
318
		ICElement element= null;
319
		IEditorInput input= editor.getEditorInput();
320
		IDocumentProvider provider= editor.getDocumentProvider();
321
		if (provider instanceof CDocumentProvider) {
322
			CDocumentProvider cudp= (CDocumentProvider) provider;
323
			element= cudp.getWorkingCopy(input);
324
		}
325
326
		if (element == null)
327
			return null;
328
329
		return element.getCProject();
330
	}
331
306
	/**
332
	/**
307
	 * @see SourceViewerConfiguration#getAnnotationHover(ISourceViewer)
333
	 * @see SourceViewerConfiguration#getAnnotationHover(ISourceViewer)
308
	 */
334
	 */
(-)src/org/eclipse/cdt/internal/ui/text/CAutoIndentStrategy.java (-65 / +568 lines)
Lines 9-41 Link Here
9
 *     IBM Corporation - initial API and implementation
9
 *     IBM Corporation - initial API and implementation
10
 *     QNX Software System
10
 *     QNX Software System
11
 *     Anton Leherbauer (Wind River Systems) - Fixed bug 48339
11
 *     Anton Leherbauer (Wind River Systems) - Fixed bug 48339
12
 *     Sergey Prigogin, Google
12
 *******************************************************************************/
13
 *******************************************************************************/
13
package org.eclipse.cdt.internal.ui.text;
14
package org.eclipse.cdt.internal.ui.text;
14
15
16
import org.eclipse.jface.preference.IPreferenceStore;
15
import org.eclipse.jface.text.BadLocationException;
17
import org.eclipse.jface.text.BadLocationException;
16
import org.eclipse.jface.text.DefaultIndentLineAutoEditStrategy;
18
import org.eclipse.jface.text.DefaultIndentLineAutoEditStrategy;
17
import org.eclipse.jface.text.DocumentCommand;
19
import org.eclipse.jface.text.DocumentCommand;
18
import org.eclipse.jface.text.IDocument;
20
import org.eclipse.jface.text.IDocument;
21
import org.eclipse.jface.text.IRegion;
22
import org.eclipse.jface.text.TextUtilities;
23
import org.eclipse.ui.IEditorPart;
24
import org.eclipse.ui.IWorkbenchPage;
25
import org.eclipse.ui.texteditor.ITextEditorExtension3;
19
26
20
27
import org.eclipse.cdt.core.model.ICProject;
21
import org.eclipse.cdt.ui.CUIPlugin;
28
import org.eclipse.cdt.ui.CUIPlugin;
29
import org.eclipse.cdt.ui.PreferenceConstants;
22
30
23
/**
31
/**
24
 * Auto indent strategy sensitive to brackets.
32
 * Auto indent strategy sensitive to brackets.
25
 */
33
 */
26
public class CAutoIndentStrategy extends DefaultIndentLineAutoEditStrategy {
34
public class CAutoIndentStrategy extends DefaultIndentLineAutoEditStrategy {
35
	private static final String MULTILINE_COMMENT_CLOSE = "*/"; //$NON-NLS-1$
36
//	private static final GCCScannerExtensionConfiguration C_GNU_SCANNER_EXTENSION = new GCCScannerExtensionConfiguration();
27
37
28
	private final static String MULTILINE_COMMENT_CLOSE = "*/"; //$NON-NLS-1$
38
	private static class CompilationUnitInfo {
29
39
		char[] buffer;
30
	public CAutoIndentStrategy() {
40
		int delta;
41
42
		CompilationUnitInfo(char[] buffer, int delta) {
43
			this.buffer = buffer;
44
			this.delta = delta;
45
		}
31
	}
46
	}
32
47
48
	private boolean fCloseBrace;
49
	private boolean fIsSmartMode;
50
51
	private String fPartitioning;
52
	private final ICProject fProject;
53
54
	/**
55
	 * Creates a new C auto indent strategy for the given document partitioning.
56
	 *
57
	 * @param partitioning the document partitioning
58
	 * @param project the project to get formatting preferences from, or null to use default preferences
59
	 */
60
	public CAutoIndentStrategy(String partitioning, ICProject project) {
61
		fPartitioning = partitioning;
62
		fProject = project;
63
 	}
64
33
	// evaluate the line with the opening bracket that matches the closing bracket on the given line
65
	// evaluate the line with the opening bracket that matches the closing bracket on the given line
34
	protected int findMatchingOpenBracket(IDocument d, int line, int end, int closingBracketIncrease) throws BadLocationException {
66
	protected int findMatchingOpenBracket(IDocument d, int line, int end, int closingBracketIncrease) throws BadLocationException {
35
67
36
68
37
		int start= d.getLineOffset(line);
69
		int start = d.getLineOffset(line);
38
		int brackcount= getBracketCount(d, start, end, false) - closingBracketIncrease;
70
		int brackcount = getBracketCount(d, start, end, false) - closingBracketIncrease;
39
71
40
72
41
		// sum up the brackets counts of each line (closing brackets count negative, 
73
		// sum up the brackets counts of each line (closing brackets count negative, 
Lines 45-52 Link Here
45
			if (line < 0) {
77
			if (line < 0) {
46
				return -1;
78
				return -1;
47
			}
79
			}
48
			start= d.getLineOffset(line);
80
			start = d.getLineOffset(line);
49
			end= start + d.getLineLength(line) - 1;
81
			end = start + d.getLineLength(line) - 1;
50
			brackcount += getBracketCount(d, start, end, false);
82
			brackcount += getBracketCount(d, start, end, false);
51
		}
83
		}
52
		return line;
84
		return line;
Lines 54-89 Link Here
54
86
55
87
56
	private int getBracketCount(IDocument d, int start, int end, boolean ignoreCloseBrackets) throws BadLocationException {
88
	private int getBracketCount(IDocument d, int start, int end, boolean ignoreCloseBrackets) throws BadLocationException {
57
		int bracketcount= 0;
89
		int bracketcount = 0;
58
		while (start < end) {
90
		while (start < end) {
59
			char curr= d.getChar(start);
91
			char curr = d.getChar(start);
60
			start++;
92
			start++;
61
			switch (curr) {
93
			switch (curr) {
62
				case '/' :
94
				case '/' :
63
					if (start < end) {
95
					if (start < end) {
64
						char next= d.getChar(start);
96
						char next = d.getChar(start);
65
						if (next == '*') {
97
						if (next == '*') {
66
							// a comment starts, advance to the comment end
98
							// a comment starts, advance to the comment end
67
							start= getCommentEnd(d, start + 1, end);
99
							start = getCommentEnd(d, start + 1, end);
68
						} else if (next == '/') {
100
						} else if (next == '/') {
69
							// '//'-comment: nothing to do anymore on this line 
101
							// '//'-comment: nothing to do anymore on this line 
70
							start= end;
102
							start = end;
71
						}
103
						}
72
					}
104
					}
73
					break;
105
					break;
74
				case '*' :
106
				case '*' :
75
					if (start < end) {
107
					if (start < end) {
76
						char next= d.getChar(start);
108
						char next = d.getChar(start);
77
						if (next == '/') {
109
						if (next == '/') {
78
							// we have been in a comment: forget what we read before
110
							// we have been in a comment: forget what we read before
79
							bracketcount= 0;
111
							bracketcount = 0;
80
							start++;
112
							start++;
81
						}
113
						}
82
					}
114
					}
83
					break;
115
					break;
84
				case '{' :
116
				case '{' :
85
					bracketcount++;
117
					bracketcount++;
86
					ignoreCloseBrackets= false;
118
					ignoreCloseBrackets = false;
87
					break;
119
					break;
88
				case '}' :
120
				case '}' :
89
					if (!ignoreCloseBrackets) {
121
					if (!ignoreCloseBrackets) {
Lines 92-98 Link Here
92
					break;
124
					break;
93
				case '"' :
125
				case '"' :
94
				case '\'' :
126
				case '\'' :
95
					start= getStringEnd(d, start, end, curr);
127
					start = getStringEnd(d, start, end, curr);
96
					break;
128
					break;
97
				default :
129
				default :
98
			}
130
			}
Lines 105-111 Link Here
105
137
106
	private int getCommentEnd(IDocument d, int pos, int end) throws BadLocationException {
138
	private int getCommentEnd(IDocument d, int pos, int end) throws BadLocationException {
107
		while (pos < end) {
139
		while (pos < end) {
108
			char curr= d.getChar(pos);
140
			char curr = d.getChar(pos);
109
			pos++;
141
			pos++;
110
			if (curr == '*') {
142
			if (curr == '*') {
111
				if (pos < end && d.getChar(pos) == '/') {
143
				if (pos < end && d.getChar(pos) == '/') {
Lines 118-126 Link Here
118
150
119
	protected String getIndentOfLine(IDocument d, int line) throws BadLocationException {
151
	protected String getIndentOfLine(IDocument d, int line) throws BadLocationException {
120
		if (line > -1) {
152
		if (line > -1) {
121
			int start= d.getLineOffset(line);
153
			int start = d.getLineOffset(line);
122
			int end= start + d.getLineLength(line) - 1;
154
			int end = start + d.getLineLength(line) - 1;
123
			int whiteend= findEndOfWhiteSpace(d, start, end);
155
			int whiteend = findEndOfWhiteSpace(d, start, end);
124
			return d.get(start, whiteend - start);
156
			return d.get(start, whiteend - start);
125
		}
157
		}
126
		return ""; //$NON-NLS-1$
158
		return ""; //$NON-NLS-1$
Lines 128-134 Link Here
128
160
129
	private int getStringEnd(IDocument d, int pos, int end, char ch) throws BadLocationException {
161
	private int getStringEnd(IDocument d, int pos, int end, char ch) throws BadLocationException {
130
		while (pos < end) {
162
		while (pos < end) {
131
			char curr= d.getChar(pos);
163
			char curr = d.getChar(pos);
132
			pos++;
164
			pos++;
133
			if (curr == '\\') {
165
			if (curr == '\\') {
134
				// ignore escaped characters
166
				// ignore escaped characters
Lines 145-170 Link Here
145
			return;
177
			return;
146
178
147
		try {
179
		try {
148
			int p= (c.offset == d.getLength() ? c.offset - 1 : c.offset);
180
			int p = (c.offset == d.getLength() ? c.offset - 1 : c.offset);
149
			int line= d.getLineOfOffset(p);
181
			int line = d.getLineOfOffset(p);
150
			int start= d.getLineOffset(line);
182
			int start = d.getLineOffset(line);
151
			int whiteend= findEndOfWhiteSpace(d, start, c.offset);
183
			int whiteend = findEndOfWhiteSpace(d, start, c.offset);
152
184
153
185
154
			// shift only when line does not contain any text up to the closing bracket
186
			// shift only when line does not contain any text up to the closing bracket
155
			if (whiteend == c.offset) {
187
			if (whiteend == c.offset) {
156
				// evaluate the line with the opening bracket that matches out closing bracket
188
				// evaluate the line with the opening bracket that matches out closing bracket
157
				int indLine= findMatchingOpenBracket(d, line, c.offset, 1);
189
				int indLine = findMatchingOpenBracket(d, line, c.offset, 1);
158
				if (indLine != -1 && indLine != line) {
190
				if (indLine != -1 && indLine != line) {
159
					// take the indent of the found line
191
					// take the indent of the found line
160
					StringBuffer replaceText= new StringBuffer(getIndentOfLine(d, indLine));
192
					StringBuffer replaceText = new StringBuffer(getIndentOfLine(d, indLine));
161
					// add the rest of the current line including the just added close bracket
193
					// add the rest of the current line including the just added close bracket
162
					replaceText.append(d.get(whiteend, c.offset - whiteend));
194
					replaceText.append(d.get(whiteend, c.offset - whiteend));
163
					replaceText.append(c.text);
195
					replaceText.append(c.text);
164
					// modify document command
196
					// modify document command
165
					c.length= c.offset - start;
197
					c.length = c.offset - start;
166
					c.offset= start;
198
					c.offset = start;
167
					c.text= replaceText.toString();
199
					c.text = replaceText.toString();
168
				}
200
				}
169
			}
201
			}
170
		} catch (BadLocationException excp) {
202
		} catch (BadLocationException excp) {
Lines 172-240 Link Here
172
		}
204
		}
173
	}
205
	}
174
206
175
	protected void smartIndentAfterNewLine(IDocument d, DocumentCommand c) {
207
	private void smartIndentAfterClosingBracket(IDocument d, DocumentCommand c) {
176
		int docLength= d.getLength();
208
		if (c.offset == -1 || d.getLength() == 0)
177
		if (c.offset == -1 || docLength == 0)
178
			return;
209
			return;
179
210
180
		try {
211
		try {
181
			int p= (c.offset == docLength ? c.offset - 1 : c.offset);
212
			int p = (c.offset == d.getLength() ? c.offset - 1 : c.offset);
182
			int line= d.getLineOfOffset(p);
213
			int line = d.getLineOfOffset(p);
214
			int start = d.getLineOffset(line);
215
			int whiteend = findEndOfWhiteSpace(d, start, c.offset);
183
216
217
			CHeuristicScanner scanner = new CHeuristicScanner(d);
218
			CIndenter indenter = new CIndenter(d, scanner, fProject);
184
219
185
			StringBuffer buf= new StringBuffer(c.text);
220
			// shift only when line does not contain any text up to the closing bracket
186
			if (c.offset < docLength && d.getChar(c.offset) == '}') {
221
			if (whiteend == c.offset) {
187
				int indLine= findMatchingOpenBracket(d, line, c.offset, 0);
222
				// evaluate the line with the opening bracket that matches out closing bracket
188
				if (indLine == -1) {
223
				int reference = indenter.findReferencePosition(c.offset, false, true, false, false);
189
					indLine= line;
224
				int indLine = d.getLineOfOffset(reference);
225
				if (indLine != -1 && indLine != line) {
226
					// take the indent of the found line
227
					StringBuffer replaceText = new StringBuffer(getIndentOfLine(d, indLine));
228
					// add the rest of the current line including the just added close bracket
229
					replaceText.append(d.get(whiteend, c.offset - whiteend));
230
					replaceText.append(c.text);
231
					// modify document command
232
					c.length += c.offset - start;
233
					c.offset = start;
234
					c.text = replaceText.toString();
190
				}
235
				}
191
				buf.append(getIndentOfLine(d, indLine));
236
			}
192
			} else {
237
		} catch (BadLocationException e) {
193
				int start= d.getLineOffset(line);
238
			CUIPlugin.getDefault().log(e);
194
				int whiteend= findEndOfWhiteSpace(d, start, c.offset);
239
		}
195
				buf.append(d.get(start, whiteend - start));
240
	}
196
				if (getBracketCount(d, start, c.offset, true) > 0) {
241
197
					buf.append('\t');
242
	private void smartIndentAfterOpeningBracket(IDocument d, DocumentCommand c) {
243
		if (c.offset < 1 || d.getLength() == 0)
244
			return;
245
246
		CHeuristicScanner scanner = new CHeuristicScanner(d);
247
248
		int p = (c.offset == d.getLength() ? c.offset - 1 : c.offset);
249
250
		try {
251
			// current line
252
			int line = d.getLineOfOffset(p);
253
			int lineOffset = d.getLineOffset(line);
254
255
			// make sure we don't have any leading comments etc.
256
			if (d.get(lineOffset, p - lineOffset).trim().length() != 0)
257
				return;
258
259
			// line of last javacode
260
			int pos = scanner.findNonWhitespaceBackward(p, CHeuristicScanner.UNBOUND);
261
			if (pos == -1)
262
				return;
263
			int lastLine = d.getLineOfOffset(pos);
264
265
			// only shift if the last java line is further up and is a braceless block candidate
266
			if (lastLine < line) {
267
				CIndenter indenter = new CIndenter(d, scanner, fProject);
268
				StringBuffer indent = indenter.computeIndentation(p, true);
269
				String toDelete = d.get(lineOffset, c.offset - lineOffset);
270
				if (indent != null && !indent.toString().equals(toDelete)) {
271
					c.text = indent.append(c.text).toString();
272
					c.length += c.offset - lineOffset;
273
					c.offset = lineOffset;
198
				}
274
				}
199
			}
275
			}
200
			c.text= buf.toString();
201
276
277
		} catch (BadLocationException e) {
278
			CUIPlugin.getDefault().log(e);
279
		}
280
	}
202
281
203
		} catch (BadLocationException excp) {
282
	private void smartIndentAfterNewLine(IDocument d, DocumentCommand c) {
204
			CUIPlugin.getDefault().log(excp);
283
		CHeuristicScanner scanner = new CHeuristicScanner(d);
284
		CIndenter indenter = new CIndenter(d, scanner, fProject);
285
		StringBuffer indent = indenter.computeIndentation(c.offset);
286
		if (indent == null)
287
			indent = new StringBuffer(); 
288
289
		int docLength = d.getLength();
290
		if (c.offset == -1 || docLength == 0)
291
			return;
292
293
		try {
294
			int p = (c.offset == docLength ? c.offset - 1 : c.offset);
295
			int line = d.getLineOfOffset(p);
296
297
			StringBuffer buf = new StringBuffer(c.text + indent);
298
299
			IRegion reg = d.getLineInformation(line);
300
			int lineEnd = reg.getOffset() + reg.getLength();
301
302
			int contentStart = findEndOfWhiteSpace(d, c.offset, lineEnd);
303
			c.length =  Math.max(contentStart - c.offset, 0);
304
305
			int start = reg.getOffset();
306
307
			// insert closing brace on new line after an unclosed opening brace
308
			if (getBracketCount(d, start, c.offset, true) > 0 && fCloseBrace && !isClosedBrace(d, c.offset, c.length)) {
309
				c.caretOffset = c.offset + buf.length();
310
				c.shiftsCaret = false;
311
312
				// copy old content of line behind insertion point to new line
313
				// unless we think we are inserting an anonymous type definition
314
				if (c.offset == 0 || !(computeAnonymousPosition(d, c.offset - 1, fPartitioning, lineEnd) != -1)) {
315
					if (lineEnd - contentStart > 0) {
316
						c.length =  lineEnd - c.offset;
317
						buf.append(d.get(contentStart, lineEnd - contentStart).toCharArray());
318
					}
319
				}
320
321
				buf.append(TextUtilities.getDefaultLineDelimiter(d));
322
				StringBuffer reference = null;
323
				int nonWS = findEndOfWhiteSpace(d, start, lineEnd);
324
				if (nonWS < c.offset && d.getChar(nonWS) == '{')
325
					reference = new StringBuffer(d.get(start, nonWS - start));
326
				else
327
					reference = indenter.getReferenceIndentation(c.offset);
328
				if (reference != null)
329
					buf.append(reference);
330
				buf.append('}');
331
			}
332
			// insert extra line upon new line between two braces
333
			else if (c.offset > start && contentStart < lineEnd && d.getChar(contentStart) == '}') {
334
				int firstCharPos = scanner.findNonWhitespaceBackward(c.offset - 1, start);
335
				if (firstCharPos != CHeuristicScanner.NOT_FOUND && d.getChar(firstCharPos) == '{') {
336
					c.caretOffset = c.offset + buf.length();
337
					c.shiftsCaret = false;
338
339
					StringBuffer reference = null;
340
					int nonWS = findEndOfWhiteSpace(d, start, lineEnd);
341
					if (nonWS < c.offset && d.getChar(nonWS) == '{')
342
						reference = new StringBuffer(d.get(start, nonWS - start));
343
					else
344
						reference = indenter.getReferenceIndentation(c.offset);
345
346
					buf.append(TextUtilities.getDefaultLineDelimiter(d));
347
348
					if (reference != null)
349
						buf.append(reference);
350
				}
351
			}
352
			c.text = buf.toString();
353
354
		} catch (BadLocationException e) {
355
			CUIPlugin.getDefault().log(e);
205
		}
356
		}
206
	}
357
	}
207
	
358
	
208
	/**
359
	/**
209
	 * Returns whether the text ends with one of the given search strings.
360
	 * Computes an insert position for an opening brace if <code>offset</code> maps to a position in
361
	 * <code>document</code> with a expression in parenthesis that will take a block after the closing parenthesis.
362
	 *
363
	 * @param document the document being modified
364
	 * @param offset the offset of the caret position, relative to the line start.
365
	 * @param partitioning the document partitioning
366
	 * @param max the max position
367
	 * @return an insert position relative to the line start if <code>line</code> contains a parenthesized expression that can be followed by a block, -1 otherwise
210
	 */
368
	 */
211
	private boolean endsWithDelimiter(IDocument d, String txt) {
369
	private static int computeAnonymousPosition(IDocument document, int offset, String partitioning,  int max) {
212
		String[] delimiters= d.getLegalLineDelimiters();
370
		// find the opening parenthesis for every closing parenthesis on the current line after offset
213
		
371
		// return the position behind the closing parenthesis if it looks like a method declaration
214
		for (int i= 0; i < delimiters.length; i++) {
372
		// or an expression for an if, while, for, catch statement
215
			if (txt.endsWith(delimiters[i]))
373
216
				return true;
374
		CHeuristicScanner scanner = new CHeuristicScanner(document);
375
		int pos = offset;
376
		int length = max;
377
		int scanTo = scanner.scanForward(pos, length, '}');
378
		if (scanTo == -1)
379
			scanTo = length;
380
381
		int closingParen = findClosingParenToLeft(scanner, pos) - 1;
382
383
		while (true) {
384
			int startScan = closingParen + 1;
385
			closingParen = scanner.scanForward(startScan, scanTo, ')');
386
			if (closingParen == -1)
387
				break;
388
389
			int openingParen = scanner.findOpeningPeer(closingParen - 1, '(', ')');
390
391
			// no way an expression at the beginning of the document can mean anything
392
			if (openingParen < 1)
393
				break;
394
395
			// only select insert positions for parenthesis currently embracing the caret
396
			if (openingParen > pos)
397
				continue;
217
		}
398
		}
399
400
		return -1;
401
	}
402
403
	/**
404
	 * Finds a closing parenthesis to the left of <code>position</code> in document, where that parenthesis is only
405
	 * separated by whitespace from <code>position</code>. If no such parenthesis can be found, <code>position</code> is returned.
406
	 *
407
	 * @param scanner the java heuristic scanner set up on the document
408
	 * @param position the first character position in <code>document</code> to be considered
409
	 * @return the position of a closing parenthesis left to <code>position</code> separated only by whitespace, or <code>position</code> if no parenthesis can be found
410
	 */
411
	private static int findClosingParenToLeft(CHeuristicScanner scanner, int position) {
412
		if (position < 1)
413
			return position;
414
415
		if (scanner.previousToken(position - 1, CHeuristicScanner.UNBOUND) == Symbols.TokenRPAREN)
416
			return scanner.getPosition() + 1;
417
		return position;
418
	}
419
420
	private boolean isClosedBrace(IDocument document, int offset, int length) {
421
		CompilationUnitInfo info = getCompilationUnitForMethod(document, offset, fPartitioning);
422
		if (info == null)
423
			return false;
424
425
		return getBlockBalance(document, offset, fPartitioning) <= 0;
426
		//TODO: Use smarter algorithm based on 
427
//		CodeReader reader = new CodeReader(info.buffer);
428
//		ICodeReaderFactory fileCreator = CDOM.getInstance().getCodeReaderFactory(CDOM.PARSE_WORKING_COPY_WHENEVER_POSSIBLE);
429
//		
430
//		IScanner domScanner = new DOMScanner(reader, new ScannerInfo(), ParserMode.COMPLETE_PARSE,
431
//				ParserLanguage.C, ParserFactory.createDefaultLogService(),
432
//				C_GNU_SCANNER_EXTENSION, fileCreator);
433
//		
434
//		ISourceCodeParser parser = new GNUCPPSourceParser(
435
//				domScanner,
436
//				ParserMode.COMPLETE_PARSE,
437
//				ParserUtil.getParserLogService(),
438
//				new GPPParserExtensionConfiguration());
439
//	
440
//		IASTTranslationUnit translationUnit = parser.parse();
441
//		final int relativeOffset = offset - info.delta;
442
//	    IASTNode node = translationUnit.selectNodeForLocation(reader.getPath(), relativeOffset, length);
443
//		
444
//		if (node == null)
445
//			return false;
446
//
447
//		if (node instanceof IASTCompoundStatement) {
448
//			return getBlockBalance(document, offset, fPartitioning) <= 0;
449
//		} else if (node instanceof IASTIfStatement) { 
450
//			IASTIfStatement ifStatement = (IASTIfStatement) node;
451
//			IASTExpression expression = ifStatement.getConditionExpression();
452
//			IRegion expressionRegion = createRegion(expression, info.delta);
453
//			IASTStatement thenStatement = ifStatement.getThenClause();
454
//			IRegion thenRegion = createRegion(thenStatement, info.delta);
455
//
456
//			// Between expression and then statement
457
//			if (expressionRegion.getOffset() + expressionRegion.getLength() <= offset && offset + length <= thenRegion.getOffset())
458
//				return thenStatement != null;
459
//
460
//			IASTStatement elseStatement = ifStatement.getElseClause();
461
//			IRegion elseRegion = createRegion(elseStatement, info.delta);
462
//
463
//			if (elseStatement != null) {
464
//				int sourceOffset = thenRegion.getOffset() + thenRegion.getLength();
465
//				int sourceLength = elseRegion.getOffset() - sourceOffset;
466
//				CHeuristicScanner scanner = new CHeuristicScanner(new SimpleDocument(info.buffer));
467
//				int pos = sourceOffset;
468
//				int id;
469
//				while ((id = scanner.nextToken(pos, sourceOffset + sourceLength - pos)) != CHeuristicScanner.TokenEOF) {
470
//					if (id == CHeuristicScanner.TokenELSE) {
471
//						pos = scanner.getPosition();
472
//						// Between 'else' token and else statement.
473
//						return pos <= offset && offset + length < elseRegion.getOffset();
474
//					}
475
//				}
476
//				
477
//				return true;
478
//			}
479
//		} else if (node instanceof IASTForStatement) {
480
//			IASTExpression expression = ((IASTForStatement) node).getConditionExpression();
481
//			IRegion expressionRegion = createRegion(expression, info.delta);
482
//			IASTStatement body = ((IASTForStatement) node).getBody();
483
//			IRegion bodyRegion = createRegion(body, info.delta);
484
//
485
//			// Between expression and body statement
486
//			if (expressionRegion.getOffset() + expressionRegion.getLength() <= offset && offset + length <= bodyRegion.getOffset()) {
487
//				return body != null;
488
//			}
489
//		} else if (node instanceof IASTWhileStatement) {
490
//			IASTExpression expression = ((IASTWhileStatement) node).getCondition();
491
//			IRegion expressionRegion = createRegion(expression, info.delta);
492
//			IASTStatement body = ((IASTWhileStatement) node).getBody();
493
//			IRegion bodyRegion = createRegion(body, info.delta);
494
//
495
//			// Between expression and body statement
496
//			if (expressionRegion.getOffset() + expressionRegion.getLength() <= offset && offset + length <= bodyRegion.getOffset()) {
497
//				return body != null;
498
//			}
499
//		} else if (node instanceof IASTDoStatement) {
500
//			IASTDoStatement doStatement = (IASTDoStatement) node;
501
//			IRegion doRegion = createRegion(doStatement, info.delta);
502
//			IASTStatement body = doStatement.getBody();
503
//			IRegion bodyRegion = createRegion(body, info.delta);
504
//
505
//			// Between 'do' and body statement.
506
//			if (doRegion.getOffset() + doRegion.getLength() <= offset && offset + length <= bodyRegion.getOffset()) {
507
//				return body != null;
508
//			}
509
//		}
510
//
511
//		return true;
512
	}
513
514
    private boolean isLineDelimiter(IDocument document, String text) {
515
		String[] delimiters = document.getLegalLineDelimiters();
516
		if (delimiters != null)
517
			return TextUtilities.equals(delimiters, text) > -1;
218
		return false;
518
		return false;
219
	}	
519
	}
520
521
	private void smartIndentOnKeypress(IDocument document, DocumentCommand command) {
522
		switch (command.text.charAt(0)) {
523
			case '}':
524
				smartIndentAfterClosingBracket(document, command);
525
				break;
526
			case '{':
527
				smartIndentAfterOpeningBracket(document, command);
528
				break;
529
			case 'e':
530
				smartIndentUponE(document, command);
531
				break;
532
		}
533
	}
534
535
	private void smartIndentUponE(IDocument d, DocumentCommand c) {
536
		if (c.offset < 4 || d.getLength() == 0)
537
			return;
538
539
		try {
540
			String content = d.get(c.offset - 3, 3);
541
			if (content.equals("els")) { //$NON-NLS-1$
542
				CHeuristicScanner scanner = new CHeuristicScanner(d);
543
				int p = c.offset - 3;
544
545
				// current line
546
				int line = d.getLineOfOffset(p);
547
				int lineOffset = d.getLineOffset(line);
548
549
				// make sure we don't have any leading comments etc.
550
				if (d.get(lineOffset, p - lineOffset).trim().length() != 0)
551
					return;
552
553
				// line of last javacode
554
				int pos = scanner.findNonWhitespaceBackward(p - 1, CHeuristicScanner.UNBOUND);
555
				if (pos == -1)
556
					return;
557
				int lastLine = d.getLineOfOffset(pos);
558
559
				// only shift if the last java line is further up and is a braceless block candidate
560
				if (lastLine < line) {
561
562
					CIndenter indenter = new CIndenter(d, scanner, fProject);
563
					int ref = indenter.findReferencePosition(p, true, false, false, false);
564
					if (ref == CHeuristicScanner.NOT_FOUND)
565
						return;
566
					int refLine = d.getLineOfOffset(ref);
567
					String indent = getIndentOfLine(d, refLine);
568
569
					if (indent != null) {
570
						c.text = indent.toString() + "else"; //$NON-NLS-1$
571
						c.length += c.offset - lineOffset;
572
						c.offset = lineOffset;
573
					}
574
				}
575
576
				return;
577
			}
578
579
			if (content.equals("cas")) { //$NON-NLS-1$
580
				CHeuristicScanner scanner = new CHeuristicScanner(d);
581
				int p = c.offset - 3;
582
583
				// current line
584
				int line = d.getLineOfOffset(p);
585
				int lineOffset = d.getLineOffset(line);
586
587
				// make sure we don't have any leading comments etc.
588
				if (d.get(lineOffset, p - lineOffset).trim().length() != 0)
589
					return;
590
591
				// line of last javacode
592
				int pos = scanner.findNonWhitespaceBackward(p - 1, CHeuristicScanner.UNBOUND);
593
				if (pos == -1)
594
					return;
595
				int lastLine = d.getLineOfOffset(pos);
596
597
				// only shift if the last java line is further up and is a braceless block candidate
598
				if (lastLine < line) {
599
600
					CIndenter indenter = new CIndenter(d, scanner, fProject);
601
					int ref = indenter.findReferencePosition(p, false, false, false, true);
602
					if (ref == CHeuristicScanner.NOT_FOUND)
603
						return;
604
					int refLine = d.getLineOfOffset(ref);
605
					int nextToken = scanner.nextToken(ref, CHeuristicScanner.UNBOUND);
606
					String indent;
607
					if (nextToken == Symbols.TokenCASE || nextToken == Symbols.TokenDEFAULT)
608
						indent = getIndentOfLine(d, refLine);
609
					else // at the brace of the switch
610
						indent = indenter.computeIndentation(p).toString();
611
612
					if (indent != null) {
613
						c.text = indent.toString() + "case"; //$NON-NLS-1$
614
						c.length += c.offset - lineOffset;
615
						c.offset = lineOffset;
616
					}
617
				}
618
619
				return;
620
			}
621
		} catch (BadLocationException e) {
622
			CUIPlugin.getDefault().log(e);
623
		}
624
	}
220
625
221
	/*
626
	/*
222
	 * @see org.eclipse.jface.text.DefaultIndentLineAutoEditStrategy#customizeDocumentCommand(org.eclipse.jface.text.IDocument, org.eclipse.jface.text.DocumentCommand)
627
	 * @see org.eclipse.jface.text.IAutoEditStrategy#customizeDocumentCommand(IDocument, DocumentCommand)
223
	 */
628
	 */
224
	public void customizeDocumentCommand(IDocument d, DocumentCommand c) {
629
	public void customizeDocumentCommand(IDocument d, DocumentCommand c) {
225
		if (c.length == 0 && c.text != null && endsWithDelimiter(d, c.text)) {
630
		if (!c.doit)
631
			return;
632
633
		clearCachedValues();
634
		if (!fIsSmartMode) {
635
			super.customizeDocumentCommand(d, c);
636
			return;
637
		}
638
639
		if (c.length == 0 && c.text != null && isLineDelimiter(d, c.text)) {
226
			if (isAppendToOpenMultilineComment(d, c)) {
640
			if (isAppendToOpenMultilineComment(d, c)) {
227
				// special case: multi-line comment at end of document (bug 48339)
641
				// special case: multi-line comment at end of document (bug 48339)
228
				CCommentAutoIndentStrategy.commentIndentAfterNewLine(d, c);
642
				CCommentAutoIndentStrategy.commentIndentAfterNewLine(d, c);
229
			} else {
643
			} else {
230
				smartIndentAfterNewLine(d, c);
644
				smartIndentAfterNewLine(d, c);
231
			}
645
			}
232
		} else if ("}".equals(c.text)) { //$NON-NLS-1$
646
		} else if ("/".equals(c.text) && isAppendToOpenMultilineComment(d, c)) { //$NON-NLS-1$
233
			smartInsertAfterBracket(d, c);
234
		}
235
		else if ("/".equals(c.text) && isAppendToOpenMultilineComment(d, c)) { //$NON-NLS-1$
236
			// special case: multi-line comment at end of document (bug 48339)
647
			// special case: multi-line comment at end of document (bug 48339)
237
			CCommentAutoIndentStrategy.commentIndentForCommentEnd(d, c);
648
			CCommentAutoIndentStrategy.commentIndentForCommentEnd(d, c);
649
		} else if (c.text.length() == 1) {
650
			smartIndentOnKeypress(d, c);
651
// TODO Support smart paste.
652
//		} else if (c.text.length() > 1 && getPreferenceStore().getBoolean(PreferenceConstants.EDITOR_SMART_PASTE)) {
653
//			smartPaste(d, c); // no smart backspace for paste
238
		}
654
		}
239
	}
655
	}
240
	
656
	
Lines 259-262 Link Here
259
		return false;
675
		return false;
260
	}
676
	}
261
677
678
	private static IPreferenceStore getPreferenceStore() {
679
		return CUIPlugin.getDefault().getCombinedPreferenceStore();
680
	}
681
682
	private void clearCachedValues() {
683
        IPreferenceStore preferenceStore = getPreferenceStore();
684
		fCloseBrace = preferenceStore.getBoolean(PreferenceConstants.EDITOR_CLOSE_BRACES);
685
		fIsSmartMode = computeSmartMode();
686
	}
687
688
	private boolean computeSmartMode() {
689
		IWorkbenchPage page = CUIPlugin.getActivePage();
690
		if (page != null)  {
691
			IEditorPart part = page.getActiveEditor();
692
			if (part instanceof ITextEditorExtension3) {
693
				ITextEditorExtension3 extension = (ITextEditorExtension3) part;
694
				return extension.getInsertMode() == ITextEditorExtension3.SMART_INSERT;
695
			}
696
			if (part == null) {
697
				// TODO: Remove this if statement once CAutoIndentTest is fixed so that getActiveEditor does not return null.
698
				return true;
699
			}
700
		}
701
		return false;
702
	}
703
704
	private static CompilationUnitInfo getCompilationUnitForMethod(IDocument document, int offset, String partitioning) {
705
		try {
706
			CHeuristicScanner scanner = new CHeuristicScanner(document);
707
708
			IRegion sourceRange = scanner.findSurroundingBlock(offset);
709
			if (sourceRange == null)
710
				return null;
711
			String source = document.get(sourceRange.getOffset(), sourceRange.getLength());
712
713
			StringBuffer contents = new StringBuffer();
714
			contents.append("class ____C{void ____m()"); //$NON-NLS-1$
715
			final int methodOffset = contents.length();
716
			contents.append(source);
717
			contents.append("};"); //$NON-NLS-1$
718
719
			char[] buffer = contents.toString().toCharArray();
720
			return new CompilationUnitInfo(buffer, sourceRange.getOffset() - methodOffset);
721
		} catch (BadLocationException e) {
722
			CUIPlugin.getDefault().log(e);
723
		}
724
725
		return null;
726
	}
727
728
	/**
729
	 * Returns the block balance, i.e. zero if the blocks are balanced at
730
	 * <code>offset</code>, a negative number if there are more closing than opening
731
	 * braces, and a positive number if there are more opening than closing braces.
732
	 *
733
	 * @param document
734
	 * @param offset
735
	 * @param partitioning
736
	 * @return the block balance
737
	 */
738
	private static int getBlockBalance(IDocument document, int offset, String partitioning) {
739
		if (offset < 1)
740
			return -1;
741
		if (offset >= document.getLength())
742
			return 1;
743
744
		int begin = offset;
745
		int end = offset - 1;
746
747
		CHeuristicScanner scanner = new CHeuristicScanner(document);
748
749
		while (true) {
750
			begin = scanner.findOpeningPeer(begin - 1, '{', '}');
751
			end = scanner.findClosingPeer(end + 1, '{', '}');
752
			if (begin == -1 && end == -1)
753
				return 0;
754
			if (begin == -1)
755
				return -1;
756
			if (end == -1)
757
				return 1;
758
		}
759
	}
760
761
//	private static IRegion createRegion(IASTNode node, int delta) {
762
//		IASTNodeLocation nodeLocation = node.getNodeLocations()[0];
763
//		return node == null ? null : new Region(nodeLocation.getNodeOffset() + delta, nodeLocation.getNodeLength());
764
//	}
262
}
765
}
(-)src/org/eclipse/cdt/internal/ui/editor/CEditor.java (-29 / +27 lines)
Lines 1428-1479 Link Here
1428
		}
1428
		}
1429
		
1429
		
1430
		public void customizeDocumentCommand(IDocument document, DocumentCommand command) {
1430
		public void customizeDocumentCommand(IDocument document, DocumentCommand command) {
1431
			String text= command.text;
1431
			String text = command.text;
1432
			if (text == null)
1432
			if (text == null)
1433
				return;
1433
				return;
1434
				
1434
				
1435
			int index= text.indexOf('\t');
1435
			int index = text.indexOf('\t');
1436
			if (index > -1) {
1436
			if (index > -1) {
1437
				
1437
				StringBuffer buffer = new StringBuffer();
1438
				StringBuffer buffer= new StringBuffer();
1439
				
1438
				
1440
				fLineTracker.set(command.text);
1439
				fLineTracker.set(command.text);
1441
				int lines= fLineTracker.getNumberOfLines();
1440
				int lines = fLineTracker.getNumberOfLines();
1442
				
1441
				
1443
				try {
1442
				try {
1443
					for (int i = 0; i < lines; i++) {
1444
						int offset = fLineTracker.getLineOffset(i);
1445
						int endOffset = offset + fLineTracker.getLineLength(i);
1446
						String line = text.substring(offset, endOffset);
1444
						
1447
						
1445
						for (int i= 0; i < lines; i++) {
1448
						int position= 0;
1446
							
1449
						if (i == 0) {
1447
							int offset= fLineTracker.getLineOffset(i);
1450
							IRegion firstLine = document.getLineInformationOfOffset(command.offset);
1448
							int endOffset= offset + fLineTracker.getLineLength(i);
1451
							position = command.offset - firstLine.getOffset();	
1449
							String line= text.substring(offset, endOffset);
1452
						}
1450
							
1453
						
1451
							int position= 0;
1454
						int length = line.length();
1452
							if (i == 0) {
1455
						for (int j = 0; j < length; j++) {
1453
								IRegion firstLine= document.getLineInformationOfOffset(command.offset);
1456
							char c = line.charAt(j);
1454
								position= command.offset - firstLine.getOffset();	
1457
							if (c == '\t') {
1455
							}
1458
								int oldPosition = position;
1456
							
1459
								position += insertTabString(buffer, position);
1457
							int length= line.length();
1460
								if (command.caretOffset > command.offset + oldPosition) {
1458
							for (int j= 0; j < length; j++) {
1461
									command.caretOffset += position - oldPosition - 1;
1459
								char c= line.charAt(j);
1460
								if (c == '\t') {
1461
									position += insertTabString(buffer, position);
1462
								} else {
1463
									buffer.append(c);
1464
									++ position;
1465
								}
1462
								}
1463
							} else {
1464
								buffer.append(c);
1465
								++position;
1466
							}
1466
							}
1467
							
1468
						}
1467
						}
1468
					}
1469
						
1469
						
1470
						command.text= buffer.toString();
1470
					command.text = buffer.toString();
1471
						
1472
				} catch (BadLocationException x) {
1471
				} catch (BadLocationException x) {
1473
				}
1472
				}
1474
			}
1473
			}
1475
		}
1474
		}
1476
1477
	}
1475
	}
1478
1476
1479
	/*
1477
	/*
(-)src/org/eclipse/cdt/ui/text/ICPartitions.java (+47 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2005 IBM Corporation and others.
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
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.cdt.ui.text;
12
13
/**
14
 * Definition of C partitioning and its partitions.
15
 */
16
public interface ICPartitions {
17
18
	/**
19
	 * The identifier of the C partitioning.
20
	 */
21
	String C_PARTITIONING= "___c_partitioning";  //$NON-NLS-1$
22
23
	/**
24
	 * The identifier of the single-line end comment partition content type.
25
	 */
26
	String C_SINGLE_LINE_COMMENT= "__c_singleline_comment"; //$NON-NLS-1$
27
28
	/**
29
	 * The identifier multi-line comment partition content type.
30
	 */
31
	String C_MULTI_LINE_COMMENT= "__c_multiline_comment"; //$NON-NLS-1$
32
33
//	/**
34
//	 * The identifier of the Javadoc partition content type.
35
//	 */
36
//	String C_DOC= "__c_javadoc"; //$NON-NLS-1$
37
38
	/**
39
	 * The identifier of the C string partition content type.
40
	 */
41
	String C_STRING= "__c_string"; //$NON-NLS-1$
42
43
	/**
44
	 * The identifier of the C character partition content type.
45
	 */
46
	String C_CHARACTER= "__c_character";  //$NON-NLS-1$
47
}
(-)src/org/eclipse/cdt/internal/ui/text/CHeuristicScanner.java (+867 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2006 IBM Corporation and others.
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
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.cdt.internal.ui.text;
12
13
import java.util.Arrays;
14
15
import org.eclipse.cdt.ui.text.ICPartitions;
16
17
import org.eclipse.jface.text.Assert;
18
import org.eclipse.jface.text.BadLocationException;
19
import org.eclipse.jface.text.IDocument;
20
import org.eclipse.jface.text.IRegion;
21
import org.eclipse.jface.text.ITypedRegion;
22
import org.eclipse.jface.text.Region;
23
import org.eclipse.jface.text.TextUtilities;
24
import org.eclipse.jface.text.TypedRegion;
25
26
/**
27
 * Utility methods for heuristic based C manipulations in an incomplete C source file.
28
 *
29
 * <p>An instance holds some internal position in the document and is therefore not threadsafe.</p>
30
 */
31
public final class CHeuristicScanner implements Symbols {
32
	/**
33
	 * Returned by all methods when the requested position could not be found, or if a
34
	 * {@link BadLocationException} was thrown while scanning.
35
	 */
36
	public static final int NOT_FOUND= -1;
37
38
	/**
39
	 * Special bound parameter that means either -1 (backward scanning) or
40
	 * <code>fDocument.getLength()</code> (forward scanning).
41
	 */
42
	public static final int UNBOUND= -2;
43
44
45
	/* character constants */
46
	private static final char LBRACE= '{';
47
	private static final char RBRACE= '}';
48
	private static final char LPAREN= '(';
49
	private static final char RPAREN= ')';
50
	private static final char SEMICOLON= ';';
51
	private static final char COLON= ':';
52
	private static final char COMMA= ',';
53
	private static final char LBRACKET= '[';
54
	private static final char RBRACKET= ']';
55
	private static final char QUESTIONMARK= '?';
56
	private static final char EQUAL= '=';
57
	private static final char LANGLE= '<';
58
	private static final char RANGLE= '>';
59
60
	/**
61
	 * Specifies the stop condition, upon which the <code>scanXXX</code> methods will decide whether
62
	 * to keep scanning or not. This interface may implemented by clients.
63
	 */
64
	private static abstract class StopCondition {
65
		/**
66
		 * Instructs the scanner to return the current position.
67
		 *
68
		 * @param ch the char at the current position
69
		 * @param position the current position
70
		 * @param forward the iteration direction
71
		 * @return <code>true</code> if the stop condition is met.
72
		 */
73
		public abstract boolean stop(char ch, int position, boolean forward);
74
75
		/**
76
		 * Asks the condition to return the next position to query. The default
77
		 * is to return the next/previous position.
78
		 *
79
		 * @return the next position to scan
80
		 */
81
		public int nextPosition(int position, boolean forward) {
82
			return forward ? position + 1 : position - 1;
83
		}
84
	}
85
86
	/**
87
	 * Stops upon a non-whitespace (as defined by {@link Character#isWhitespace(char)}) character.
88
	 */
89
	private static class NonWhitespace extends StopCondition {
90
		/*
91
		 * @see org.eclipse.jdt.internal.ui.text.JavaHeuristicScanner.StopCondition#stop(char)
92
		 */
93
		public boolean stop(char ch, int position, boolean forward) {
94
			return !Character.isWhitespace(ch);
95
		}
96
	}
97
98
	/**
99
	 * Stops upon a non-whitespace character in the default partition.
100
	 *
101
	 * @see NonWhitespace
102
	 */
103
	private final class NonWhitespaceDefaultPartition extends NonWhitespace {
104
		/*
105
		 * @see org.eclipse.jdt.internal.ui.text.JavaHeuristicScanner.StopCondition#stop(char)
106
		 */
107
		public boolean stop(char ch, int position, boolean forward) {
108
			return super.stop(ch, position, true) && isDefaultPartition(position);
109
		}
110
111
		/*
112
		 * @see org.eclipse.jdt.internal.ui.text.JavaHeuristicScanner.StopCondition#nextPosition(int, boolean)
113
		 */
114
		public int nextPosition(int position, boolean forward) {
115
			ITypedRegion partition= getPartition(position);
116
			if (fPartition.equals(partition.getType()))
117
				return super.nextPosition(position, forward);
118
119
			if (forward) {
120
				int end= partition.getOffset() + partition.getLength();
121
				if (position < end)
122
					return end;
123
			} else {
124
				int offset= partition.getOffset();
125
				if (position > offset)
126
					return offset - 1;
127
			}
128
			return super.nextPosition(position, forward);
129
		}
130
	}
131
132
	/**
133
	 * Stops upon a non-java identifier (as defined by {@link Character#isJavaIdentifierPart(char)}) character.
134
	 */
135
	private static class NonJavaIdentifierPart extends StopCondition {
136
		/*
137
		 * @see org.eclipse.jdt.internal.ui.text.JavaHeuristicScanner.StopCondition#stop(char)
138
		 */
139
		public boolean stop(char ch, int position, boolean forward) {
140
			return !Character.isJavaIdentifierPart(ch);
141
		}
142
	}
143
144
	/**
145
	 * Stops upon a non-java identifier character in the default partition.
146
	 *
147
	 * @see NonJavaIdentifierPart
148
	 */
149
	private final class NonJavaIdentifierPartDefaultPartition extends NonJavaIdentifierPart {
150
		/*
151
		 * @see org.eclipse.jdt.internal.ui.text.JavaHeuristicScanner.StopCondition#stop(char)
152
		 */
153
		public boolean stop(char ch, int position, boolean forward) {
154
			return super.stop(ch, position, true) || !isDefaultPartition(position);
155
		}
156
157
		/*
158
		 * @see org.eclipse.jdt.internal.ui.text.JavaHeuristicScanner.StopCondition#nextPosition(int, boolean)
159
		 */
160
		public int nextPosition(int position, boolean forward) {
161
			ITypedRegion partition= getPartition(position);
162
			if (fPartition.equals(partition.getType()))
163
				return super.nextPosition(position, forward);
164
165
			if (forward) {
166
				int end= partition.getOffset() + partition.getLength();
167
				if (position < end)
168
					return end;
169
			} else {
170
				int offset= partition.getOffset();
171
				if (position > offset)
172
					return offset - 1;
173
			}
174
			return super.nextPosition(position, forward);
175
		}
176
	}
177
178
	/**
179
	 * Stops upon a character in the default partition that matches the given character list.
180
	 */
181
	private final class CharacterMatch extends StopCondition {
182
		private final char[] fChars;
183
184
		/**
185
		 * Creates a new instance.
186
		 * @param ch the single character to match
187
		 */
188
		public CharacterMatch(char ch) {
189
			this(new char[] {ch});
190
		}
191
192
		/**
193
		 * Creates a new instance.
194
		 * @param chars the chars to match.
195
		 */
196
		public CharacterMatch(char[] chars) {
197
			Assert.isNotNull(chars);
198
			Assert.isTrue(chars.length > 0);
199
			fChars= chars;
200
			Arrays.sort(chars);
201
		}
202
203
		/*
204
		 * @see org.eclipse.jdt.internal.ui.text.JavaHeuristicScanner.StopCondition#stop(char, int)
205
		 */
206
		public boolean stop(char ch, int position, boolean forward) {
207
			return Arrays.binarySearch(fChars, ch) >= 0 && isDefaultPartition(position);
208
		}
209
210
		/*
211
		 * @see org.eclipse.jdt.internal.ui.text.JavaHeuristicScanner.StopCondition#nextPosition(int, boolean)
212
		 */
213
		public int nextPosition(int position, boolean forward) {
214
			ITypedRegion partition= getPartition(position);
215
			if (fPartition.equals(partition.getType()))
216
				return super.nextPosition(position, forward);
217
218
			if (forward) {
219
				int end= partition.getOffset() + partition.getLength();
220
				if (position < end)
221
					return end;
222
			} else {
223
				int offset= partition.getOffset();
224
				if (position > offset)
225
					return offset - 1;
226
			}
227
			return super.nextPosition(position, forward);
228
		}
229
	}
230
231
	/** The document being scanned. */
232
	private final IDocument fDocument;
233
	/** The partitioning being used for scanning. */
234
	private final String fPartitioning;
235
	/** The partition to scan in. */
236
	private final String fPartition;
237
238
	/* internal scan state */
239
240
	/** the most recently read character. */
241
	private char fChar;
242
	/** the most recently read position. */
243
	private int fPos;
244
	/**
245
	 * The most recently used partition.
246
	 */
247
	private ITypedRegion fCachedPartition= new TypedRegion(-1, 0, "__no_partition_at_all"); //$NON-NLS-1$
248
249
	/* preset stop conditions */
250
	private final StopCondition fNonWSDefaultPart= new NonWhitespaceDefaultPartition();
251
	private final static StopCondition fNonWS= new NonWhitespace();
252
	private final StopCondition fNonIdent= new NonJavaIdentifierPartDefaultPartition();
253
254
	/**
255
	 * Creates a new instance.
256
	 *
257
	 * @param document the document to scan
258
	 * @param partitioning the partitioning to use for scanning
259
	 * @param partition the partition to scan in
260
	 */
261
	public CHeuristicScanner(IDocument document, String partitioning, String partition) {
262
		Assert.isLegal(document != null);
263
		Assert.isLegal(partitioning != null);
264
		Assert.isLegal(partition != null);
265
		fDocument= document;
266
		fPartitioning= partitioning;
267
		fPartition= partition;
268
	}
269
270
	/**
271
	 * Calls <code>this(document, IJavaPartitions.JAVA_PARTITIONING, IDocument.DEFAULT_CONTENT_TYPE)</code>.
272
	 *
273
	 * @param document the document to scan.
274
	 */
275
	public CHeuristicScanner(IDocument document) {
276
		this(document, ICPartitions.C_PARTITIONING, IDocument.DEFAULT_CONTENT_TYPE);
277
	}
278
279
	/**
280
	 * Returns the most recent internal scan position.
281
	 *
282
	 * @return the most recent internal scan position.
283
	 */
284
	public int getPosition() {
285
		return fPos;
286
	}
287
288
	/**
289
	 * Returns the next token in forward direction, starting at <code>start</code>, and not extending
290
	 * further than <code>bound</code>. The return value is one of the constants defined in {@link Symbols}.
291
	 * After a call, {@link #getPosition()} will return the position just after the scanned token
292
	 * (i.e. the next position that will be scanned).
293
	 *
294
	 * @param start the first character position in the document to consider
295
	 * @param bound the first position not to consider any more
296
	 * @return a constant from {@link Symbols} describing the next token
297
	 */
298
	public int nextToken(int start, int bound) {
299
		int pos= scanForward(start, bound, fNonWSDefaultPart);
300
		if (pos == NOT_FOUND)
301
			return TokenEOF;
302
303
		fPos++;
304
305
		switch (fChar) {
306
			case LBRACE:
307
				return TokenLBRACE;
308
			case RBRACE:
309
				return TokenRBRACE;
310
			case LBRACKET:
311
				return TokenLBRACKET;
312
			case RBRACKET:
313
				return TokenRBRACKET;
314
			case LPAREN:
315
				return TokenLPAREN;
316
			case RPAREN:
317
				return TokenRPAREN;
318
			case SEMICOLON:
319
				return TokenSEMICOLON;
320
			case COMMA:
321
				return TokenCOMMA;
322
			case QUESTIONMARK:
323
				return TokenQUESTIONMARK;
324
			case EQUAL:
325
				return TokenEQUAL;
326
			case LANGLE:
327
				return TokenLESSTHAN;
328
			case RANGLE:
329
				return TokenGREATERTHAN;
330
		}
331
332
		// else
333
		if (Character.isJavaIdentifierPart(fChar)) {
334
			// assume an identifier or keyword
335
			int from= pos, to;
336
			pos= scanForward(pos + 1, bound, fNonIdent);
337
			if (pos == NOT_FOUND)
338
				to= bound == UNBOUND ? fDocument.getLength() : bound;
339
			else
340
				to= pos;
341
342
			String identOrKeyword;
343
			try {
344
				identOrKeyword= fDocument.get(from, to - from);
345
			} catch (BadLocationException e) {
346
				return TokenEOF;
347
			}
348
349
			return getToken(identOrKeyword);
350
351
352
		} else {
353
			// operators, number literals etc
354
			return TokenOTHER;
355
		}
356
	}
357
358
	/**
359
	 * Returns the next token in backward direction, starting at <code>start</code>, and not extending
360
	 * further than <code>bound</code>. The return value is one of the constants defined in {@link Symbols}.
361
	 * After a call, {@link #getPosition()} will return the position just before the scanned token
362
	 * starts (i.e. the next position that will be scanned).
363
	 *
364
	 * @param start the first character position in the document to consider
365
	 * @param bound the first position not to consider any more
366
	 * @return a constant from {@link Symbols} describing the previous token
367
	 */
368
	public int previousToken(int start, int bound) {
369
		int pos= scanBackward(start, bound, fNonWSDefaultPart);
370
		if (pos == NOT_FOUND)
371
			return TokenEOF;
372
373
		fPos--;
374
375
		switch (fChar) {
376
			case LBRACE:
377
				return TokenLBRACE;
378
			case RBRACE:
379
				return TokenRBRACE;
380
			case LBRACKET:
381
				return TokenLBRACKET;
382
			case RBRACKET:
383
				return TokenRBRACKET;
384
			case LPAREN:
385
				return TokenLPAREN;
386
			case RPAREN:
387
				return TokenRPAREN;
388
			case SEMICOLON:
389
				return TokenSEMICOLON;
390
			case COLON:
391
				return TokenCOLON;
392
			case COMMA:
393
				return TokenCOMMA;
394
			case QUESTIONMARK:
395
				return TokenQUESTIONMARK;
396
			case EQUAL:
397
				return TokenEQUAL;
398
			case LANGLE:
399
				return TokenLESSTHAN;
400
			case RANGLE:
401
				return TokenGREATERTHAN;
402
		}
403
404
		// else
405
		if (Character.isJavaIdentifierPart(fChar)) {
406
			// assume an ident or keyword
407
			int from, to= pos + 1;
408
			pos= scanBackward(pos - 1, bound, fNonIdent);
409
			if (pos == NOT_FOUND)
410
				from= bound == UNBOUND ? 0 : bound + 1;
411
			else
412
				from= pos + 1;
413
414
			String identOrKeyword;
415
			try {
416
				identOrKeyword= fDocument.get(from, to - from);
417
			} catch (BadLocationException e) {
418
				return TokenEOF;
419
			}
420
421
			return getToken(identOrKeyword);
422
423
424
		} else {
425
			// operators, number literals etc
426
			return TokenOTHER;
427
		}
428
429
	}
430
431
	/**
432
	 * Returns one of the keyword constants or <code>TokenIDENT</code> for a scanned identifier.
433
	 *
434
	 * @param s a scanned identifier
435
	 * @return one of the constants defined in {@link Symbols}
436
	 */
437
	private int getToken(String s) {
438
		Assert.isNotNull(s);
439
440
		switch (s.length()) {
441
			case 2:
442
				if ("if".equals(s)) //$NON-NLS-1$
443
					return TokenIF;
444
				if ("do".equals(s)) //$NON-NLS-1$
445
					return TokenDO;
446
				break;
447
			case 3:
448
				if ("for".equals(s)) //$NON-NLS-1$
449
					return TokenFOR;
450
				if ("try".equals(s)) //$NON-NLS-1$
451
					return TokenTRY;
452
				if ("new".equals(s)) //$NON-NLS-1$
453
					return TokenNEW;
454
				break;
455
			case 4:
456
				if ("case".equals(s)) //$NON-NLS-1$
457
					return TokenCASE;
458
				if ("else".equals(s)) //$NON-NLS-1$
459
					return TokenELSE;
460
				if ("enum".equals(s)) //$NON-NLS-1$
461
					return TokenENUM;
462
				if ("goto".equals(s)) //$NON-NLS-1$
463
					return TokenGOTO;
464
				break;
465
			case 5:
466
				if ("break".equals(s)) //$NON-NLS-1$
467
					return TokenBREAK;
468
				if ("catch".equals(s)) //$NON-NLS-1$
469
					return TokenCATCH;
470
				if ("class".equals(s)) //$NON-NLS-1$
471
					return TokenCLASS;
472
				if ("while".equals(s)) //$NON-NLS-1$
473
					return TokenWHILE;
474
				break;
475
			case 6:
476
				if ("return".equals(s)) //$NON-NLS-1$
477
					return TokenRETURN;
478
				if ("static".equals(s)) //$NON-NLS-1$
479
					return TokenSTATIC;
480
				if ("switch".equals(s)) //$NON-NLS-1$
481
					return TokenSWITCH;
482
				break;
483
			case 7:
484
				if ("default".equals(s)) //$NON-NLS-1$
485
					return TokenDEFAULT;
486
				break;
487
		}
488
		return TokenIDENT;
489
	}
490
491
	/**
492
	 * Returns the position of the closing peer character (forward search). Any scopes introduced by opening peers
493
	 * are skipped. All peers accounted for must reside in the default partition.
494
	 *
495
	 * <p>Note that <code>start</code> must not point to the opening peer, but to the first
496
	 * character being searched.</p>
497
	 *
498
	 * @param start the start position
499
	 * @param openingPeer the opening peer character (e.g. '{')
500
	 * @param closingPeer the closing peer character (e.g. '}')
501
	 * @return the matching peer character position, or <code>NOT_FOUND</code>
502
	 */
503
	public int findClosingPeer(int start, final char openingPeer, final char closingPeer) {
504
		Assert.isLegal(start >= 0);
505
506
		try {
507
			int depth= 1;
508
			start -= 1;
509
			while (true) {
510
				start= scanForward(start + 1, UNBOUND, new CharacterMatch(new char[] {openingPeer, closingPeer}));
511
				if (start == NOT_FOUND)
512
					return NOT_FOUND;
513
514
				if (fDocument.getChar(start) == openingPeer)
515
					depth++;
516
				else
517
					depth--;
518
519
				if (depth == 0)
520
					return start;
521
			}
522
523
		} catch (BadLocationException e) {
524
			return NOT_FOUND;
525
		}
526
	}
527
528
	/**
529
	 * Returns the position of the opening peer character (backward search). Any scopes introduced by closing peers
530
	 * are skipped. All peers accounted for must reside in the default partition.
531
	 *
532
	 * <p>Note that <code>start</code> must not point to the closing peer, but to the first
533
	 * character being searched.</p>
534
	 *
535
	 * @param start the start position
536
	 * @param openingPeer the opening peer character (e.g. '{')
537
	 * @param closingPeer the closing peer character (e.g. '}')
538
	 * @return the matching peer character position, or <code>NOT_FOUND</code>
539
	 */
540
	public int findOpeningPeer(int start, char openingPeer, char closingPeer) {
541
		Assert.isLegal(start < fDocument.getLength());
542
543
		try {
544
			int depth= 1;
545
			start += 1;
546
			while (true) {
547
				start= scanBackward(start - 1, UNBOUND, new CharacterMatch(new char[] {openingPeer, closingPeer}));
548
				if (start == NOT_FOUND)
549
					return NOT_FOUND;
550
551
				if (fDocument.getChar(start) == closingPeer)
552
					depth++;
553
				else
554
					depth--;
555
556
				if (depth == 0)
557
					return start;
558
			}
559
560
		} catch (BadLocationException e) {
561
			return NOT_FOUND;
562
		}
563
	}
564
565
	/**
566
	 * Computes the surrounding block around <code>offset</code>. The search is started at the
567
	 * beginning of <code>offset</code>, i.e. an opening brace at <code>offset</code> will not be
568
	 * part of the surrounding block, but a closing brace will.
569
	 *
570
	 * @param offset the offset for which the surrounding block is computed
571
	 * @return a region describing the surrounding block, or <code>null</code> if none can be found
572
	 */
573
	public IRegion findSurroundingBlock(int offset) {
574
		if (offset < 1 || offset >= fDocument.getLength())
575
			return null;
576
577
		int begin= findOpeningPeer(offset - 1, LBRACE, RBRACE);
578
		int end= findClosingPeer(offset, LBRACE, RBRACE);
579
		if (begin == NOT_FOUND || end == NOT_FOUND)
580
			return null;
581
		return new Region(begin, end + 1 - begin);
582
	}
583
584
	/**
585
	 * Finds the smallest position in <code>fDocument</code> such that the position is &gt;= <code>position</code>
586
	 * and &lt; <code>bound</code> and <code>Character.isWhitespace(fDocument.getChar(pos))</code> evaluates to <code>false</code>
587
	 * and the position is in the default partition.
588
	 *
589
	 * @param position the first character position in <code>fDocument</code> to be considered
590
	 * @param bound the first position in <code>fDocument</code> to not consider any more, with <code>bound</code> &gt; <code>position</code>, or <code>UNBOUND</code>
591
	 * @return the smallest position of a non-whitespace character in [<code>position</code>, <code>bound</code>) that resides in a C partition, or <code>NOT_FOUND</code> if none can be found
592
	 */
593
	public int findNonWhitespaceForward(int position, int bound) {
594
		return scanForward(position, bound, fNonWSDefaultPart);
595
	}
596
597
	/**
598
	 * Finds the smallest position in <code>fDocument</code> such that the position is &gt;= <code>position</code>
599
	 * and &lt; <code>bound</code> and <code>Character.isWhitespace(fDocument.getChar(pos))</code> evaluates to <code>false</code>.
600
	 *
601
	 * @param position the first character position in <code>fDocument</code> to be considered
602
	 * @param bound the first position in <code>fDocument</code> to not consider any more, with <code>bound</code> &gt; <code>position</code>, or <code>UNBOUND</code>
603
	 * @return the smallest position of a non-whitespace character in [<code>position</code>, <code>bound</code>), or <code>NOT_FOUND</code> if none can be found
604
	 */
605
	public int findNonWhitespaceForwardInAnyPartition(int position, int bound) {
606
		return scanForward(position, bound, fNonWS);
607
	}
608
609
	/**
610
	 * Finds the highest position in <code>fDocument</code> such that the position is &lt;= <code>position</code>
611
	 * and &gt; <code>bound</code> and <code>Character.isWhitespace(fDocument.getChar(pos))</code> evaluates to <code>false</code>
612
	 * and the position is in the default partition.
613
	 *
614
	 * @param position the first character position in <code>fDocument</code> to be considered
615
	 * @param bound the first position in <code>fDocument</code> to not consider any more, with <code>bound</code> &lt; <code>position</code>, or <code>UNBOUND</code>
616
	 * @return the highest position of a non-whitespace character in (<code>bound</code>, <code>position</code>] that resides in a C partition, or <code>NOT_FOUND</code> if none can be found
617
	 */
618
	public int findNonWhitespaceBackward(int position, int bound) {
619
		return scanBackward(position, bound, fNonWSDefaultPart);
620
	}
621
622
	/**
623
	 * Finds the lowest position <code>p</code> in <code>fDocument</code> such that <code>start</code> &lt;= p &lt;
624
	 * <code>bound</code> and <code>condition.stop(fDocument.getChar(p), p)</code> evaluates to <code>true</code>.
625
	 *
626
	 * @param start the first character position in <code>fDocument</code> to be considered
627
	 * @param bound the first position in <code>fDocument</code> to not consider any more, with <code>bound</code> &gt; <code>start</code>, or <code>UNBOUND</code>
628
	 * @param condition the <code>StopCondition</code> to check
629
	 * @return the lowest position in [<code>start</code>, <code>bound</code>) for which <code>condition</code> holds, or <code>NOT_FOUND</code> if none can be found
630
	 */
631
	public int scanForward(int start, int bound, StopCondition condition) {
632
		Assert.isLegal(start >= 0);
633
634
		if (bound == UNBOUND)
635
			bound= fDocument.getLength();
636
637
		Assert.isLegal(bound <= fDocument.getLength());
638
639
		try {
640
			fPos= start;
641
			while (fPos < bound) {
642
643
				fChar= fDocument.getChar(fPos);
644
				if (condition.stop(fChar, fPos, true))
645
					return fPos;
646
647
				fPos= condition.nextPosition(fPos, true);
648
			}
649
		} catch (BadLocationException e) {
650
		}
651
		return NOT_FOUND;
652
	}
653
654
655
	/**
656
	 * Finds the lowest position in <code>fDocument</code> such that the position is &gt;= <code>position</code>
657
	 * and &lt; <code>bound</code> and <code>fDocument.getChar(position) == ch</code> evaluates to <code>true</code>
658
	 * and the position is in the default partition.
659
	 *
660
	 * @param position the first character position in <code>fDocument</code> to be considered
661
	 * @param bound the first position in <code>fDocument</code> to not consider any more, with <code>bound</code> &gt; <code>position</code>, or <code>UNBOUND</code>
662
	 * @param ch the <code>char</code> to search for
663
	 * @return the lowest position of <code>ch</code> in (<code>bound</code>, <code>position</code>] that resides in a C partition, or <code>NOT_FOUND</code> if none can be found
664
	 */
665
	public int scanForward(int position, int bound, char ch) {
666
		return scanForward(position, bound, new CharacterMatch(ch));
667
	}
668
669
	/**
670
	 * Finds the lowest position in <code>fDocument</code> such that the position is &gt;= <code>position</code>
671
	 * and &lt; <code>bound</code> and <code>fDocument.getChar(position) == ch</code> evaluates to <code>true</code> for at least one
672
	 * ch in <code>chars</code> and the position is in the default partition.
673
	 *
674
	 * @param position the first character position in <code>fDocument</code> to be considered
675
	 * @param bound the first position in <code>fDocument</code> to not consider any more, with <code>bound</code> &gt; <code>position</code>, or <code>UNBOUND</code>
676
	 * @param chars an array of <code>char</code> to search for
677
	 * @return the lowest position of a non-whitespace character in [<code>position</code>, <code>bound</code>) that resides in a C partition, or <code>NOT_FOUND</code> if none can be found
678
	 */
679
	public int scanForward(int position, int bound, char[] chars) {
680
		return scanForward(position, bound, new CharacterMatch(chars));
681
	}
682
683
	/**
684
	 * Finds the highest position <code>p</code> in <code>fDocument</code> such that <code>bound</code> &lt; <code>p</code> &lt;= <code>start</code>
685
	 * and <code>condition.stop(fDocument.getChar(p), p)</code> evaluates to <code>true</code>.
686
	 *
687
	 * @param start the first character position in <code>fDocument</code> to be considered
688
	 * @param bound the first position in <code>fDocument</code> to not consider any more, with <code>bound</code> &lt; <code>start</code>, or <code>UNBOUND</code>
689
	 * @param condition the <code>StopCondition</code> to check
690
	 * @return the highest position in (<code>bound</code>, <code>start</code> for which <code>condition</code> holds, or <code>NOT_FOUND</code> if none can be found
691
	 */
692
	public int scanBackward(int start, int bound, StopCondition condition) {
693
		if (bound == UNBOUND)
694
			bound= -1;
695
696
		Assert.isLegal(bound >= -1);
697
		Assert.isLegal(start < fDocument.getLength() );
698
699
		try {
700
			fPos= start;
701
			while (fPos > bound) {
702
703
				fChar= fDocument.getChar(fPos);
704
				if (condition.stop(fChar, fPos, false))
705
					return fPos;
706
707
				fPos= condition.nextPosition(fPos, false);
708
			}
709
		} catch (BadLocationException e) {
710
		}
711
		return NOT_FOUND;
712
	}
713
714
	/**
715
	 * Finds the highest position in <code>fDocument</code> such that the position is &lt;= <code>position</code>
716
	 * and &gt; <code>bound</code> and <code>fDocument.getChar(position) == ch</code> evaluates to <code>true</code> for at least one
717
	 * ch in <code>chars</code> and the position is in the default partition.
718
	 *
719
	 * @param position the first character position in <code>fDocument</code> to be considered
720
	 * @param bound the first position in <code>fDocument</code> to not consider any more, with <code>bound</code> &lt; <code>position</code>, or <code>UNBOUND</code>
721
	 * @param ch the <code>char</code> to search for
722
	 * @return the highest position of one element in <code>chars</code> in (<code>bound</code>, <code>position</code>] that resides in a C partition, or <code>NOT_FOUND</code> if none can be found
723
	 */
724
	public int scanBackward(int position, int bound, char ch) {
725
		return scanBackward(position, bound, new CharacterMatch(ch));
726
	}
727
728
	/**
729
	 * Finds the highest position in <code>fDocument</code> such that the position is &lt;= <code>position</code>
730
	 * and &gt; <code>bound</code> and <code>fDocument.getChar(position) == ch</code> evaluates to <code>true</code> for at least one
731
	 * ch in <code>chars</code> and the position is in the default partition.
732
	 *
733
	 * @param position the first character position in <code>fDocument</code> to be considered
734
	 * @param bound the first position in <code>fDocument</code> to not consider any more, with <code>bound</code> &lt; <code>position</code>, or <code>UNBOUND</code>
735
	 * @param chars an array of <code>char</code> to search for
736
	 * @return the highest position of one element in <code>chars</code> in (<code>bound</code>, <code>position</code>] that resides in a C partition, or <code>NOT_FOUND</code> if none can be found
737
	 */
738
	public int scanBackward(int position, int bound, char[] chars) {
739
		return scanBackward(position, bound, new CharacterMatch(chars));
740
	}
741
742
	/**
743
	 * Checks whether <code>position</code> resides in a default (C) partition of <code>fDocument</code>.
744
	 *
745
	 * @param position the position to be checked
746
	 * @return <code>true</code> if <code>position</code> is in the default partition of <code>fDocument</code>, <code>false</code> otherwise
747
	 */
748
	public boolean isDefaultPartition(int position) {
749
		return fPartition.equals(getPartition(position).getType());
750
	}
751
752
	/**
753
	 * Returns the partition at <code>position</code>.
754
	 *
755
	 * @param position the position to get the partition for
756
	 * @return the partition at <code>position</code> or a dummy zero-length
757
	 *         partition if accessing the document fails
758
	 */
759
	private ITypedRegion getPartition(int position) {
760
		if (!contains(fCachedPartition, position)) {
761
			Assert.isTrue(position >= 0);
762
			Assert.isTrue(position <= fDocument.getLength());
763
			
764
			try {
765
				fCachedPartition= TextUtilities.getPartition(fDocument, fPartitioning, position, false);
766
			} catch (BadLocationException e) {
767
				fCachedPartition= new TypedRegion(position, 0, "__no_partition_at_all"); //$NON-NLS-1$
768
			}
769
		}
770
771
		return fCachedPartition;
772
	}
773
774
	/**
775
	 * Returns <code>true</code> if <code>region</code> contains <code>position</code>.
776
	 * 
777
	 * @param region a region
778
	 * @param position an offset
779
	 * @return <code>true</code> if <code>region</code> contains <code>position</code>
780
	 */
781
	private boolean contains(IRegion region, int position) {
782
		int offset= region.getOffset();
783
		return offset <= position && position < offset + region.getLength();
784
	}
785
786
	/**
787
	 * Checks if the line seems to be an open condition not followed by a block (i.e. an if, while,
788
	 * or for statement with just one following statement, see example below).
789
	 *
790
	 * <pre>
791
	 * if (condition)
792
	 *     doStuff();
793
	 * </pre>
794
	 *
795
	 * <p>Algorithm: if the last non-WS, non-Comment code on the line is an if (condition), while (condition),
796
	 * for( expression), do, else, and there is no statement after that </p>
797
	 *
798
	 * @param position the insert position of the new character
799
	 * @param bound the lowest position to consider
800
	 * @return <code>true</code> if the code is a conditional statement or loop without a block, <code>false</code> otherwise
801
	 */
802
	public boolean isBracelessBlockStart(int position, int bound) {
803
		if (position < 1)
804
			return false;
805
806
		switch (previousToken(position, bound)) {
807
			case TokenDO:
808
			case TokenELSE:
809
				return true;
810
			case TokenRPAREN:
811
				position= findOpeningPeer(fPos, LPAREN, RPAREN);
812
				if (position > 0) {
813
					switch (previousToken(position - 1, bound)) {
814
						case TokenIF:
815
						case TokenFOR:
816
						case TokenWHILE:
817
							return true;
818
					}
819
				}
820
		}
821
822
		return false;
823
	}
824
	
825
	/**
826
	 * Returns <code>true</code> if the document, when scanned backwards from <code>start</code>
827
	 * appears to contain a class instance creation, i.e. a possibly qualified name preceded by a
828
	 * <code>new</code> keyword. The <code>start</code> must be at the end of the type name, and
829
	 * before any generic signature or constructor parameter list. The heuristic will return
830
	 * <code>true</code> if <code>start</code> is at the following positions (|):
831
	 * 
832
	 * <pre>
833
	 *  new java.util. ArrayList|&lt;String&gt;(10)
834
	 *  new ArrayList |(10)
835
	 *  new  / * comment  * / ArrayList |(10)
836
	 * </pre>
837
	 * 
838
	 * but not the following:
839
	 * 
840
	 * <pre>
841
	 *  new java.util. ArrayList&lt;String&gt;(10)|
842
	 *  new java.util. ArrayList&lt;String&gt;|(10)
843
	 *  new ArrayList (10)|
844
	 *  ArrayList |(10)
845
	 * </pre>
846
	 * 
847
	 * @param start the position where the type name of the class instance creation supposedly ends
848
	 * @param bound the first position in <code>fDocument</code> to not consider any more, with
849
	 *        <code>bound</code> &lt; <code>start</code>, or <code>UNBOUND</code>
850
	 * @return <code>true</code> if the current position looks like after the type name of a class
851
	 *         instance creation
852
	 */
853
	public boolean looksLikeClassInstanceCreationBackward(int start, int bound) {
854
		int token= previousToken(start - 1, bound);
855
		if (token == Symbols.TokenIDENT) { // type name
856
			token= previousToken(getPosition(), bound);
857
			while (token == Symbols.TokenOTHER) { // dot of qualification
858
				token= previousToken(getPosition(), bound);
859
				if (token != Symbols.TokenIDENT) // qualification name
860
					return false;
861
				token= previousToken(getPosition(), bound);
862
			}
863
			return token == Symbols.TokenNEW;
864
		}
865
		return false;
866
	}
867
}
(-)src/org/eclipse/cdt/internal/ui/text/DocumentCharacterIterator.java (+220 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2005 IBM Corporation and others.
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
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.cdt.internal.ui.text;
12
13
import java.text.CharacterIterator;
14
15
import org.eclipse.jface.text.Assert;
16
import org.eclipse.jface.text.BadLocationException;
17
import org.eclipse.jface.text.IDocument;
18
19
20
/**
21
 * An <code>IDocument</code> based implementation of
22
 * <code>CharacterIterator</code> and <code>CharSequence</code>. Note that
23
 * the supplied document is not copied; if the document is modified during the
24
 * lifetime of a <code>DocumentCharacterIterator</code>, the methods
25
 * returning document content may not always return the same values. Also, if
26
 * accessing the document fails with a {@link BadLocationException}, any of
27
 * <code>CharacterIterator</code> methods as well as <code>charAt</code>may
28
 * return {@link CharacterIterator#DONE}.
29
 */
30
public class DocumentCharacterIterator implements CharacterIterator, CharSequence {
31
32
	private int fIndex= -1;
33
	private final IDocument fDocument;
34
	private final int fFirst;
35
	private final int fLast;
36
37
	private void invariant() {
38
		Assert.isTrue(fIndex >= fFirst);
39
		Assert.isTrue(fIndex <= fLast);
40
	}
41
42
	/**
43
	 * Creates an iterator for the entire document.
44
	 *
45
	 * @param document the document backing this iterator
46
	 */
47
	public DocumentCharacterIterator(IDocument document) {
48
		this(document, 0);
49
	}
50
51
	/**
52
	 * Creates an iterator, starting at offset <code>first</code>.
53
	 *
54
	 * @param document the document backing this iterator
55
	 * @param first the first character to consider
56
	 * @throws IllegalArgumentException if the indices are out of bounds
57
	 */
58
	public DocumentCharacterIterator(IDocument document, int first) throws IllegalArgumentException {
59
		this(document, first, document.getLength());
60
	}
61
62
	/**
63
	 * Creates an iterator for the document contents from <code>first</code>
64
	 * (inclusive) to <code>last</code> (exclusive).
65
	 *
66
	 * @param document the document backing this iterator
67
	 * @param first the first character to consider
68
	 * @param last the last character index to consider
69
	 * @throws IllegalArgumentException if the indices are out of bounds
70
	 */
71
	public DocumentCharacterIterator(IDocument document, int first, int last) throws IllegalArgumentException {
72
		if (document == null)
73
			throw new NullPointerException();
74
		if (first < 0 || first > last)
75
			throw new IllegalArgumentException();
76
		if (last > document.getLength())
77
			throw new IllegalArgumentException();
78
		fDocument= document;
79
		fFirst= first;
80
		fLast= last;
81
		fIndex= first;
82
		invariant();
83
	}
84
85
	/*
86
	 * @see java.text.CharacterIterator#first()
87
	 */
88
	public char first() {
89
		return setIndex(getBeginIndex());
90
	}
91
92
	/*
93
	 * @see java.text.CharacterIterator#last()
94
	 */
95
	public char last() {
96
		if (fFirst == fLast)
97
			return setIndex(getEndIndex());
98
		else
99
			return setIndex(getEndIndex() - 1);
100
	}
101
102
	/*
103
	 * @see java.text.CharacterIterator#current()
104
	 */
105
	public char current() {
106
		if (fIndex >= fFirst && fIndex < fLast)
107
			try {
108
				return fDocument.getChar(fIndex);
109
			} catch (BadLocationException e) {
110
				// ignore
111
			}
112
		return DONE;
113
	}
114
115
	/*
116
	 * @see java.text.CharacterIterator#next()
117
	 */
118
	public char next() {
119
		return setIndex(Math.min(fIndex + 1, getEndIndex()));
120
	}
121
122
	/*
123
	 * @see java.text.CharacterIterator#previous()
124
	 */
125
	public char previous() {
126
		if (fIndex > getBeginIndex()) {
127
			return setIndex(fIndex - 1);
128
		} else {
129
			return DONE;
130
		}
131
	}
132
133
	/*
134
	 * @see java.text.CharacterIterator#setIndex(int)
135
	 */
136
	public char setIndex(int position) {
137
		if (position >= getBeginIndex() && position <= getEndIndex())
138
			fIndex= position;
139
		else
140
			throw new IllegalArgumentException();
141
142
		invariant();
143
		return current();
144
	}
145
146
	/*
147
	 * @see java.text.CharacterIterator#getBeginIndex()
148
	 */
149
	public int getBeginIndex() {
150
		return fFirst;
151
	}
152
153
	/*
154
	 * @see java.text.CharacterIterator#getEndIndex()
155
	 */
156
	public int getEndIndex() {
157
		return fLast;
158
	}
159
160
	/*
161
	 * @see java.text.CharacterIterator#getIndex()
162
	 */
163
	public int getIndex() {
164
		return fIndex;
165
	}
166
167
	/*
168
	 * @see java.text.CharacterIterator#clone()
169
	 */
170
	public Object clone() {
171
		try {
172
			return super.clone();
173
		} catch (CloneNotSupportedException e) {
174
			throw new InternalError();
175
		}
176
	}
177
178
	/*
179
	 * @see java.lang.CharSequence#length()
180
	 */
181
	public int length() {
182
		return getEndIndex() - getBeginIndex();
183
	}
184
185
	/**
186
	 * {@inheritDoc}
187
	 * <p>
188
	 * Note that, if the document is modified concurrently, this method may
189
	 * return {@link CharacterIterator#DONE} if a {@link BadLocationException}
190
	 * was thrown when accessing the backing document.
191
	 * </p>
192
	 *
193
	 * @param index {@inheritDoc}
194
	 * @return {@inheritDoc}
195
	 */
196
	public char charAt(int index) {
197
		if (index >= 0 && index < length())
198
			try {
199
				return fDocument.getChar(getBeginIndex() + index);
200
			} catch (BadLocationException e) {
201
				// ignore and return DONE
202
				return DONE;
203
			}
204
		else
205
			throw new IndexOutOfBoundsException();
206
	}
207
208
	/*
209
	 * @see java.lang.CharSequence#subSequence(int, int)
210
	 */
211
	public CharSequence subSequence(int start, int end) {
212
		if (start < 0)
213
			throw new IndexOutOfBoundsException();
214
		if (end < start)
215
			throw new IndexOutOfBoundsException();
216
		if (end > length())
217
			throw new IndexOutOfBoundsException();
218
		return new DocumentCharacterIterator(fDocument, getBeginIndex() + start, getBeginIndex() + end);
219
	}
220
}
(-)src/org/eclipse/cdt/internal/ui/text/Symbols.java (+53 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2005 IBM Corporation and others.
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
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.cdt.internal.ui.text;
12
13
/**
14
 * Symbols for the heuristic C/C++ scanner.
15
 */
16
public interface Symbols {
17
	int TokenEOF= -1;
18
	int TokenLBRACE= 1;
19
	int TokenRBRACE= 2;
20
	int TokenLBRACKET= 3;
21
	int TokenRBRACKET= 4;
22
	int TokenLPAREN= 5;
23
	int TokenRPAREN= 6;
24
	int TokenSEMICOLON= 7;
25
	int TokenOTHER= 8;
26
	int TokenCOLON= 9;
27
	int TokenQUESTIONMARK= 10;
28
	int TokenCOMMA= 11;
29
	int TokenEQUAL= 12;
30
	int TokenLESSTHAN= 13;
31
	int TokenGREATERTHAN= 14;
32
	int TokenIF= 109;
33
	int TokenDO= 1010;
34
	int TokenFOR= 1011;
35
	int TokenTRY= 1012;
36
	int TokenCASE= 1013;
37
	int TokenELSE= 1014;
38
	int TokenBREAK= 1015;
39
	int TokenCATCH= 1016;
40
	int TokenWHILE= 1017;
41
	int TokenRETURN= 1018;
42
	int TokenSTATIC= 1019;
43
	int TokenSWITCH= 1020;
44
//	int TokenFINALLY= 1021;
45
//	int TokenSYNCHRONIZED= 1022;
46
	int TokenGOTO= 1023;
47
	int TokenDEFAULT= 1024;
48
	int TokenNEW= 1025;
49
	int TokenCLASS= 1026;
50
//	int TokenINTERFACE= 1027;
51
	int TokenENUM= 1028;
52
	int TokenIDENT= 2000;
53
}
(-)src/org/eclipse/cdt/internal/ui/text/CIndenter.java (+1615 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2006 IBM Corporation and others.
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
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.cdt.internal.ui.text;
12
13
import org.eclipse.cdt.core.CCorePlugin;
14
import org.eclipse.cdt.core.formatter.CodeFormatterConstants;
15
import org.eclipse.cdt.core.model.ICProject;
16
import org.eclipse.cdt.internal.corext.util.CodeFormatterUtil;
17
18
import org.eclipse.jface.text.Assert;
19
import org.eclipse.jface.text.BadLocationException;
20
import org.eclipse.jface.text.IDocument;
21
import org.eclipse.jface.text.IRegion;
22
23
24
/**
25
 * Uses the {@link org.eclipse.cdt.internal.ui.text.CHeuristicScanner} to
26
 * get the indentation level for a certain position in a document.
27
 *
28
 * <p>
29
 * An instance holds some internal position in the document and is therefore
30
 * not threadsafe.
31
 * </p>
32
 */
33
public final class CIndenter {
34
	
35
	/**
36
	 * The CDT Core preferences.
37
	 */
38
	private final class CorePrefs {
39
		final boolean prefUseTabs;
40
		final int prefTabSize;
41
		final int prefIndentationSize;
42
		final boolean prefArrayDimensionsDeepIndent;
43
		final int prefArrayIndent;
44
		final boolean prefArrayDeepIndent;
45
		final boolean prefTernaryDeepAlign;
46
		final int prefTernaryIndent;
47
		final int prefCaseIndent;
48
		final int prefAssignmentIndent;
49
		final int prefCaseBlockIndent;
50
		final int prefSimpleIndent;
51
		final int prefBracketIndent;
52
		final boolean prefMethodDeclDeepIndent;
53
		final int prefMethodDeclIndent;
54
		final boolean prefMethodCallDeepIndent;
55
		final int prefMethodCallIndent;
56
		final boolean prefParenthesisDeepIndent;
57
		final int prefParenthesisIndent;
58
		final int prefBlockIndent;
59
		final int prefMethodBodyIndent;
60
		final int prefTypeIndent;
61
		final boolean prefIndentBracesForBlocks;
62
		final boolean prefIndentBracesForArrays;
63
		final boolean prefIndentBracesForMethods;
64
		final boolean prefIndentBracesForTypes;
65
		final int prefContinuationIndent;
66
		final boolean prefHasGenerics;
67
		final String prefTabChar;
68
		
69
		private final ICProject fProject;
70
71
		/**
72
		 * Returns the possibly project-specific core preference defined under <code>key</code>.
73
		 *
74
		 * @param key the key of the preference
75
		 * @return the value of the preference
76
		 */
77
		private String getCoreFormatterOption(String key) {
78
			if (fProject == null)
79
				return CCorePlugin.getOption(key);
80
			return fProject.getOption(key, true);
81
		}
82
		
83
		CorePrefs(ICProject project) {
84
			fProject= project;
85
			prefUseTabs= prefUseTabs();
86
			prefTabSize= prefTabSize();
87
			prefIndentationSize= prefIndentationSize();
88
			prefArrayDimensionsDeepIndent= prefArrayDimensionsDeepIndent();
89
			prefContinuationIndent= prefContinuationIndent();
90
			prefBlockIndent= prefBlockIndent();
91
			prefArrayIndent= prefArrayIndent();
92
			prefArrayDeepIndent= prefArrayDeepIndent();
93
			prefTernaryDeepAlign= prefTernaryDeepAlign();
94
			prefTernaryIndent= prefTernaryIndent();
95
			prefCaseIndent= prefCaseIndent();
96
			prefAssignmentIndent= prefAssignmentIndent();
97
			prefCaseBlockIndent= prefCaseBlockIndent();
98
			prefIndentBracesForBlocks= prefIndentBracesForBlocks();
99
			prefSimpleIndent= prefSimpleIndent();
100
			prefBracketIndent= prefBracketIndent();
101
			prefMethodDeclDeepIndent= prefMethodDeclDeepIndent();
102
			prefMethodDeclIndent= prefMethodDeclIndent();
103
			prefMethodCallDeepIndent= prefMethodCallDeepIndent();
104
			prefMethodCallIndent= prefMethodCallIndent();
105
			prefParenthesisDeepIndent= prefParenthesisDeepIndent();
106
			prefParenthesisIndent= prefParenthesisIndent();
107
			prefMethodBodyIndent= prefMethodBodyIndent();
108
			prefTypeIndent= prefTypeIndent();
109
			prefIndentBracesForArrays= prefIndentBracesForArrays();
110
			prefIndentBracesForMethods= prefIndentBracesForMethods();
111
			prefIndentBracesForTypes= prefIndentBracesForTypes();
112
			prefHasGenerics= hasGenerics();
113
			prefTabChar= getCoreFormatterOption(CodeFormatterConstants.FORMATTER_TAB_CHAR);
114
		}
115
		
116
		private boolean prefUseTabs() {
117
			return !CCorePlugin.SPACE.equals(getCoreFormatterOption(CodeFormatterConstants.FORMATTER_TAB_CHAR));
118
		}
119
120
		private int prefTabSize() {
121
			return CodeFormatterUtil.getTabWidth(fProject);
122
		}
123
124
		private int prefIndentationSize() {
125
			return CodeFormatterUtil.getIndentWidth(fProject);
126
		}
127
128
		private boolean prefArrayDimensionsDeepIndent() {
129
			return true; // sensible default, no formatter setting
130
		}
131
132
		private int prefArrayIndent() {
133
			String option= getCoreFormatterOption(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER);
134
			try {
135
				if (CodeFormatterConstants.getIndentStyle(option) == CodeFormatterConstants.INDENT_BY_ONE)
136
					return 1;
137
			} catch (IllegalArgumentException e) {
138
				// ignore and return default
139
			}
140
141
			return prefContinuationIndent(); // default
142
		}
143
144
		private boolean prefArrayDeepIndent() {
145
			String option= getCoreFormatterOption(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER);
146
			try {
147
				return CodeFormatterConstants.getIndentStyle(option) == CodeFormatterConstants.INDENT_ON_COLUMN;
148
			} catch (IllegalArgumentException e) {
149
				// ignore and return default
150
			}
151
152
			return true;
153
		}
154
155
		private boolean prefTernaryDeepAlign() {
156
			String option= getCoreFormatterOption(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_CONDITIONAL_EXPRESSION);
157
			try {
158
				return CodeFormatterConstants.getIndentStyle(option) == CodeFormatterConstants.INDENT_ON_COLUMN;
159
			} catch (IllegalArgumentException e) {
160
				// ignore and return default
161
			}
162
			return false;
163
		}
164
165
		private int prefTernaryIndent() {
166
			String option= getCoreFormatterOption(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_CONDITIONAL_EXPRESSION);
167
			try {
168
				if (CodeFormatterConstants.getIndentStyle(option) == CodeFormatterConstants.INDENT_BY_ONE)
169
					return 1;
170
				else
171
					return prefContinuationIndent();
172
			} catch (IllegalArgumentException e) {
173
				// ignore and return default
174
			}
175
176
			return prefContinuationIndent();
177
		}
178
179
		private int prefCaseIndent() {
180
			if (CodeFormatterConstants.TRUE.equals(getCoreFormatterOption(CodeFormatterConstants.FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_SWITCH)))
181
				return prefBlockIndent();
182
			else
183
				return 0;
184
		}
185
186
		private int prefAssignmentIndent() {
187
			return prefBlockIndent();
188
		}
189
190
		private int prefCaseBlockIndent() {
191
			if (true)
192
				return prefBlockIndent();
193
194
			if (CodeFormatterConstants.TRUE.equals(getCoreFormatterOption(CodeFormatterConstants.FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_CASES)))
195
				return prefBlockIndent();
196
			else
197
				return 0;
198
		}
199
200
		private int prefSimpleIndent() {
201
			if (prefIndentBracesForBlocks() && prefBlockIndent() == 0)
202
				return 1;
203
			else return prefBlockIndent();
204
		}
205
206
		private int prefBracketIndent() {
207
			return prefBlockIndent();
208
		}
209
210
		private boolean prefMethodDeclDeepIndent() {
211
			String option= getCoreFormatterOption(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_METHOD_DECLARATION);
212
			try {
213
				return CodeFormatterConstants.getIndentStyle(option) == CodeFormatterConstants.INDENT_ON_COLUMN;
214
			} catch (IllegalArgumentException e) {
215
				// ignore and return default
216
			}
217
218
			return true;
219
		}
220
221
		private int prefMethodDeclIndent() {
222
			String option= getCoreFormatterOption(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_METHOD_DECLARATION);
223
			try {
224
				if (CodeFormatterConstants.getIndentStyle(option) == CodeFormatterConstants.INDENT_BY_ONE)
225
					return 1;
226
				else
227
					return prefContinuationIndent();
228
			} catch (IllegalArgumentException e) {
229
				// ignore and return default
230
			}
231
			return 1;
232
		}
233
234
		private boolean prefMethodCallDeepIndent() {
235
			String option= getCoreFormatterOption(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_METHOD_INVOCATION);
236
			try {
237
				return CodeFormatterConstants.getIndentStyle(option) == CodeFormatterConstants.INDENT_ON_COLUMN;
238
			} catch (IllegalArgumentException e) {
239
				// ignore and return default
240
			}
241
			return false; // sensible default
242
		}
243
244
		private int prefMethodCallIndent() {
245
			String option= getCoreFormatterOption(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_METHOD_INVOCATION);
246
			try {
247
				if (CodeFormatterConstants.getIndentStyle(option) == CodeFormatterConstants.INDENT_BY_ONE)
248
					return 1;
249
				else
250
					return prefContinuationIndent();
251
			} catch (IllegalArgumentException e) {
252
				// ignore and return default
253
			}
254
255
			return 1; // sensible default
256
		}
257
258
		private boolean prefParenthesisDeepIndent() {
259
			if (true) // don't do parenthesis deep indentation
260
				return false;
261
262
			String option= getCoreFormatterOption(CodeFormatterConstants.FORMATTER_CONTINUATION_INDENTATION);
263
			try {
264
				return CodeFormatterConstants.getIndentStyle(option) == CodeFormatterConstants.INDENT_ON_COLUMN;
265
			} catch (IllegalArgumentException e) {
266
				// ignore and return default
267
			}
268
269
			return false; // sensible default
270
		}
271
272
		private int prefParenthesisIndent() {
273
			return prefContinuationIndent();
274
		}
275
276
		private int prefBlockIndent() {
277
			String option= getCoreFormatterOption(CodeFormatterConstants.FORMATTER_INDENT_STATEMENTS_COMPARE_TO_BLOCK);
278
			if (CodeFormatterConstants.FALSE.equals(option))
279
				return 0;
280
281
			return 1; // sensible default
282
		}
283
284
		private int prefMethodBodyIndent() {
285
			if (CodeFormatterConstants.FALSE.equals(getCoreFormatterOption(CodeFormatterConstants.FORMATTER_INDENT_STATEMENTS_COMPARE_TO_BODY)))
286
				return 0;
287
288
			return 1; // sensible default
289
		}
290
291
		private int prefTypeIndent() {
292
			String option= getCoreFormatterOption(CodeFormatterConstants.FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_TYPE_HEADER);
293
			if (CodeFormatterConstants.FALSE.equals(option))
294
				return 0;
295
296
			return 1; // sensible default
297
		}
298
299
		private boolean prefIndentBracesForBlocks() {
300
			return CodeFormatterConstants.NEXT_LINE_SHIFTED.equals(getCoreFormatterOption(CodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK));
301
		}
302
303
		private boolean prefIndentBracesForArrays() {
304
			return CodeFormatterConstants.NEXT_LINE_SHIFTED.equals(getCoreFormatterOption(CodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ARRAY_INITIALIZER));
305
		}
306
307
		private boolean prefIndentBracesForMethods() {
308
			return CodeFormatterConstants.NEXT_LINE_SHIFTED.equals(getCoreFormatterOption(CodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION));
309
		}
310
311
		private boolean prefIndentBracesForTypes() {
312
			return CodeFormatterConstants.NEXT_LINE_SHIFTED.equals(getCoreFormatterOption(CodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION));
313
		}
314
315
		private int prefContinuationIndent() {
316
			try {
317
				return Integer.parseInt(getCoreFormatterOption(CodeFormatterConstants.FORMATTER_CONTINUATION_INDENTATION));
318
			} catch (NumberFormatException e) {
319
				// ignore and return default
320
			}
321
322
			return 2; // sensible default
323
		}
324
		private boolean hasGenerics() {
325
			return true;
326
		}
327
	}
328
329
	/** The document being scanned. */
330
	private final IDocument fDocument;
331
	/** The indentation accumulated by <code>findReferencePosition</code>. */
332
	private int fIndent;
333
	/**
334
	 * The absolute (character-counted) indentation offset for special cases
335
	 * (method defs, array initializers)
336
	 */
337
	private int fAlign;
338
	/** The stateful scanposition for the indentation methods. */
339
	private int fPosition;
340
	/** The previous position. */
341
	private int fPreviousPos;
342
	/** The most recent token. */
343
	private int fToken;
344
	/** The line of <code>fPosition</code>. */
345
	private int fLine;
346
	/**
347
	 * The scanner we will use to scan the document. It has to be installed
348
	 * on the same document as the one we get.
349
	 */
350
	private final CHeuristicScanner fScanner;
351
	/**
352
	 * The CDT Core preferences.
353
	 */
354
	private final CorePrefs fPrefs;
355
356
	/**
357
	 * Creates a new instance.
358
	 *
359
	 * @param document the document to scan
360
	 * @param scanner the {@link CHeuristicScanner} to be used for scanning
361
	 * the document. It must be installed on the same <code>IDocument</code>.
362
	 */
363
	public CIndenter(IDocument document, CHeuristicScanner scanner) {
364
		this(document, scanner, null);
365
	}
366
367
	/**
368
	 * Creates a new instance.
369
	 *
370
	 * @param document the document to scan
371
	 * @param scanner the {@link CHeuristicScanner} to be used for scanning
372
	 *        the document. It must be installed on the same
373
	 *        <code>IDocument</code>.
374
	 * @param project the C/C++ project to get the formatter preferences from, or
375
	 *        <code>null</code> to use the workspace settings
376
	 */
377
	public CIndenter(IDocument document, CHeuristicScanner scanner, ICProject project) {
378
		Assert.isNotNull(document);
379
		Assert.isNotNull(scanner);
380
		fDocument= document;
381
		fScanner= scanner;
382
		fPrefs= new CorePrefs(project);
383
	}
384
385
	/**
386
	 * Computes the indentation at the reference point of <code>position</code>.
387
	 *
388
	 * @param offset the offset in the document
389
	 * @return a String which reflects the indentation at the line in which the
390
	 *         reference position to <code>offset</code> resides, or <code>null</code>
391
	 *         if it cannot be determined
392
	 */
393
	public StringBuffer getReferenceIndentation(int offset) {
394
		return getReferenceIndentation(offset, false);
395
	}
396
397
	/**
398
	 * Computes the indentation at the reference point of <code>position</code>.
399
	 *
400
	 * @param offset the offset in the document
401
	 * @param assumeOpeningBrace <code>true</code> if an opening brace should be assumed
402
	 * @return a String which reflects the indentation at the line in which the
403
	 *         reference position to <code>offset</code> resides, or <code>null</code>
404
	 *         if it cannot be determined
405
	 */
406
	private StringBuffer getReferenceIndentation(int offset, boolean assumeOpeningBrace) {
407
408
		int unit;
409
		if (assumeOpeningBrace)
410
			unit= findReferencePosition(offset, Symbols.TokenLBRACE);
411
		else
412
			unit= findReferencePosition(offset, peekChar(offset));
413
414
		// if we were unable to find anything, return null
415
		if (unit == CHeuristicScanner.NOT_FOUND)
416
			return null;
417
418
		return getLeadingWhitespace(unit);
419
420
	}
421
422
	/**
423
	 * Computes the indentation at <code>offset</code>.
424
	 *
425
	 * @param offset the offset in the document
426
	 * @return a String which reflects the correct indentation for the line in
427
	 *         which offset resides, or <code>null</code> if it cannot be
428
	 *         determined
429
	 */
430
	public StringBuffer computeIndentation(int offset) {
431
		return computeIndentation(offset, false);
432
	}
433
434
	/**
435
	 * Computes the indentation at <code>offset</code>.
436
	 *
437
	 * @param offset the offset in the document
438
	 * @param assumeOpeningBrace <code>true</code> if an opening brace should be assumed
439
	 * @return a String which reflects the correct indentation for the line in
440
	 *         which offset resides, or <code>null</code> if it cannot be
441
	 *         determined
442
	 */
443
	public StringBuffer computeIndentation(int offset, boolean assumeOpeningBrace) {
444
445
		StringBuffer reference= getReferenceIndentation(offset, assumeOpeningBrace);
446
447
		// handle special alignment
448
		if (fAlign != CHeuristicScanner.NOT_FOUND) {
449
			try {
450
				// a special case has been detected.
451
				IRegion line= fDocument.getLineInformationOfOffset(fAlign);
452
				int lineOffset= line.getOffset();
453
				return createIndent(lineOffset, fAlign, false);
454
			} catch (BadLocationException e) {
455
				return null;
456
			}
457
		}
458
459
		if (reference == null)
460
			return null;
461
462
		// add additional indent
463
		return createReusingIndent(reference, fIndent);
464
	}
465
466
	/**
467
	 * Computes the length of a <code>CharacterSequence</code>, counting
468
	 * a tab character as the size until the next tab stop and every other
469
	 * character as one.
470
	 *
471
	 * @param indent the string to measure
472
	 * @return the visual length in characters
473
	 */
474
	private int computeVisualLength(CharSequence indent) {
475
		final int tabSize= fPrefs.prefTabSize;
476
		int length= 0;
477
		for (int i= 0; i < indent.length(); i++) {
478
			char ch= indent.charAt(i);
479
			switch (ch) {
480
				case '\t':
481
					if (tabSize > 0) {
482
						int reminder= length % tabSize;
483
						length += tabSize - reminder;
484
					}
485
					break;
486
				case ' ':
487
					length++;
488
					break;
489
			}
490
		}
491
		return length;
492
	}
493
494
	/**
495
	 * Strips any characters off the end of <code>reference</code> that exceed
496
	 * <code>indentLength</code>.
497
	 *
498
	 * @param reference the string to measure
499
	 * @param indentLength the maximum visual indentation length
500
	 * @return the stripped <code>reference</code>
501
	 */
502
	private StringBuffer stripExceedingChars(StringBuffer reference, int indentLength) {
503
		final int tabSize= fPrefs.prefTabSize;
504
		int measured= 0;
505
		int chars= reference.length();
506
		int i= 0;
507
		for (; measured < indentLength && i < chars; i++) {
508
			char ch= reference.charAt(i);
509
			switch (ch) {
510
				case '\t':
511
					if (tabSize > 0) {
512
						int reminder= measured % tabSize;
513
						measured += tabSize - reminder;
514
					}
515
					break;
516
				case ' ':
517
					measured++;
518
					break;
519
			}
520
		}
521
		int deleteFrom= measured > indentLength ? i - 1 : i;
522
523
		return reference.delete(deleteFrom, chars);
524
	}
525
526
	/**
527
	 * Returns the indentation of the line at <code>offset</code> as a
528
	 * <code>StringBuffer</code>. If the offset is not valid, the empty string
529
	 * is returned.
530
	 *
531
	 * @param offset the offset in the document
532
	 * @return the indentation (leading whitespace) of the line in which
533
	 * 		   <code>offset</code> is located
534
	 */
535
	private StringBuffer getLeadingWhitespace(int offset) {
536
		StringBuffer indent= new StringBuffer();
537
		try {
538
			IRegion line= fDocument.getLineInformationOfOffset(offset);
539
			int lineOffset= line.getOffset();
540
			int nonWS= fScanner.findNonWhitespaceForwardInAnyPartition(lineOffset, lineOffset + line.getLength());
541
			indent.append(fDocument.get(lineOffset, nonWS - lineOffset));
542
			return indent;
543
		} catch (BadLocationException e) {
544
			return indent;
545
		}
546
	}
547
548
	/**
549
	 * Creates an indentation string of the length indent - start, consisting of
550
	 * the content in <code>fDocument</code> in the range [start, indent),
551
	 * with every character replaced by a space except for tabs, which are kept
552
	 * as such.
553
	 * <p>
554
	 * If <code>convertSpaceRunsToTabs</code> is <code>true</code>, every
555
	 * run of the number of spaces that make up a tab are replaced by a tab
556
	 * character. If it is not set, no conversion takes place, but tabs in the
557
	 * original range are still copied verbatim.
558
	 * </p>
559
	 *
560
	 * @param start the start of the document region to copy the indent from
561
	 * @param indent the exclusive end of the document region to copy the indent
562
	 *        from
563
	 * @param convertSpaceRunsToTabs whether to convert consecutive runs of
564
	 *        spaces to tabs
565
	 * @return the indentation corresponding to the document content specified
566
	 *         by <code>start</code> and <code>indent</code>
567
	 */
568
	private StringBuffer createIndent(int start, final int indent, final boolean convertSpaceRunsToTabs) {
569
		final boolean convertTabs= fPrefs.prefUseTabs && convertSpaceRunsToTabs;
570
		final int tabLen= fPrefs.prefTabSize;
571
		final StringBuffer ret= new StringBuffer();
572
		try {
573
			int spaces= 0;
574
			while (start < indent) {
575
576
				char ch= fDocument.getChar(start);
577
				if (ch == '\t') {
578
					ret.append('\t');
579
					spaces= 0;
580
				} else if (convertTabs) {
581
					spaces++;
582
					if (spaces == tabLen) {
583
						ret.append('\t');
584
						spaces= 0;
585
					}
586
				} else {
587
					ret.append(' ');
588
				}
589
590
				start++;
591
			}
592
			// remainder
593
			while (spaces-- > 0)
594
				ret.append(' ');
595
596
		} catch (BadLocationException e) {
597
		}
598
599
		return ret;
600
	}
601
602
	/**
603
	 * Creates a string with a visual length of the given
604
	 * <code>indentationSize</code>.
605
	 *
606
	 * @param buffer the original indent to reuse if possible
607
	 * @param additional the additional indentation units to add or subtract to
608
	 *        reference
609
	 * @return the modified <code>buffer</code> reflecting the indentation
610
	 *         adapted to <code>additional</code>
611
	 */
612
	private StringBuffer createReusingIndent(StringBuffer buffer, int additional) {
613
		int refLength= computeVisualLength(buffer);
614
		int addLength= fPrefs.prefIndentationSize * additional; // may be < 0
615
		int totalLength= Math.max(0, refLength + addLength);
616
617
618
		// copy the reference indentation for the indent up to the last tab
619
		// stop within the maxCopy area
620
		int minLength= Math.min(totalLength, refLength);
621
		int tabSize= fPrefs.prefTabSize;
622
		int maxCopyLength= tabSize > 0 ? minLength - minLength % tabSize : minLength; // maximum indent to copy
623
		stripExceedingChars(buffer, maxCopyLength);
624
625
626
		// add additional indent
627
		int missing= totalLength - maxCopyLength;
628
		final int tabs, spaces;
629
		if (CCorePlugin.SPACE.equals(fPrefs.prefTabChar)) {
630
			tabs= 0;
631
			spaces= missing;
632
		} else if (CCorePlugin.TAB.equals(fPrefs.prefTabChar)) {
633
			tabs= tabSize > 0 ? missing / tabSize : 0;
634
			spaces= tabSize > 0 ? missing % tabSize : missing;
635
		} else if (CodeFormatterConstants.MIXED.equals(fPrefs.prefTabChar)) {
636
			tabs= tabSize > 0 ? missing / tabSize : 0;
637
			spaces= tabSize > 0 ? missing % tabSize : missing;
638
		} else {
639
			Assert.isTrue(false);
640
			return null;
641
		}
642
		for(int i= 0; i < tabs; i++)
643
			buffer.append('\t');
644
		for(int i= 0; i < spaces; i++)
645
			buffer.append(' ');
646
		return buffer;
647
	}
648
649
	/**
650
	 * Returns the reference position regarding to indentation for <code>offset</code>,
651
	 * or <code>NOT_FOUND</code>. This method calls
652
	 * {@link #findReferencePosition(int, int) findReferencePosition(offset, nextChar)} where
653
	 * <code>nextChar</code> is the next character after <code>offset</code>.
654
	 *
655
	 * @param offset the offset for which the reference is computed
656
	 * @return the reference statement relative to which <code>offset</code>
657
	 *         should be indented, or {@link CHeuristicScanner#NOT_FOUND}
658
	 */
659
	public int findReferencePosition(int offset) {
660
		return findReferencePosition(offset, peekChar(offset));
661
	}
662
663
	/**
664
	 * Peeks the next char in the document that comes after <code>offset</code>
665
	 * on the same line as <code>offset</code>.
666
	 *
667
	 * @param offset the offset into document
668
	 * @return the token symbol of the next element, or TokenEOF if there is none
669
	 */
670
	private int peekChar(int offset) {
671
		if (offset < fDocument.getLength()) {
672
			try {
673
				IRegion line= fDocument.getLineInformationOfOffset(offset);
674
				int lineOffset= line.getOffset();
675
				int next= fScanner.nextToken(offset, lineOffset + line.getLength());
676
				return next;
677
			} catch (BadLocationException e) {
678
			}
679
		}
680
		return Symbols.TokenEOF;
681
	}
682
683
	/**
684
	 * Returns the reference position regarding to indentation for <code>position</code>,
685
	 * or <code>NOT_FOUND</code>.
686
	 *
687
	 * <p>If <code>peekNextChar</code> is <code>true</code>, the next token after
688
	 * <code>offset</code> is read and taken into account when computing the
689
	 * indentation. Currently, if the next token is the first token on the line
690
	 * (i.e. only preceded by whitespace), the following tokens are specially
691
	 * handled:
692
	 * <ul>
693
	 * 	<li><code>switch</code> labels are indented relative to the switch block</li>
694
	 * 	<li>opening curly braces are aligned correctly with the introducing code</li>
695
	 * 	<li>closing curly braces are aligned properly with the introducing code of
696
	 * 		the matching opening brace</li>
697
	 * 	<li>closing parenthesis' are aligned with their opening peer</li>
698
	 * 	<li>the <code>else</code> keyword is aligned with its <code>if</code>, anything
699
	 * 		else is aligned normally (i.e. with the base of any introducing statements).</li>
700
	 *  <li>if there is no token on the same line after <code>offset</code>, the indentation
701
	 * 		is the same as for an <code>else</code> keyword</li>
702
	 * </ul>
703
	 *
704
	 * @param offset the offset for which the reference is computed
705
	 * @param nextToken the next token to assume in the document
706
	 * @return the reference statement relative to which <code>offset</code>
707
	 *         should be indented, or {@link CHeuristicScanner#NOT_FOUND}
708
	 */
709
	public int findReferencePosition(int offset, int nextToken) {
710
		boolean danglingElse= false;
711
		boolean unindent= false;
712
		boolean indent= false;
713
		boolean matchBrace= false;
714
		boolean matchParen= false;
715
		boolean matchCase= false;
716
717
		// account for un-indentation characters already typed in, but after position
718
		// if they are on a line by themselves, the indentation gets adjusted
719
		// accordingly
720
		//
721
		// also account for a dangling else
722
		if (offset < fDocument.getLength()) {
723
			try {
724
				IRegion line= fDocument.getLineInformationOfOffset(offset);
725
				int lineOffset= line.getOffset();
726
				int prevPos= Math.max(offset - 1, 0);
727
				boolean isFirstTokenOnLine= fDocument.get(lineOffset, prevPos + 1 - lineOffset).trim().length() == 0;
728
				int prevToken= fScanner.previousToken(prevPos, CHeuristicScanner.UNBOUND);
729
				boolean bracelessBlockStart= fScanner.isBracelessBlockStart(prevPos, CHeuristicScanner.UNBOUND);
730
731
				switch (nextToken) {
732
					case Symbols.TokenELSE:
733
						danglingElse= true;
734
						break;
735
					case Symbols.TokenCASE:
736
					case Symbols.TokenDEFAULT:
737
						if (isFirstTokenOnLine)
738
							matchCase= true;
739
						break;
740
					case Symbols.TokenLBRACE: // for opening-brace-on-new-line style
741
						if (bracelessBlockStart && !fPrefs.prefIndentBracesForBlocks)
742
							unindent= true;
743
						else if ((prevToken == Symbols.TokenCOLON || prevToken == Symbols.TokenEQUAL || prevToken == Symbols.TokenRBRACKET) && !fPrefs.prefIndentBracesForArrays)
744
							unindent= true;
745
						else if (!bracelessBlockStart && fPrefs.prefIndentBracesForMethods)
746
							indent= true;
747
						break;
748
					case Symbols.TokenRBRACE: // closing braces get unindented
749
						if (isFirstTokenOnLine)
750
							matchBrace= true;
751
						break;
752
					case Symbols.TokenRPAREN:
753
						if (isFirstTokenOnLine)
754
							matchParen= true;
755
						break;
756
				}
757
			} catch (BadLocationException e) {
758
			}
759
		} else {
760
			// don't assume an else could come if we are at the end of file
761
			danglingElse= false;
762
		}
763
764
		int ref= findReferencePosition(offset, danglingElse, matchBrace, matchParen, matchCase);
765
		if (unindent)
766
			fIndent--;
767
		if (indent)
768
			fIndent++;
769
		return ref;
770
	}
771
772
	/**
773
	 * Returns the reference position regarding to indentation for <code>position</code>,
774
	 * or <code>NOT_FOUND</code>.<code>fIndent</code> will contain the
775
	 * relative indentation (in indentation units, not characters) after the
776
	 * call. If there is a special alignment (e.g. for a method declaration
777
	 * where parameters should be aligned), <code>fAlign</code> will contain
778
	 * the absolute position of the alignment reference in <code>fDocument</code>,
779
	 * otherwise <code>fAlign</code> is set to <code>CHeuristicScanner.NOT_FOUND</code>.
780
	 *
781
	 * @param offset the offset for which the reference is computed
782
	 * @param danglingElse whether a dangling else should be assumed at <code>position</code>
783
	 * @param matchBrace whether the position of the matching brace should be
784
	 *            returned instead of doing code analysis
785
	 * @param matchParen whether the position of the matching parenthesis
786
	 *            should be returned instead of doing code analysis
787
	 * @param matchCase whether the position of a switch statement reference
788
	 *            should be returned (either an earlier case statement or the
789
	 *            switch block brace)
790
	 * @return the reference statement relative to which <code>position</code>
791
	 *         should be indented, or {@link CHeuristicScanner#NOT_FOUND}
792
	 */
793
	public int findReferencePosition(int offset, boolean danglingElse, boolean matchBrace, boolean matchParen, boolean matchCase) {
794
		fIndent= 0; // the indentation modification
795
		fAlign= CHeuristicScanner.NOT_FOUND;
796
		fPosition= offset;
797
798
		// forward cases
799
		// an unindentation happens sometimes if the next token is special, namely on braces, parens and case labels
800
		// align braces, but handle the case where we align with the method declaration start instead of
801
		// the opening brace.
802
		if (matchBrace) {
803
			if (skipScope(Symbols.TokenLBRACE, Symbols.TokenRBRACE)) {
804
				try {
805
					// align with the opening brace that is on a line by its own
806
					int lineOffset= fDocument.getLineOffset(fLine);
807
					if (lineOffset <= fPosition && fDocument.get(lineOffset, fPosition - lineOffset).trim().length() == 0)
808
						return fPosition;
809
				} catch (BadLocationException e) {
810
					// concurrent modification - walk default path
811
				}
812
				// if the opening brace is not on the start of the line, skip to the start
813
				int pos= skipToStatementStart(true, true);
814
				fIndent= 0; // indent is aligned with reference position
815
				return pos;
816
			} else {
817
				// if we can't find the matching brace, the heuristic is to unindent
818
				// by one against the normal position
819
				int pos= findReferencePosition(offset, danglingElse, false, matchParen, matchCase);
820
				fIndent--;
821
				return pos;
822
			}
823
		}
824
825
		// align parenthesis'
826
		if (matchParen) {
827
			if (skipScope(Symbols.TokenLPAREN, Symbols.TokenRPAREN))
828
				return fPosition;
829
			else {
830
				// if we can't find the matching paren, the heuristic is to unindent
831
				// by one against the normal position
832
				int pos= findReferencePosition(offset, danglingElse, matchBrace, false, matchCase);
833
				fIndent--;
834
				return pos;
835
			}
836
		}
837
838
		// the only reliable way to get case labels aligned (due to many different styles of using braces in a block)
839
		// is to go for another case statement, or the scope opening brace
840
		if (matchCase) {
841
			return matchCaseAlignment();
842
		}
843
844
		nextToken();
845
		switch (fToken) {
846
			case Symbols.TokenGREATERTHAN:
847
			case Symbols.TokenRBRACE:
848
				// skip the block and fall through
849
				// if we can't complete the scope, reset the scan position
850
				int pos= fPosition;
851
				if (!skipScope())
852
					fPosition= pos;
853
			case Symbols.TokenSEMICOLON:
854
				// this is the 90% case: after a statement block
855
				// the end of the previous statement / block previous.end
856
				// search to the end of the statement / block before the previous; the token just after that is previous.start
857
				return skipToStatementStart(danglingElse, false);
858
859
			// scope introduction: special treat who special is
860
			case Symbols.TokenLPAREN:
861
			case Symbols.TokenLBRACE:
862
			case Symbols.TokenLBRACKET:
863
				return handleScopeIntroduction(offset + 1);
864
865
			case Symbols.TokenEOF:
866
				// trap when hitting start of document
867
				return CHeuristicScanner.NOT_FOUND;
868
869
			case Symbols.TokenEQUAL:
870
				// indent assignments
871
				fIndent= fPrefs.prefAssignmentIndent;
872
				return fPosition;
873
874
			case Symbols.TokenCOLON:
875
				// TODO handle ternary deep indentation
876
				fIndent= fPrefs.prefCaseBlockIndent;
877
				return fPosition;
878
879
			case Symbols.TokenQUESTIONMARK:
880
				if (fPrefs.prefTernaryDeepAlign) {
881
					setFirstElementAlignment(fPosition, offset + 1);
882
					return fPosition;
883
				} else {
884
					fIndent= fPrefs.prefTernaryIndent;
885
					return fPosition;
886
				}
887
888
			// indentation for blockless introducers:
889
			case Symbols.TokenDO:
890
			case Symbols.TokenWHILE:
891
			case Symbols.TokenELSE:
892
				fIndent= fPrefs.prefSimpleIndent;
893
				return fPosition;
894
895
			case Symbols.TokenTRY:
896
				return skipToStatementStart(danglingElse, false);
897
			case Symbols.TokenRPAREN:
898
				int line= fLine;
899
				if (skipScope(Symbols.TokenLPAREN, Symbols.TokenRPAREN)) {
900
					int scope= fPosition;
901
					nextToken();
902
					if (fToken == Symbols.TokenIF || fToken == Symbols.TokenWHILE || fToken == Symbols.TokenFOR) {
903
						fIndent= fPrefs.prefSimpleIndent;
904
						return fPosition;
905
					}
906
					fPosition= scope;
907
					if (looksLikeMethodDecl()) {
908
						return skipToStatementStart(danglingElse, false);
909
					}
910
					if (fToken == Symbols.TokenCATCH) {
911
						return skipToStatementStart(danglingElse, false);
912
					}
913
					fPosition= scope;
914
					if (looksLikeAnonymousTypeDecl()) {
915
						return skipToStatementStart(danglingElse, false);
916
					}
917
				}
918
				// restore
919
				fPosition= offset;
920
				fLine= line;
921
				// else: fall through to default
922
923
			case Symbols.TokenCOMMA:
924
				// inside a list of some type
925
				// easy if there is already a list item before with its own indentation - we just align
926
				// if not: take the start of the list ( LPAREN, LBRACE, LBRACKET ) and either align or
927
				// indent by list-indent
928
			default:
929
				// inside whatever we don't know about: similar to the list case:
930
				// if we are inside a continued expression, then either align with a previous line that has indentation
931
				// or indent from the expression start line (either a scope introducer or the start of the expr).
932
				return skipToPreviousListItemOrListStart();
933
934
		}
935
	}
936
937
	/**
938
	 * Skips to the start of a statement that ends at the current position.
939
	 *
940
	 * @param danglingElse whether to indent aligned with the last <code>if</code>
941
	 * @param isInBlock whether the current position is inside a block, which limits the search scope to the next scope introducer
942
	 * @return the reference offset of the start of the statement
943
	 */
944
	private int skipToStatementStart(boolean danglingElse, boolean isInBlock) {
945
		final int NOTHING= 0;
946
		final int READ_PARENS= 1;
947
		final int READ_IDENT= 2;
948
		int mayBeMethodBody= NOTHING;
949
		boolean isTypeBody= false;
950
		while (true) {
951
			nextToken();
952
953
			if (isInBlock) {
954
				switch (fToken) {
955
					// exit on all block introducers
956
					case Symbols.TokenIF:
957
					case Symbols.TokenELSE:
958
					case Symbols.TokenCATCH:
959
					case Symbols.TokenDO:
960
					case Symbols.TokenWHILE:
961
					case Symbols.TokenFOR:
962
					case Symbols.TokenTRY:
963
						return fPosition;
964
965
					case Symbols.TokenSTATIC:
966
						mayBeMethodBody= READ_IDENT; // treat static blocks like methods
967
						break;
968
969
					case Symbols.TokenCLASS:
970
					case Symbols.TokenENUM:
971
						isTypeBody= true;
972
						break;
973
974
					case Symbols.TokenSWITCH:
975
						fIndent= fPrefs.prefCaseIndent;
976
						return fPosition;
977
				}
978
			}
979
980
			switch (fToken) {
981
				// scope introduction through: LPAREN, LBRACE, LBRACKET
982
				// search stop on SEMICOLON, RBRACE, COLON, EOF
983
				// -> the next token is the start of the statement (i.e. previousPos when backward scanning)
984
				case Symbols.TokenLPAREN:
985
				case Symbols.TokenLBRACE:
986
				case Symbols.TokenLBRACKET:
987
				case Symbols.TokenSEMICOLON:
988
				case Symbols.TokenEOF:
989
					if (isInBlock)
990
						fIndent= getBlockIndent(mayBeMethodBody == READ_IDENT, isTypeBody);
991
					// else: fIndent set by previous calls
992
					return fPreviousPos;
993
994
				case Symbols.TokenCOLON:
995
					int pos= fPreviousPos;
996
					if (!isConditional())
997
						return pos;
998
					break;
999
1000
				case Symbols.TokenRBRACE:
1001
					// RBRACE is a little tricky: it can be the end of an array definition, but
1002
					// usually it is the end of a previous block
1003
					pos= fPreviousPos; // store state
1004
					if (skipScope() && looksLikeArrayInitializerIntro()) {
1005
						continue; // it's an array
1006
					} else {
1007
						if (isInBlock)
1008
							fIndent= getBlockIndent(mayBeMethodBody == READ_IDENT, isTypeBody);
1009
						return pos; // it's not - do as with all the above
1010
					}
1011
1012
				// scopes: skip them
1013
				case Symbols.TokenRPAREN:
1014
					if (isInBlock)
1015
						mayBeMethodBody= READ_PARENS;
1016
				case Symbols.TokenRBRACKET:
1017
				case Symbols.TokenGREATERTHAN:
1018
					pos= fPreviousPos;
1019
					if (skipScope())
1020
						break;
1021
					else
1022
						return pos;
1023
1024
				// IF / ELSE: align the position after the conditional block with the if
1025
				// so we are ready for an else, except if danglingElse is false
1026
				// in order for this to work, we must skip an else to its if
1027
				case Symbols.TokenIF:
1028
					if (danglingElse)
1029
						return fPosition;
1030
					else
1031
						break;
1032
				case Symbols.TokenELSE:
1033
					// skip behind the next if, as we have that one covered
1034
					pos= fPosition;
1035
					if (skipNextIF())
1036
						break;
1037
					else
1038
						return pos;
1039
1040
				case Symbols.TokenDO:
1041
					// align the WHILE position with its do
1042
					return fPosition;
1043
1044
				case Symbols.TokenWHILE:
1045
					// this one is tricky: while can be the start of a while loop
1046
					// or the end of a do - while
1047
					pos= fPosition;
1048
					if (hasMatchingDo()) {
1049
						// continue searching from the DO on
1050
						break;
1051
					} else {
1052
						// continue searching from the WHILE on
1053
						fPosition= pos;
1054
						break;
1055
					}
1056
				case Symbols.TokenIDENT:
1057
					if (mayBeMethodBody == READ_PARENS)
1058
						mayBeMethodBody= READ_IDENT;
1059
					break;
1060
1061
				default:
1062
					// keep searching
1063
1064
			}
1065
1066
		}
1067
	}
1068
1069
	private int getBlockIndent(boolean isMethodBody, boolean isTypeBody) {
1070
		if (isTypeBody)
1071
			return fPrefs.prefTypeIndent + (fPrefs.prefIndentBracesForTypes ? 1 : 0);
1072
		else if (isMethodBody)
1073
			return fPrefs.prefMethodBodyIndent + (fPrefs.prefIndentBracesForMethods ? 1 : 0);
1074
		else
1075
			return fIndent;
1076
	}
1077
1078
	/**
1079
	 * Returns true if the colon at the current position is part of a conditional
1080
	 * (ternary) expression, false otherwise.
1081
	 *
1082
	 * @return true if the colon at the current position is part of a conditional
1083
	 */
1084
	private boolean isConditional() {
1085
		while (true) {
1086
			nextToken();
1087
			switch (fToken) {
1088
1089
				// search for case labels, which consist of (possibly qualified) identifiers or numbers
1090
				case Symbols.TokenIDENT:
1091
				case Symbols.TokenOTHER: // dots for qualified constants
1092
					continue;
1093
				case Symbols.TokenCASE:
1094
					return false;
1095
1096
				default:
1097
					return true;
1098
			}
1099
		}
1100
	}
1101
1102
	/**
1103
	 * Returns as a reference any previous <code>switch</code> labels (<code>case</code>
1104
	 * or <code>default</code>) or the offset of the brace that scopes the switch
1105
	 * statement. Sets <code>fIndent</code> to <code>prefCaseIndent</code> upon
1106
	 * a match.
1107
	 *
1108
	 * @return the reference offset for a <code>switch</code> label
1109
	 */
1110
	private int matchCaseAlignment() {
1111
		while (true) {
1112
			nextToken();
1113
			switch (fToken) {
1114
				// invalid cases: another case label or an LBRACE must come before a case
1115
				// -> bail out with the current position
1116
				case Symbols.TokenLPAREN:
1117
				case Symbols.TokenLBRACKET:
1118
				case Symbols.TokenEOF:
1119
					return fPosition;
1120
				case Symbols.TokenLBRACE:
1121
					// opening brace of switch statement
1122
					fIndent= fPrefs.prefCaseIndent;
1123
					return fPosition;
1124
				case Symbols.TokenCASE:
1125
				case Symbols.TokenDEFAULT:
1126
					// align with previous label
1127
					fIndent= 0;
1128
					return fPosition;
1129
1130
				// scopes: skip them
1131
				case Symbols.TokenRPAREN:
1132
				case Symbols.TokenRBRACKET:
1133
				case Symbols.TokenRBRACE:
1134
				case Symbols.TokenGREATERTHAN:
1135
					skipScope();
1136
					break;
1137
1138
				default:
1139
					// keep searching
1140
					continue;
1141
1142
			}
1143
		}
1144
	}
1145
1146
	/**
1147
	 * Returns the reference position for a list element. The algorithm
1148
	 * tries to match any previous indentation on the same list. If there is none,
1149
	 * the reference position returned is determined depending on the type of list:
1150
	 * The indentation will either match the list scope introducer (e.g. for
1151
	 * method declarations), so called deep indents, or simply increase the
1152
	 * indentation by a number of standard indents. See also {@link #handleScopeIntroduction(int)}.
1153
	 *
1154
	 * @return the reference position for a list item: either a previous list item
1155
	 * that has its own indentation, or the list introduction start.
1156
	 */
1157
	private int skipToPreviousListItemOrListStart() {
1158
		int startLine= fLine;
1159
		int startPosition= fPosition;
1160
		while (true) {
1161
			nextToken();
1162
1163
			// if any line item comes with its own indentation, adapt to it
1164
			if (fLine < startLine) {
1165
				try {
1166
					int lineOffset= fDocument.getLineOffset(startLine);
1167
					int bound= Math.min(fDocument.getLength(), startPosition + 1);
1168
					fAlign= fScanner.findNonWhitespaceForwardInAnyPartition(lineOffset, bound);
1169
				} catch (BadLocationException e) {
1170
					// ignore and return just the position
1171
				}
1172
				return startPosition;
1173
			}
1174
1175
			switch (fToken) {
1176
				// scopes: skip them
1177
				case Symbols.TokenRPAREN:
1178
				case Symbols.TokenRBRACKET:
1179
				case Symbols.TokenRBRACE:
1180
				case Symbols.TokenGREATERTHAN:
1181
					skipScope();
1182
					break;
1183
1184
				// scope introduction: special treat who special is
1185
				case Symbols.TokenLPAREN:
1186
				case Symbols.TokenLBRACE:
1187
				case Symbols.TokenLBRACKET:
1188
					return handleScopeIntroduction(startPosition + 1);
1189
1190
				case Symbols.TokenSEMICOLON:
1191
					return fPosition;
1192
				case Symbols.TokenQUESTIONMARK:
1193
					if (fPrefs.prefTernaryDeepAlign) {
1194
						setFirstElementAlignment(fPosition - 1, fPosition + 1);
1195
						return fPosition;
1196
					} else {
1197
						fIndent= fPrefs.prefTernaryIndent;
1198
						return fPosition;
1199
					}
1200
				case Symbols.TokenEOF:
1201
					return 0;
1202
1203
			}
1204
		}
1205
	}
1206
1207
	/**
1208
	 * Skips a scope and positions the cursor (<code>fPosition</code>) on the
1209
	 * token that opens the scope. Returns <code>true</code> if a matching peer
1210
	 * could be found, <code>false</code> otherwise. The current token when calling
1211
	 * must be one out of <code>Symbols.TokenRPAREN</code>, <code>Symbols.TokenRBRACE</code>,
1212
	 * and <code>Symbols.TokenRBRACKET</code>.
1213
	 *
1214
	 * @return <code>true</code> if a matching peer was found, <code>false</code> otherwise
1215
	 */
1216
	private boolean skipScope() {
1217
		switch (fToken) {
1218
			case Symbols.TokenRPAREN:
1219
				return skipScope(Symbols.TokenLPAREN, Symbols.TokenRPAREN);
1220
			case Symbols.TokenRBRACKET:
1221
				return skipScope(Symbols.TokenLBRACKET, Symbols.TokenRBRACKET);
1222
			case Symbols.TokenRBRACE:
1223
				return skipScope(Symbols.TokenLBRACE, Symbols.TokenRBRACE);
1224
			case Symbols.TokenGREATERTHAN:
1225
				if (!fPrefs.prefHasGenerics)
1226
					return false;
1227
				int storedPosition= fPosition;
1228
				int storedToken= fToken;
1229
				nextToken();
1230
				switch (fToken) {
1231
					case Symbols.TokenIDENT:
1232
						if (!isGenericStarter(getTokenContent()))
1233
							break;
1234
					case Symbols.TokenQUESTIONMARK:
1235
					case Symbols.TokenGREATERTHAN:
1236
						if (skipScope(Symbols.TokenLESSTHAN, Symbols.TokenGREATERTHAN))
1237
							return true;
1238
				}
1239
				// <> are harder to detect - restore the position if we fail
1240
				fPosition= storedPosition;
1241
				fToken= storedToken;
1242
				return false;
1243
1244
			default:
1245
				Assert.isTrue(false);
1246
				return false;
1247
		}
1248
	}
1249
1250
	/**
1251
	 * Returns the contents of the current token.
1252
	 *
1253
	 * @return the contents of the current token
1254
	 */
1255
	private CharSequence getTokenContent() {
1256
		return new DocumentCharacterIterator(fDocument, fPosition, fPreviousPos);
1257
	}
1258
1259
	/**
1260
	 * Returns <code>true</code> if <code>identifier</code> is probably a
1261
	 * type variable or type name, <code>false</code> if it is rather not.
1262
	 * This is a heuristic.
1263
	 *
1264
	 * @param identifier the identifier to check
1265
	 * @return <code>true</code> if <code>identifier</code> is probably a
1266
	 *         type variable or type name, <code>false</code> if not
1267
	 */
1268
	private boolean isGenericStarter(CharSequence identifier) {
1269
		/* This heuristic allows any identifiers if they start with an upper
1270
		 * case. This will fail when a comparison is made with constants:
1271
		 *
1272
		 * if (MAX > foo)
1273
		 *
1274
		 * will try to find the matching '<' which will never come
1275
		 *
1276
		 * Also, it will fail on lower case types and type variables
1277
		 */
1278
		int length= identifier.length();
1279
		if (length > 0 && Character.isUpperCase(identifier.charAt(0))) {
1280
			for (int i= 0; i < length; i++) {
1281
				if (identifier.charAt(i) == '_')
1282
					return false;
1283
			}
1284
			return true;
1285
		}
1286
		return false;
1287
	}
1288
1289
	/**
1290
	 * Handles the introduction of a new scope. The current token must be one out
1291
	 * of <code>Symbols.TokenLPAREN</code>, <code>Symbols.TokenLBRACE</code>,
1292
	 * and <code>Symbols.TokenLBRACKET</code>. Returns as the reference position
1293
	 * either the token introducing the scope or - if available - the first
1294
	 * token after that.
1295
	 *
1296
	 * <p>Depending on the type of scope introduction, the indentation will align
1297
	 * (deep indenting) with the reference position (<code>fAlign</code> will be
1298
	 * set to the reference position) or <code>fIndent</code> will be set to
1299
	 * the number of indentation units.
1300
	 * </p>
1301
	 *
1302
	 * @param bound the bound for the search for the first token after the scope
1303
	 * introduction.
1304
	 * @return the indent
1305
	 */
1306
	private int handleScopeIntroduction(int bound) {
1307
		switch (fToken) {
1308
			// scope introduction: special treat who special is
1309
			case Symbols.TokenLPAREN:
1310
				int pos= fPosition; // store
1311
1312
				// special: method declaration deep indentation
1313
				if (looksLikeMethodDecl()) {
1314
					if (fPrefs.prefMethodDeclDeepIndent)
1315
						return setFirstElementAlignment(pos, bound);
1316
					else {
1317
						fIndent= fPrefs.prefMethodDeclIndent;
1318
						return pos;
1319
					}
1320
				} else {
1321
					fPosition= pos;
1322
					if (looksLikeMethodCall()) {
1323
						if (fPrefs.prefMethodCallDeepIndent)
1324
							return setFirstElementAlignment(pos, bound);
1325
						else {
1326
							fIndent= fPrefs.prefMethodCallIndent;
1327
							return pos;
1328
						}
1329
					} else if (fPrefs.prefParenthesisDeepIndent)
1330
						return setFirstElementAlignment(pos, bound);
1331
				}
1332
1333
				// normal: return the parenthesis as reference
1334
				fIndent= fPrefs.prefParenthesisIndent;
1335
				return pos;
1336
1337
			case Symbols.TokenLBRACE:
1338
				pos= fPosition; // store
1339
1340
				// special: array initializer
1341
				if (looksLikeArrayInitializerIntro())
1342
					if (fPrefs.prefArrayDeepIndent)
1343
						return setFirstElementAlignment(pos, bound);
1344
					else
1345
						fIndent= fPrefs.prefArrayIndent;
1346
				else
1347
					fIndent= fPrefs.prefBlockIndent;
1348
1349
				// normal: skip to the statement start before the scope introducer
1350
				// opening braces are often on differently ending indents than e.g. a method definition
1351
				if (looksLikeArrayInitializerIntro() && !fPrefs.prefIndentBracesForArrays
1352
						|| !fPrefs.prefIndentBracesForBlocks) {
1353
					fPosition= pos; // restore
1354
					return skipToStatementStart(true, true); // set to true to match the first if
1355
				} else {
1356
					return pos;
1357
				}
1358
1359
			case Symbols.TokenLBRACKET:
1360
				pos= fPosition; // store
1361
1362
				// special: method declaration deep indentation
1363
				if (fPrefs.prefArrayDimensionsDeepIndent) {
1364
					return setFirstElementAlignment(pos, bound);
1365
				}
1366
1367
				// normal: return the bracket as reference
1368
				fIndent= fPrefs.prefBracketIndent;
1369
				return pos; // restore
1370
1371
			default:
1372
				Assert.isTrue(false);
1373
				return -1; // dummy
1374
		}
1375
	}
1376
1377
	/**
1378
	 * Sets the deep indent offset (<code>fAlign</code>) to either the offset
1379
	 * right after <code>scopeIntroducerOffset</code> or - if available - the
1380
	 * first C token after <code>scopeIntroducerOffset</code>, but before
1381
	 * <code>bound</code>.
1382
	 *
1383
	 * @param scopeIntroducerOffset the offset of the scope introducer
1384
	 * @param bound the bound for the search for another element
1385
	 * @return the reference position
1386
	 */
1387
	private int setFirstElementAlignment(int scopeIntroducerOffset, int bound) {
1388
		int firstPossible= scopeIntroducerOffset + 1; // align with the first position after the scope intro
1389
		fAlign= fScanner.findNonWhitespaceForwardInAnyPartition(firstPossible, bound);
1390
		if (fAlign == CHeuristicScanner.NOT_FOUND)
1391
			fAlign= firstPossible;
1392
		return fAlign;
1393
	}
1394
1395
1396
	/**
1397
	 * Returns <code>true</code> if the next token received after calling
1398
	 * <code>nextToken</code> is either an equal sign or an array designator ('[]').
1399
	 *
1400
	 * @return <code>true</code> if the next elements look like the start of an array definition
1401
	 */
1402
	private boolean looksLikeArrayInitializerIntro() {
1403
		nextToken();
1404
		if (fToken == Symbols.TokenEQUAL || skipBrackets()) {
1405
			return true;
1406
		}
1407
		return false;
1408
	}
1409
1410
	/**
1411
	 * Skips over the next <code>if</code> keyword. The current token when calling
1412
	 * this method must be an <code>else</code> keyword. Returns <code>true</code>
1413
	 * if a matching <code>if</code> could be found, <code>false</code> otherwise.
1414
	 * The cursor (<code>fPosition</code>) is set to the offset of the <code>if</code>
1415
	 * token.
1416
	 *
1417
	 * @return <code>true</code> if a matching <code>if</code> token was found, <code>false</code> otherwise
1418
	 */
1419
	private boolean skipNextIF() {
1420
		Assert.isTrue(fToken == Symbols.TokenELSE);
1421
1422
		while (true) {
1423
			nextToken();
1424
			switch (fToken) {
1425
				// scopes: skip them
1426
				case Symbols.TokenRPAREN:
1427
				case Symbols.TokenRBRACKET:
1428
				case Symbols.TokenRBRACE:
1429
				case Symbols.TokenGREATERTHAN:
1430
					skipScope();
1431
					break;
1432
1433
				case Symbols.TokenIF:
1434
					// found it, return
1435
					return true;
1436
				case Symbols.TokenELSE:
1437
					// recursively skip else-if blocks
1438
					skipNextIF();
1439
					break;
1440
1441
				// shortcut scope starts
1442
				case Symbols.TokenLPAREN:
1443
				case Symbols.TokenLBRACE:
1444
				case Symbols.TokenLBRACKET:
1445
				case Symbols.TokenEOF:
1446
					return false;
1447
				}
1448
		}
1449
	}
1450
1451
1452
	/**
1453
	 * while(condition); is ambiguous when parsed backwardly, as it is a valid
1454
	 * statement by its own, so we have to check whether there is a matching
1455
	 * do. A <code>do</code> can either be separated from the while by a
1456
	 * block, or by a single statement, which limits our search distance.
1457
	 *
1458
	 * @return <code>true</code> if the <code>while</code> currently in
1459
	 *         <code>fToken</code> has a matching <code>do</code>.
1460
	 */
1461
	private boolean hasMatchingDo() {
1462
		Assert.isTrue(fToken == Symbols.TokenWHILE);
1463
		nextToken();
1464
		switch (fToken) {
1465
			case Symbols.TokenRBRACE:
1466
				skipScope(); // and fall thru
1467
			case Symbols.TokenSEMICOLON:
1468
				skipToStatementStart(false, false);
1469
				return fToken == Symbols.TokenDO;
1470
		}
1471
		return false;
1472
	}
1473
1474
	/**
1475
	 * Skips brackets if the current token is a RBRACKET. There can be nothing
1476
	 * but whitespace in between, this is only to be used for <code>[]</code> elements.
1477
	 *
1478
	 * @return <code>true</code> if a <code>[]</code> could be scanned, the
1479
	 *         current token is left at the LBRACKET.
1480
	 */
1481
	private boolean skipBrackets() {
1482
		if (fToken == Symbols.TokenRBRACKET) {
1483
			nextToken();
1484
			if (fToken == Symbols.TokenLBRACKET) {
1485
				return true;
1486
			}
1487
		}
1488
		return false;
1489
	}
1490
1491
	/**
1492
	 * Reads the next token in backward direction from the heuristic scanner
1493
	 * and sets the fields <code>fToken, fPreviousPosition</code> and <code>fPosition</code>
1494
	 * accordingly.
1495
	 */
1496
	private void nextToken() {
1497
		nextToken(fPosition);
1498
	}
1499
1500
	/**
1501
	 * Reads the next token in backward direction of <code>start</code> from
1502
	 * the heuristic scanner and sets the fields <code>fToken, fPreviousPosition</code>
1503
	 * and <code>fPosition</code> accordingly.
1504
	 *
1505
	 * @param start the start offset from which to scan backwards
1506
	 */
1507
	private void nextToken(int start) {
1508
		fToken= fScanner.previousToken(start - 1, CHeuristicScanner.UNBOUND);
1509
		fPreviousPos= start;
1510
		fPosition= fScanner.getPosition() + 1;
1511
		try {
1512
			fLine= fDocument.getLineOfOffset(fPosition);
1513
		} catch (BadLocationException e) {
1514
			fLine= -1;
1515
		}
1516
	}
1517
1518
	/**
1519
	 * Returns <code>true</code> if the current tokens look like a method
1520
	 * declaration header (i.e. only the return type and method name). The
1521
	 * heuristic calls <code>nextToken</code> and expects an identifier
1522
	 * (method name) and a type declaration (an identifier with optional
1523
	 * brackets) which also covers the visibility modifier of constructors; it
1524
	 * does not recognize package visible constructors.
1525
	 *
1526
	 * @return <code>true</code> if the current position looks like a method
1527
	 *         declaration header.
1528
	 */
1529
	private boolean looksLikeMethodDecl() {
1530
		/*
1531
		 * TODO This heuristic does not recognize package private constructors
1532
		 * since those do have neither type nor visibility keywords.
1533
		 * One option would be to go over the parameter list, but that might
1534
		 * be empty as well, or not typed in yet - hard to do without an AST...
1535
		 */
1536
1537
		nextToken();
1538
		if (fToken == Symbols.TokenIDENT) { // method name
1539
			do nextToken();
1540
			while (skipBrackets()); // optional brackets for array valued return types
1541
1542
			return fToken == Symbols.TokenIDENT; // return type name
1543
1544
		}
1545
		return false;
1546
	}
1547
1548
	/**
1549
	 * Returns <code>true</code> if the current tokens look like an anonymous type declaration
1550
	 * header (i.e. a type name (potentially qualified) and a new keyword). The heuristic calls
1551
	 * <code>nextToken</code> and expects a possibly qualified identifier (type name) and a new
1552
	 * keyword
1553
	 * 
1554
	 * @return <code>true</code> if the current position looks like a anonymous type declaration
1555
	 *         header.
1556
	 */
1557
	private boolean looksLikeAnonymousTypeDecl() {
1558
		nextToken();
1559
		if (fToken == Symbols.TokenIDENT) { // type name
1560
			nextToken();
1561
			while (fToken == Symbols.TokenOTHER) { // dot of qualification
1562
				nextToken();
1563
				if (fToken != Symbols.TokenIDENT) // qualificating name
1564
					return false;
1565
				nextToken();
1566
			}
1567
			return fToken == Symbols.TokenNEW;
1568
		}
1569
		return false;
1570
	}
1571
1572
	/**
1573
	 * Returns <code>true</code> if the current tokens look like a method
1574
	 * call header (i.e. an identifier as opposed to a keyword taking parenthesized
1575
	 * parameters such as <code>if</code>).
1576
	 * <p>The heuristic calls <code>nextToken</code> and expects an identifier
1577
	 * (method name).
1578
	 *
1579
	 * @return <code>true</code> if the current position looks like a method call
1580
	 *         header.
1581
	 */
1582
	private boolean looksLikeMethodCall() {
1583
		// TODO add awareness for constructor calls with generic types: new ArrayList<String>()
1584
		nextToken();
1585
		return fToken == Symbols.TokenIDENT; // method name
1586
	}
1587
1588
	/**
1589
	 * Scans tokens for the matching opening peer. The internal cursor
1590
	 * (<code>fPosition</code>) is set to the offset of the opening peer if found.
1591
	 *
1592
	 * @param openToken the opening peer token
1593
	 * @param closeToken the closing peer token
1594
	 * @return <code>true</code> if a matching token was found, <code>false</code>
1595
	 *         otherwise
1596
	 */
1597
	private boolean skipScope(int openToken, int closeToken) {
1598
1599
		int depth= 1;
1600
1601
		while (true) {
1602
			nextToken();
1603
1604
			if (fToken == closeToken) {
1605
				depth++;
1606
			} else if (fToken == openToken) {
1607
				depth--;
1608
				if (depth == 0)
1609
					return true;
1610
			} else if (fToken == Symbols.TokenEOF) {
1611
					return false;
1612
			}
1613
		}
1614
	}
1615
}
(-)src/org/eclipse/cdt/internal/ui/text/SimpleDocument.java (+374 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2006 IBM Corporation and others.
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
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.cdt.internal.ui.text;
12
13
import org.eclipse.jface.text.IDocument;
14
import org.eclipse.jface.text.IDocumentListener;
15
import org.eclipse.jface.text.IDocumentPartitioner;
16
import org.eclipse.jface.text.IDocumentPartitioningListener;
17
import org.eclipse.jface.text.IPositionUpdater;
18
import org.eclipse.jface.text.IRegion;
19
import org.eclipse.jface.text.ITypedRegion;
20
import org.eclipse.jface.text.Position;
21
22
/**
23
 * Minimal implementation of IDocument to apply text edit onto a string.
24
 */
25
public class SimpleDocument implements IDocument {
26
	
27
	private StringBuffer buffer;
28
29
	public SimpleDocument(String source) {
30
		buffer = new StringBuffer(source);
31
	}
32
	
33
	public SimpleDocument(char[] source) {
34
		buffer = new StringBuffer(source.length);
35
		buffer.append(source);
36
	}
37
	
38
	/* (non-Javadoc)
39
	 * @see org.eclipse.jface.text.IDocument#getChar(int)
40
	 */
41
	public char getChar(int offset) {
42
		return 0;
43
	}
44
45
	/* (non-Javadoc)
46
	 * @see org.eclipse.jface.text.IDocument#getLength()
47
	 */
48
	public int getLength() {
49
		return this.buffer.length();
50
	}
51
52
	/* (non-Javadoc)
53
	 * @see org.eclipse.jface.text.IDocument#get()
54
	 */
55
	public String get() {
56
		return this.buffer.toString();
57
	}
58
59
	/* (non-Javadoc)
60
	 * @see org.eclipse.jface.text.IDocument#get(int, int)
61
	 */
62
	public String get(int offset, int length) {
63
		return this.buffer.substring(offset, offset + length);
64
	}
65
66
	/* (non-Javadoc)
67
	 * @see org.eclipse.jface.text.IDocument#set(java.lang.String)
68
	 */
69
	public void set(String text) {
70
		// defining interface method
71
	}
72
73
	/* (non-Javadoc)
74
	 * @see org.eclipse.jface.text.IDocument#replace(int, int, java.lang.String)
75
	 */
76
	public void replace(int offset, int length, String text) {
77
		
78
		this.buffer.replace(offset, offset + length, text);
79
	}
80
81
	/* (non-Javadoc)
82
	 * @see org.eclipse.jface.text.IDocument#addDocumentListener(org.eclipse.jface.text.IDocumentListener)
83
	 */
84
	public void addDocumentListener(IDocumentListener listener) {
85
		// defining interface method
86
	}
87
88
	/* (non-Javadoc)
89
	 * @see org.eclipse.jface.text.IDocument#removeDocumentListener(org.eclipse.jface.text.IDocumentListener)
90
	 */
91
	public void removeDocumentListener(IDocumentListener listener) {
92
		// defining interface method
93
	}
94
95
	/* (non-Javadoc)
96
	 * @see org.eclipse.jface.text.IDocument#addPrenotifiedDocumentListener(org.eclipse.jface.text.IDocumentListener)
97
	 */
98
	public void addPrenotifiedDocumentListener(IDocumentListener documentAdapter) {
99
		// defining interface method
100
	}
101
102
	/* (non-Javadoc)
103
	 * @see org.eclipse.jface.text.IDocument#removePrenotifiedDocumentListener(org.eclipse.jface.text.IDocumentListener)
104
	 */
105
	public void removePrenotifiedDocumentListener(IDocumentListener documentAdapter) {
106
		// defining interface method
107
	}
108
109
	/* (non-Javadoc)
110
	 * @see org.eclipse.jface.text.IDocument#addPositionCategory(java.lang.String)
111
	 */
112
	public void addPositionCategory(String category) {
113
		// defining interface method
114
	}
115
116
	/* (non-Javadoc)
117
	 * @see org.eclipse.jface.text.IDocument#removePositionCategory(java.lang.String)
118
	 */
119
	public void removePositionCategory(String category) {
120
			// defining interface method
121
	}
122
123
	/* (non-Javadoc)
124
	 * @see org.eclipse.jface.text.IDocument#getPositionCategories()
125
	 */
126
	public String[] getPositionCategories() {
127
		// defining interface method
128
		return null;
129
	}
130
131
	/* (non-Javadoc)
132
	 * @see org.eclipse.jface.text.IDocument#containsPositionCategory(java.lang.String)
133
	 */
134
	public boolean containsPositionCategory(String category) {
135
		// defining interface method
136
		return false;
137
	}
138
139
	/* (non-Javadoc)
140
	 * @see org.eclipse.jface.text.IDocument#addPosition(org.eclipse.jface.text.Position)
141
	 */
142
	public void addPosition(Position position) {
143
		// defining interface method
144
	}
145
146
	/* (non-Javadoc)
147
	 * @see org.eclipse.jface.text.IDocument#removePosition(org.eclipse.jface.text.Position)
148
	 */
149
	public void removePosition(Position position) {
150
		// defining interface method
151
	}
152
153
	/* (non-Javadoc)
154
	 * @see org.eclipse.jface.text.IDocument#addPosition(java.lang.String, org.eclipse.jface.text.Position)
155
	 */
156
	public void addPosition(String category, Position position) {
157
		// defining interface method
158
	}
159
160
	/* (non-Javadoc)
161
	 * @see org.eclipse.jface.text.IDocument#removePosition(java.lang.String, org.eclipse.jface.text.Position)
162
	 */
163
	public void removePosition(String category, Position position) {
164
		// defining interface method
165
	}
166
167
	/* (non-Javadoc)
168
	 * @see org.eclipse.jface.text.IDocument#getPositions(java.lang.String)
169
	 */
170
	public Position[] getPositions(String category) {
171
		// defining interface method
172
		return null;
173
	}
174
175
	/* (non-Javadoc)
176
	 * @see org.eclipse.jface.text.IDocument#containsPosition(java.lang.String, int, int)
177
	 */
178
	public boolean containsPosition(String category, int offset, int length) {
179
		// defining interface method
180
		return false;
181
	}
182
183
	/* (non-Javadoc)
184
	 * @see org.eclipse.jface.text.IDocument#computeIndexInCategory(java.lang.String, int)
185
	 */
186
	public int computeIndexInCategory(String category, int offset) {
187
		// defining interface method
188
		return 0;
189
	}
190
191
	/* (non-Javadoc)
192
	 * @see org.eclipse.jface.text.IDocument#addPositionUpdater(org.eclipse.jface.text.IPositionUpdater)
193
	 */
194
	public void addPositionUpdater(IPositionUpdater updater) {
195
		// defining interface method
196
	}
197
198
	/* (non-Javadoc)
199
	 * @see org.eclipse.jface.text.IDocument#removePositionUpdater(org.eclipse.jface.text.IPositionUpdater)
200
	 */
201
	public void removePositionUpdater(IPositionUpdater updater) {
202
		// defining interface method
203
	}
204
205
	/* (non-Javadoc)
206
	 * @see org.eclipse.jface.text.IDocument#insertPositionUpdater(org.eclipse.jface.text.IPositionUpdater, int)
207
	 */
208
	public void insertPositionUpdater(IPositionUpdater updater, int index) {
209
		// defining interface method
210
	}
211
212
	/* (non-Javadoc)
213
	 * @see org.eclipse.jface.text.IDocument#getPositionUpdaters()
214
	 */
215
	public IPositionUpdater[] getPositionUpdaters() {
216
		// defining interface method
217
		return null;
218
	}
219
220
	/* (non-Javadoc)
221
	 * @see org.eclipse.jface.text.IDocument#getLegalContentTypes()
222
	 */
223
	public String[] getLegalContentTypes() {
224
		// defining interface method
225
		return null;
226
	}
227
228
	/* (non-Javadoc)
229
	 * @see org.eclipse.jface.text.IDocument#getContentType(int)
230
	 */
231
	public String getContentType(int offset) {
232
		// defining interface method
233
		return null;
234
	}
235
236
	/* (non-Javadoc)
237
	 * @see org.eclipse.jface.text.IDocument#getPartition(int)
238
	 */
239
	public ITypedRegion getPartition(int offset) {
240
		// defining interface method
241
		return null;
242
	}
243
244
	/* (non-Javadoc)
245
	 * @see org.eclipse.jface.text.IDocument#computePartitioning(int, int)
246
	 */
247
	public ITypedRegion[] computePartitioning(int offset, int length) {
248
		// defining interface method
249
		return null;
250
	}
251
252
	/* (non-Javadoc)
253
	 * @see org.eclipse.jface.text.IDocument#addDocumentPartitioningListener(org.eclipse.jface.text.IDocumentPartitioningListener)
254
	 */
255
	public void addDocumentPartitioningListener(IDocumentPartitioningListener listener) {
256
		// defining interface method
257
	}
258
259
	/* (non-Javadoc)
260
	 * @see org.eclipse.jface.text.IDocument#removeDocumentPartitioningListener(org.eclipse.jface.text.IDocumentPartitioningListener)
261
	 */
262
	public void removeDocumentPartitioningListener(IDocumentPartitioningListener listener) {
263
		// defining interface method
264
	}
265
266
	/* (non-Javadoc)
267
	 * @see org.eclipse.jface.text.IDocument#setDocumentPartitioner(org.eclipse.jface.text.IDocumentPartitioner)
268
	 */
269
	public void setDocumentPartitioner(IDocumentPartitioner partitioner) {
270
		// defining interface method
271
	}
272
273
	/* (non-Javadoc)
274
	 * @see org.eclipse.jface.text.IDocument#getDocumentPartitioner()
275
	 */
276
	public IDocumentPartitioner getDocumentPartitioner() {
277
		// defining interface method
278
		return null;
279
	}
280
281
	/* (non-Javadoc)
282
	 * @see org.eclipse.jface.text.IDocument#getLineLength(int)
283
	 */
284
	public int getLineLength(int line) {
285
		// defining interface method
286
		return 0;
287
	}
288
289
	/* (non-Javadoc)
290
	 * @see org.eclipse.jface.text.IDocument#getLineOfOffset(int)
291
	 */
292
	public int getLineOfOffset(int offset) {
293
		// defining interface method
294
		return 0;
295
	}
296
297
	/* (non-Javadoc)
298
	 * @see org.eclipse.jface.text.IDocument#getLineOffset(int)
299
	 */
300
	public int getLineOffset(int line) {
301
		// defining interface method
302
		return 0;
303
	}
304
305
	/* (non-Javadoc)
306
	 * @see org.eclipse.jface.text.IDocument#getLineInformation(int)
307
	 */
308
	public IRegion getLineInformation(int line) {
309
		// defining interface method
310
		return null;
311
	}
312
313
	/* (non-Javadoc)
314
	 * @see org.eclipse.jface.text.IDocument#getLineInformationOfOffset(int)
315
	 */
316
	public IRegion getLineInformationOfOffset(int offset) {
317
		// defining interface method
318
		return null;
319
	}
320
321
	/* (non-Javadoc)
322
	 * @see org.eclipse.jface.text.IDocument#getNumberOfLines()
323
	 */
324
	public int getNumberOfLines() {
325
		// defining interface method
326
		return 0;
327
	}
328
329
	/* (non-Javadoc)
330
	 * @see org.eclipse.jface.text.IDocument#getNumberOfLines(int, int)
331
	 */
332
	public int getNumberOfLines(int offset, int length) {
333
		// defining interface method
334
		return 0;
335
	}
336
337
	/* (non-Javadoc)
338
	 * @see org.eclipse.jface.text.IDocument#computeNumberOfLines(java.lang.String)
339
	 */
340
	public int computeNumberOfLines(String text) {
341
		// defining interface method
342
		return 0;
343
	}
344
345
	/* (non-Javadoc)
346
	 * @see org.eclipse.jface.text.IDocument#getLegalLineDelimiters()
347
	 */
348
	public String[] getLegalLineDelimiters() {
349
		// defining interface method
350
		return null;
351
	}
352
353
	/* (non-Javadoc)
354
	 * @see org.eclipse.jface.text.IDocument#getLineDelimiter(int)
355
	 */
356
	public String getLineDelimiter(int line) {
357
		// defining interface method
358
		return null;
359
	}
360
361
	/**
362
	 * @see org.eclipse.jface.text.IDocument#search(int, java.lang.String, boolean, boolean, boolean)
363
	 * @deprecated
364
	 */
365
	public int search(
366
		int startOffset,
367
		String findString,
368
		boolean forwardSearch,
369
		boolean caseSensitive,
370
		boolean wholeWord) {
371
		// defining interface method
372
		return 0;
373
	}
374
}
(-)src/org/eclipse/cdt/core/CCorePlugin.java (+20 lines)
Lines 141-146 Link Here
141
	 */
141
	 */
142
	public final static String CONTENT_TYPE_ASMSOURCE = "org.eclipse.cdt.core.asmSource"; //$NON-NLS-1$
142
	public final static String CONTENT_TYPE_ASMSOURCE = "org.eclipse.cdt.core.asmSource"; //$NON-NLS-1$
143
143
144
	/**
145
	 * Possible  configurable option value.
146
	 * @see #getDefaultOptions()
147
	 */
148
	public static final String INSERT = "insert"; //$NON-NLS-1$
149
	/**
150
	 * Possible  configurable option value.
151
	 * @see #getDefaultOptions()
152
	 */
153
	public static final String DO_NOT_INSERT = "do not insert"; //$NON-NLS-1$
154
	/**
155
	 * Possible  configurable option value.
156
	 * @see #getDefaultOptions()
157
	 */
158
	public static final String TAB = "tab"; //$NON-NLS-1$
159
	/**
160
	 * Possible  configurable option value.
161
	 * @see #getDefaultOptions()
162
	 */
163
	public static final String SPACE = "space"; //$NON-NLS-1$
144
164
145
    public CDTLogWriter cdtLog = null;
165
    public CDTLogWriter cdtLog = null;
146
166
(-)src/org/eclipse/cdt/core/formatter/CodeFormatterConstants.java (-3 / +3056 lines)
Lines 7-26 Link Here
7
 *
7
 *
8
 * Contributors:
8
 * Contributors:
9
 *     QNX Software Systems - Initial API and implementation
9
 *     QNX Software Systems - Initial API and implementation
10
 *     Sergey Prigogin, Google
10
 *******************************************************************************/
11
 *******************************************************************************/
11
package org.eclipse.cdt.core.formatter;
12
package org.eclipse.cdt.core.formatter;
12
13
14
import java.util.Map;
15
13
import org.eclipse.cdt.core.CCorePlugin;
16
import org.eclipse.cdt.core.CCorePlugin;
17
import org.eclipse.cdt.internal.formatter.DefaultCodeFormatterOptions;
18
import org.eclipse.cdt.internal.formatter.align.Alignment;
14
19
15
/**
20
/**
16
 */
21
 */
17
public class CodeFormatterConstants {
22
public class CodeFormatterConstants {
18
	
19
23
20
	/**
24
	/**
21
	 * <pre>
25
	 * <pre>
22
	 * FORMATTER / Option for alignment of arguments in allocation expression
26
	 * FORMATTER / Option for alignment of arguments in allocation expression
23
	 *     - option id:         "org.eclipse.jdt.core.formatter.language"
27
	 *     - option id:         "org.eclipse.cdt.core.formatter.language"
24
	 *     - possible values:   values proposed in class <code>ParserLanguage</code> 
28
	 *     - possible values:   values proposed in class <code>ParserLanguage</code> 
25
	 *     - default:           ParserLanguage.CPP
29
	 *     - default:           ParserLanguage.CPP
26
	 * </pre>
30
	 * </pre>
Lines 30-42 Link Here
30
	/**
34
	/**
31
	 * <pre>
35
	 * <pre>
32
	 * FORMATTER / Option for alignment of arguments in allocation expression
36
	 * FORMATTER / Option for alignment of arguments in allocation expression
33
	 *     - option id:         "org.eclipse.jdt.core.formatter.current_file"
37
	 *     - option id:         "org.eclipse.cdt.core.formatter.current_file"
34
	 *     - possible values:   object of class <code>IFile</code> or <code>null</code> 
38
	 *     - possible values:   object of class <code>IFile</code> or <code>null</code> 
35
	 *     - default:           null
39
	 *     - default:           null
36
	 * </pre>
40
	 * </pre>
37
	 */
41
	 */
38
	public static final String FORMATTER_CURRENT_FILE = CCorePlugin.PLUGIN_ID + ".formatter.current_file";	 //$NON-NLS-1$
42
	public static final String FORMATTER_CURRENT_FILE = CCorePlugin.PLUGIN_ID + ".formatter.current_file";	 //$NON-NLS-1$
39
	
43
	
44
	/**
45
	 * <pre>
46
	 * FORMATTER / Value to set a brace location at the end of a line.
47
	 * </pre>
48
	 * @see #FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION
49
	 * @see #FORMATTER_BRACE_POSITION_FOR_ARRAY_INITIALIZER
50
	 * @see #FORMATTER_BRACE_POSITION_FOR_BLOCK
51
	 * @see #FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION
52
 	 * @see #FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION
53
 	 * @see #FORMATTER_BRACE_POSITION_FOR_SWITCH
54
	 * @see #FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION
55
	 */
56
	public static final String END_OF_LINE = "end_of_line";	//$NON-NLS-1$
57
58
	/**
59
	 * <pre>
60
	 * FORMATTER / Value to set an option to false.
61
	 * </pre>
62
	 */
63
	public static final String FALSE = "false"; //$NON-NLS-1$
64
	
65
	/**
66
	 * <pre>
67
	 * FORMATTER / Option to align type members of a type declaration on column
68
	 *     - option id:         "org.eclipse.cdt.core.formatter.formatter.align_type_members_on_columns"
69
	 *     - possible values:   { TRUE, FALSE }
70
	 *     - default:           FALSE
71
	 * </pre>
72
	 * @see #TRUE
73
	 * @see #FALSE
74
	 */
75
	public static final String FORMATTER_ALIGN_TYPE_MEMBERS_ON_COLUMNS = CCorePlugin.PLUGIN_ID + ".formatter.align_type_members_on_columns";	 //$NON-NLS-1$
76
77
	/**
78
	 * <pre>
79
	 * FORMATTER / Option for alignment of arguments in allocation expression
80
	 *     - option id:         "org.eclipse.cdt.core.formatter.alignment_for_arguments_in_allocation_expression"
81
	 *     - possible values:   values returned by <code>createAlignmentValue(boolean, int, int)</code> call
82
	 *     - default:           createAlignmentValue(false, WRAP_COMPACT, INDENT_DEFAULT)
83
	 * </pre>
84
	 * @see #createAlignmentValue(boolean, int, int)
85
	 */
86
	public static final String FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_ALLOCATION_EXPRESSION = CCorePlugin.PLUGIN_ID + ".formatter.alignment_for_arguments_in_allocation_expression";	 //$NON-NLS-1$
87
	/**
88
	 * <pre>
89
	 * FORMATTER / Option for alignment of arguments in enum constant
90
	 *     - option id:         "org.eclipse.cdt.core.formatter.alignment_for_arguments_in_enum_constant"
91
	 *     - possible values:   values returned by <code>createAlignmentValue(boolean, int, int)</code> call
92
	 *     - default:           createAlignmentValue(false, WRAP_COMPACT, INDENT_DEFAULT)
93
	 * </pre>
94
	 * @see #createAlignmentValue(boolean, int, int)
95
	 */
96
	public static final String FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_ENUM_CONSTANT = CCorePlugin.PLUGIN_ID + ".formatter.alignment_for_arguments_in_enum_constant";	 //$NON-NLS-1$
97
	/**
98
	 * <pre>
99
	 * FORMATTER / Option for alignment of arguments in explicit constructor call
100
	 *     - option id:         "org.eclipse.cdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call"
101
	 *     - possible values:   values returned by <code>createAlignmentValue(boolean, int, int)</code> call
102
	 *     - default:           createAlignmentValue(false, WRAP_COMPACT, INDENT_DEFAULT)
103
	 * </pre>
104
	 * @see #createAlignmentValue(boolean, int, int)
105
	 */
106
	public static final String FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_EXPLICIT_CONSTRUCTOR_CALL = CCorePlugin.PLUGIN_ID + ".formatter.alignment_for_arguments_in_explicit_constructor_call";	 //$NON-NLS-1$
107
	/**
108
	 * <pre>
109
	 * FORMATTER / Option for alignment of arguments in method invocation
110
	 *     - option id:         "org.eclipse.cdt.core.formatter.alignment_for_arguments_in_method_invocation"
111
	 *     - possible values:   values returned by <code>createAlignmentValue(boolean, int, int)</code> call
112
	 *     - default:           createAlignmentValue(false, WRAP_COMPACT, INDENT_DEFAULT)
113
	 * </pre>
114
	 * @see #createAlignmentValue(boolean, int, int)
115
	 */
116
	public static final String FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_METHOD_INVOCATION = CCorePlugin.PLUGIN_ID + ".formatter.alignment_for_arguments_in_method_invocation";	 //$NON-NLS-1$
117
	/**
118
	 * <pre>
119
	 * FORMATTER / Option for alignment of arguments in qualified allocation expression
120
	 *     - option id:         "org.eclipse.cdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression"
121
	 *     - possible values:   values returned by <code>createAlignmentValue(boolean, int, int)</code> call
122
	 *     - default:           createAlignmentValue(false, WRAP_COMPACT, INDENT_DEFAULT)
123
	 * </pre>
124
	 * @see #createAlignmentValue(boolean, int, int)
125
	 */
126
	public static final String FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_QUALIFIED_ALLOCATION_EXPRESSION = CCorePlugin.PLUGIN_ID + ".formatter.alignment_for_arguments_in_qualified_allocation_expression";	 //$NON-NLS-1$
127
	/**
128
	 * <pre>
129
	 * FORMATTER / Option for alignment of assignment
130
	 *     - option id:         "org.eclipse.cdt.core.formatter.alignment_for_assignment"
131
	 *     - possible values:   values returned by <code>createAlignmentValue(boolean, int, int)</code> call
132
	 *     - default:           createAlignmentValue(false, M_NO_ALIGNMENT, INDENT_DEFAULT)
133
	 * </pre>
134
	 * @see #createAlignmentValue(boolean, int, int)
135
	 */
136
	public static final String FORMATTER_ALIGNMENT_FOR_ASSIGNMENT  = CCorePlugin.PLUGIN_ID + ".formatter.alignment_for_assignment";	 //$NON-NLS-1$
137
	/**
138
	 * <pre>
139
	 * FORMATTER / Option for alignment of binary expression
140
	 *     - option id:         "org.eclipse.cdt.core.formatter.alignment_for_binary_expression"
141
	 *     - possible values:   values returned by <code>createAlignmentValue(boolean, int, int)</code> call
142
	 *     - default:           createAlignmentValue(false, WRAP_COMPACT, INDENT_DEFAULT)
143
	 * </pre>
144
	 * @see #createAlignmentValue(boolean, int, int)
145
	 */
146
	public static final String FORMATTER_ALIGNMENT_FOR_BINARY_EXPRESSION = CCorePlugin.PLUGIN_ID + ".formatter.alignment_for_binary_expression";	 //$NON-NLS-1$
147
	/**
148
	 * <pre>
149
	 * FORMATTER / Option for alignment of compact if
150
	 *     - option id:         "org.eclipse.cdt.core.formatter.alignment_for_compact_if"
151
	 *     - possible values:   values returned by <code>createAlignmentValue(boolean, int, int)</code> call
152
	 *     - default:           createAlignmentValue(false, WRAP_ONE_PER_LINE, INDENT_BY_ONE)
153
	 * </pre>
154
	 * @see #createAlignmentValue(boolean, int, int)
155
	 */
156
	public static final String FORMATTER_ALIGNMENT_FOR_COMPACT_IF = CCorePlugin.PLUGIN_ID + ".formatter.alignment_for_compact_if";	 //$NON-NLS-1$
157
	/**
158
	 * <pre>
159
	 * FORMATTER / Option for alignment of conditional expression
160
	 *     - option id:         "org.eclipse.cdt.core.formatter.alignment_for_conditional_expression"
161
	 *     - possible values:   values returned by <code>createAlignmentValue(boolean, int, int)</code> call
162
	 *     - default:           createAlignmentValue(false, WRAP_ONE_PER_LINE, INDENT_DEFAULT)
163
	 * </pre>
164
	 * @see #createAlignmentValue(boolean, int, int)
165
	 */
166
	public static final String FORMATTER_ALIGNMENT_FOR_CONDITIONAL_EXPRESSION = CCorePlugin.PLUGIN_ID + ".formatter.alignment_for_conditional_expression";	 //$NON-NLS-1$
167
	/**
168
	 * <pre>
169
	 * FORMATTER / Option for alignment of enum constants
170
	 *     - option id:        "org.eclipse.cdt.core.formatter.alignment_for_enum_constants"
171
	 *     - possible values:  values returned by <code>createAlignmentValue(boolean, int, int)</code> call
172
	 *     - default:          createAlignmentValue(false, WRAP_NO_SPLIT, INDENT_DEFAULT)
173
	 * </pre>
174
	 * @see #createAlignmentValue(boolean, int, int)
175
	 */
176
	public static final String FORMATTER_ALIGNMENT_FOR_ENUM_CONSTANTS = CCorePlugin.PLUGIN_ID + ".formatter.alignment_for_enum_constants";	 //$NON-NLS-1$
177
	/**
178
	 * <pre>
179
	 * FORMATTER / Option for alignment of expressions in array initializer
180
	 *     - option id:         "org.eclipse.cdt.core.formatter.alignment_for_expressions_in_array_initializer"
181
	 *     - possible values:   values returned by <code>createAlignmentValue(boolean, int, int)</code> call
182
	 *     - default:           createAlignmentValue(false, WRAP_COMPACT, INDENT_DEFAULT)
183
	 * </pre>
184
	 * @see #createAlignmentValue(boolean, int, int)
185
	 */
186
	public static final String FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER = CCorePlugin.PLUGIN_ID + ".formatter.alignment_for_expressions_in_array_initializer";	 //$NON-NLS-1$
187
	/**
188
	 * <pre>
189
	 * FORMATTER / Option for alignment of multiple fields
190
	 *     - option id:         "org.eclipse.cdt.core.formatter.alignment_for_multiple_fields"
191
	 *     - possible values:   values returned by <code>createAlignmentValue(boolean, int, int)</code> call
192
	 *     - default:           createAlignmentValue(false, WRAP_COMPACT, INDENT_DEFAULT)
193
	 * </pre>
194
	 * @see #createAlignmentValue(boolean, int, int)
195
	 */
196
	public static final String FORMATTER_ALIGNMENT_FOR_MULTIPLE_FIELDS = CCorePlugin.PLUGIN_ID + ".formatter.alignment_for_multiple_fields";//$NON-NLS-1$	
197
	/**
198
	 * <pre>
199
	 * FORMATTER / Option for alignment of parameters in constructor declaration
200
	 *     - option id:         "org.eclipse.cdt.core.formatter.alignment_for_parameters_in_constructor_declaration"
201
	 *     - possible values:   values returned by <code>createAlignmentValue(boolean, int, int)</code> call
202
	 *     - default:           createAlignmentValue(false, WRAP_COMPACT, INDENT_DEFAULT)
203
	 * </pre>
204
	 * @see #createAlignmentValue(boolean, int, int)
205
	 */
206
	public static final String FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_CONSTRUCTOR_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.alignment_for_parameters_in_constructor_declaration";	 //$NON-NLS-1$
207
	/**
208
	 * <pre>
209
	 * FORMATTER / Option for alignment of parameters in method declaration
210
	 *     - option id:         "org.eclipse.cdt.core.formatter.alignment_for_parameters_in_method_declaration"
211
	 *     - possible values:   values returned by <code>createAlignmentValue(boolean, int, int)</code> call
212
	 *     - default:           createAlignmentValue(false, WRAP_COMPACT, INDENT_DEFAULT)
213
	 * </pre>
214
	 * @see #createAlignmentValue(boolean, int, int)
215
	 */
216
	public static final String FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_METHOD_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.alignment_for_parameters_in_method_declaration";	 //$NON-NLS-1$
217
	/**
218
	 * <pre>
219
	 * FORMATTER / Option for alignment of selector in method invocation
220
	 *     - option id:         "org.eclipse.cdt.core.formatter.alignment_for_selector_in_method_invocation"
221
	 *     - possible values:   values returned by <code>createAlignmentValue(boolean, int, int)</code> call
222
	 *     - default:           createAlignmentValue(false, WRAP_COMPACT, INDENT_DEFAULT)
223
	 * </pre>
224
	 * @see #createAlignmentValue(boolean, int, int)
225
	 */
226
	public static final String FORMATTER_ALIGNMENT_FOR_SELECTOR_IN_METHOD_INVOCATION = CCorePlugin.PLUGIN_ID + ".formatter.alignment_for_selector_in_method_invocation";	 //$NON-NLS-1$
227
	/**
228
	 * <pre>
229
	 * FORMATTER / Option for alignment of superclass in type declaration
230
	 *     - option id:         "org.eclipse.cdt.core.formatter.alignment_for_superclass_in_type_declaration"
231
	 *     - possible values:   values returned by <code>createAlignmentValue(boolean, int, int)</code> call
232
	 *     - default:           createAlignmentValue(false, WRAP_NEXT_SHIFTED, INDENT_DEFAULT)
233
	 * </pre>
234
	 * @see #createAlignmentValue(boolean, int, int)
235
	 */
236
	public static final String FORMATTER_ALIGNMENT_FOR_SUPERCLASS_IN_TYPE_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.alignment_for_superclass_in_type_declaration";	 //$NON-NLS-1$
237
	/**
238
	 * <pre>
239
	 * FORMATTER / Option for alignment of superinterfaces in enum declaration
240
	 *     - option id:         "org.eclipse.cdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration"
241
	 *     - possible values:   values returned by <code>createAlignmentValue(boolean, int, int)</code> call
242
	 *     - default:           createAlignmentValue(false, WRAP_COMPACT, INDENT_DEFAULT)
243
	 * </pre>
244
	 * @see #createAlignmentValue(boolean, int, int)
245
	 */
246
	public static final String FORMATTER_ALIGNMENT_FOR_SUPERINTERFACES_IN_ENUM_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.alignment_for_superinterfaces_in_enum_declaration";	 //$NON-NLS-1$
247
	/**
248
	 * <pre>
249
	 * FORMATTER / Option for alignment of superinterfaces in type declaration
250
	 *     - option id:         "org.eclipse.cdt.core.formatter.alignment_for_superinterfaces_in_type_declaration"
251
	 *     - possible values:   values returned by <code>createAlignmentValue(boolean, int, int)</code> call
252
	 *     - default:           createAlignmentValue(false, WRAP_COMPACT, INDENT_DEFAULT)
253
	 * </pre>
254
	 * @see #createAlignmentValue(boolean, int, int)
255
	 */
256
	public static final String FORMATTER_ALIGNMENT_FOR_SUPERINTERFACES_IN_TYPE_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.alignment_for_superinterfaces_in_type_declaration";	 //$NON-NLS-1$
257
	/**
258
	 * <pre>
259
	 * FORMATTER / Option for alignment of throws clause in constructor declaration
260
	 *     - option id:         "org.eclipse.cdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration"
261
	 *     - possible values:   values returned by <code>createAlignmentValue(boolean, int, int)</code> call
262
	 *     - default:           createAlignmentValue(false, WRAP_COMPACT, INDENT_DEFAULT)
263
	 * </pre>
264
	 * @see #createAlignmentValue(boolean, int, int)
265
	 */
266
	public static final String FORMATTER_ALIGNMENT_FOR_THROWS_CLAUSE_IN_CONSTRUCTOR_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.alignment_for_throws_clause_in_constructor_declaration";	 //$NON-NLS-1$
267
	/**
268
	 * <pre>
269
	 * FORMATTER / Option for alignment of throws clause in method declaration
270
	 *     - option id:         "org.eclipse.cdt.core.formatter.alignment_for_throws_clause_in_method_declaration"
271
	 *     - possible values:   values returned by <code>createAlignmentValue(boolean, int, int)</code> call
272
	 *     - default:           createAlignmentValue(false, WRAP_COMPACT, INDENT_DEFAULT)
273
	 * </pre>
274
	 * @see #createAlignmentValue(boolean, int, int)
275
	 */
276
	public static final String FORMATTER_ALIGNMENT_FOR_THROWS_CLAUSE_IN_METHOD_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.alignment_for_throws_clause_in_method_declaration";	 //$NON-NLS-1$
277
278
//	/**
279
//	 * <pre>
280
//	 * FORMATTER / Option to add blank lines after the imports declaration
281
//	 *     - option id:         "org.eclipse.cdt.core.formatter.blank_lines_after_imports"
282
//	 *     - possible values:   "&lt;n&gt;", where n is zero or a positive integer
283
//	 *     - default:           "0"
284
//	 * </pre>
285
//	 */
286
//	public static final String FORMATTER_BLANK_LINES_AFTER_IMPORTS = CCorePlugin.PLUGIN_ID + ".formatter.blank_lines_after_imports";	//$NON-NLS-1$
287
//	/**
288
//	 * <pre>
289
//	 * FORMATTER / Option to add blank lines after the package declaration
290
//	 *     - option id:         "org.eclipse.cdt.core.formatter.blank_lines_after_package"
291
//	 *     - possible values:   "&lt;n&gt;", where n is zero or a positive integer
292
//	 *     - default:           "0"
293
//	 * </pre>
294
//	 */
295
//	public static final String FORMATTER_BLANK_LINES_AFTER_PACKAGE = CCorePlugin.PLUGIN_ID + ".formatter.blank_lines_after_package";	//$NON-NLS-1$
296
//	/**
297
//	 * <pre>
298
//	 * FORMATTER / Option to add blank lines at the beginning of the method body
299
//	 *     - option id:         "org.eclipse.cdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body"
300
//	 *     - possible values:   "&lt;n&gt;", where n is zero or a positive integer
301
//	 *     - default:           "0"
302
//	 * </pre>
303
//	 */
304
//	public static final String FORMATTER_BLANK_LINES_AT_BEGINNING_OF_METHOD_BODY = CCorePlugin.PLUGIN_ID + ".formatter.number_of_blank_lines_at_beginning_of_method_body"; //$NON-NLS-1$
305
//	/**
306
//	 * <pre>
307
//	 * FORMATTER / Option to add blank lines before a field declaration
308
//	 *     - option id:         "org.eclipse.cdt.core.formatter.blank_lines_before_field"
309
//	 *     - possible values:   "&lt;n&gt;", where n is zero or a positive integer
310
//	 *     - default:           "0"
311
//	 * </pre>
312
//	 */
313
//	public static final String FORMATTER_BLANK_LINES_BEFORE_FIELD = CCorePlugin.PLUGIN_ID + ".formatter.blank_lines_before_field";	//$NON-NLS-1$
314
//	/**
315
//	 * <pre>
316
//	 * FORMATTER / Option to add blank lines before the first class body declaration
317
//	 *     - option id:         "org.eclipse.cdt.core.formatter.blank_lines_before_first_class_body_declaration"
318
//	 *     - possible values:   "&lt;n&gt;", where n is zero or a positive integer
319
//	 *     - default:           "0"
320
//	 * </pre>
321
//	 */
322
//	public static final String FORMATTER_BLANK_LINES_BEFORE_FIRST_CLASS_BODY_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.blank_lines_before_first_class_body_declaration";	//$NON-NLS-1$
323
//	/**
324
//	 * <pre>
325
//	 * FORMATTER / Option to add blank lines before the imports declaration
326
//	 *     - option id:         "org.eclipse.cdt.core.formatter.blank_lines_before_imports"
327
//	 *     - possible values:   "&lt;n&gt;", where n is zero or a positive integer
328
//	 *     - default:           "0"
329
//	 * </pre>
330
//	 */
331
//	public static final String FORMATTER_BLANK_LINES_BEFORE_IMPORTS = CCorePlugin.PLUGIN_ID + ".formatter.blank_lines_before_imports";	//$NON-NLS-1$
332
//	/**
333
//	 * <pre>
334
//	 * FORMATTER / Option to add blank lines before a member type declaration
335
//	 *     - option id:         "org.eclipse.cdt.core.formatter.blank_lines_before_member_type"
336
//	 *     - possible values:   "&lt;n&gt;", where n is zero or a positive integer
337
//	 *     - default:           "0"
338
//	 * </pre>
339
//	 */
340
//	public static final String FORMATTER_BLANK_LINES_BEFORE_MEMBER_TYPE = CCorePlugin.PLUGIN_ID + ".formatter.blank_lines_before_member_type";	//$NON-NLS-1$
341
//	/**
342
//	 * <pre>
343
//	 * FORMATTER / Option to add blank lines before a method declaration
344
//	 *     - option id:         "org.eclipse.cdt.core.formatter.blank_lines_before_method"
345
//	 *     - possible values:   "&lt;n&gt;", where n is zero or a positive integer
346
//	 *     - default:           "0"
347
//	 * </pre>
348
//	 */
349
//	public static final String FORMATTER_BLANK_LINES_BEFORE_METHOD = CCorePlugin.PLUGIN_ID + ".formatter.blank_lines_before_method";	//$NON-NLS-1$
350
//	/**
351
//	 * <pre>
352
//	 * FORMATTER / Option to add blank lines before a new chunk
353
//	 *     - option id:         "org.eclipse.cdt.core.formatter.blank_lines_before_new_chunk"
354
//	 *     - possible values:   "&lt;n&gt;", where n is zero or a positive integer
355
//	 *     - default:           "0"
356
//	 * </pre>
357
//	 */
358
//	public static final String FORMATTER_BLANK_LINES_BEFORE_NEW_CHUNK = CCorePlugin.PLUGIN_ID + ".formatter.blank_lines_before_new_chunk";	//$NON-NLS-1$
359
//	/**
360
//	 * <pre>
361
//	 * FORMATTER / Option to add blank lines before the package declaration
362
//	 *     - option id:         "org.eclipse.cdt.core.formatter.blank_lines_before_package"
363
//	 *     - possible values:   "&lt;n&gt;", where n is zero or a positive integer
364
//	 *     - default:           "0"
365
//	 * </pre>
366
//	 */
367
//	public static final String FORMATTER_BLANK_LINES_BEFORE_PACKAGE = CCorePlugin.PLUGIN_ID + ".formatter.blank_lines_before_package";	//$NON-NLS-1$
368
//	/**
369
//	 * <pre>
370
//	 * FORMATTER / Option to add blank lines between type declarations
371
//	 *     - option id:         "org.eclipse.cdt.core.formatter.blank_lines_between_type_declarations"
372
//	 *     - possible values:   "&lt;n&gt;", where n is zero or a positive integer
373
//	 *     - default:           "0"
374
//	 * </pre>
375
//	 */
376
//	public static final String FORMATTER_BLANK_LINES_BETWEEN_TYPE_DECLARATIONS = CCorePlugin.PLUGIN_ID + ".formatter.blank_lines_between_type_declarations";	//$NON-NLS-1$
377
378
	/**
379
	 * <pre>
380
	 * FORMATTER / Option to position the braces of an annotation type declaration
381
	 *     - option id:         "org.eclipse.cdt.core.formatter.brace_position_for_annotation_type_declaration"
382
	 *     - possible values:   { END_OF_LINE, NEXT_LINE, NEXT_LINE_SHIFTED, NEXT_LINE_ON_WRAP }
383
	 *     - default:           END_OF_LINE
384
	 * </pre>
385
	 * @see #END_OF_LINE
386
	 * @see #NEXT_LINE
387
	 * @see #NEXT_LINE_SHIFTED
388
	 * @see #NEXT_LINE_ON_WRAP
389
	 */
390
	public static final String FORMATTER_BRACE_POSITION_FOR_ARRAY_INITIALIZER = CCorePlugin.PLUGIN_ID + ".formatter.brace_position_for_array_initializer";	//$NON-NLS-1$
391
	/**
392
	 * <pre>
393
	 * FORMATTER / Option to position the braces of a block
394
	 *     - option id:         "org.eclipse.cdt.core.formatter.brace_position_for_block"
395
	 *     - possible values:   { END_OF_LINE, NEXT_LINE, NEXT_LINE_SHIFTED, NEXT_LINE_ON_WRAP }
396
	 *     - default:           END_OF_LINE
397
	 * </pre>
398
	 * @see #END_OF_LINE
399
	 * @see #NEXT_LINE
400
	 * @see #NEXT_LINE_SHIFTED
401
	 * @see #NEXT_LINE_ON_WRAP
402
	 */
403
	public static final String FORMATTER_BRACE_POSITION_FOR_BLOCK = CCorePlugin.PLUGIN_ID + ".formatter.brace_position_for_block";	//$NON-NLS-1$
404
	/**
405
	 * <pre>
406
	 * FORMATTER / Option to position the braces of a block in a case statement when the block is the first statement following
407
	 *             the case
408
	 *     - option id:         "org.eclipse.cdt.core.formatter.brace_position_for_block_in_case"
409
	 *     - possible values:   { END_OF_LINE, NEXT_LINE, NEXT_LINE_SHIFTED, NEXT_LINE_ON_WRAP }
410
	 *     - default:           END_OF_LINE
411
	 * </pre>
412
	 * @see #END_OF_LINE
413
	 * @see #NEXT_LINE
414
	 * @see #NEXT_LINE_SHIFTED
415
	 * @see #NEXT_LINE_ON_WRAP
416
	 */
417
	public static final String FORMATTER_BRACE_POSITION_FOR_BLOCK_IN_CASE = CCorePlugin.PLUGIN_ID + ".formatter.brace_position_for_block_in_case";	//$NON-NLS-1$
418
	/**
419
	 * <pre>
420
	 * FORMATTER / Option to position the braces of a constructor declaration
421
	 *     - option id:         "org.eclipse.cdt.core.formatter.brace_position_for_constructor_declaration"
422
	 *     - possible values:   { END_OF_LINE, NEXT_LINE, NEXT_LINE_SHIFTED, NEXT_LINE_ON_WRAP }
423
	 *     - default:           END_OF_LINE
424
	 * </pre>
425
	 * @see #END_OF_LINE
426
	 * @see #NEXT_LINE
427
	 * @see #NEXT_LINE_SHIFTED
428
	 * @see #NEXT_LINE_ON_WRAP
429
	 */
430
	public static final String FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.brace_position_for_constructor_declaration";	//$NON-NLS-1$
431
	/**
432
	 * <pre>
433
	 * FORMATTER / Option to position the braces of an enum constant
434
	 *     - option id:         "org.eclipse.cdt.core.formatter.brace_position_for_enum_constant"
435
	 *     - possible values:   { END_OF_LINE, NEXT_LINE, NEXT_LINE_SHIFTED, NEXT_LINE_ON_WRAP }
436
	 *     - default:           END_OF_LINE
437
	 * </pre>
438
	 * @see #END_OF_LINE
439
	 * @see #NEXT_LINE
440
	 * @see #NEXT_LINE_SHIFTED
441
	 * @see #NEXT_LINE_ON_WRAP
442
	 */
443
	public static final String FORMATTER_BRACE_POSITION_FOR_ENUM_CONSTANT = CCorePlugin.PLUGIN_ID + ".formatter.brace_position_for_enum_constant";	//$NON-NLS-1$
444
	/**
445
	 * <pre>
446
	 * FORMATTER / Option to position the braces of an enum declaration
447
	 *     - option id:         "org.eclipse.cdt.core.formatter.brace_position_for_enum_declaration"
448
	 *     - possible values:   { END_OF_LINE, NEXT_LINE, NEXT_LINE_SHIFTED, NEXT_LINE_ON_WRAP }
449
	 *     - default:           END_OF_LINE
450
	 * </pre>
451
	 * @see #END_OF_LINE
452
	 * @see #NEXT_LINE
453
	 * @see #NEXT_LINE_SHIFTED
454
	 * @see #NEXT_LINE_ON_WRAP
455
	 */
456
	public static final String FORMATTER_BRACE_POSITION_FOR_ENUM_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.brace_position_for_enum_declaration";	//$NON-NLS-1$
457
	/**
458
	 * <pre>
459
	 * FORMATTER / Option to position the braces of a method declaration
460
	 *     - option id:         "org.eclipse.cdt.core.formatter.brace_position_for_method_declaration"
461
	 *     - possible values:   { END_OF_LINE, NEXT_LINE, NEXT_LINE_SHIFTED, NEXT_LINE_ON_WRAP }
462
	 *     - default:           END_OF_LINE
463
	 * </pre>
464
	 * @see #END_OF_LINE
465
	 * @see #NEXT_LINE
466
	 * @see #NEXT_LINE_SHIFTED
467
	 * @see #NEXT_LINE_ON_WRAP
468
	 */
469
	public static final String FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.brace_position_for_method_declaration";	//$NON-NLS-1$
470
	/**
471
	 * <pre>
472
	 * FORMATTER / Option to position the braces of a switch statement
473
	 *     - option id:         "org.eclipse.cdt.core.formatter.brace_position_for_switch"
474
	 *     - possible values:   { END_OF_LINE, NEXT_LINE, NEXT_LINE_SHIFTED, NEXT_LINE_ON_WRAP }
475
	 *     - default:           END_OF_LINE
476
	 * </pre>
477
	 * @see #END_OF_LINE
478
	 * @see #NEXT_LINE
479
	 * @see #NEXT_LINE_SHIFTED
480
	 * @see #NEXT_LINE_ON_WRAP
481
	 */
482
	public static final String FORMATTER_BRACE_POSITION_FOR_SWITCH = CCorePlugin.PLUGIN_ID + ".formatter.brace_position_for_switch";	//$NON-NLS-1$
483
	/**
484
	 * <pre>
485
	 * FORMATTER / Option to position the braces of a type declaration
486
	 *     - option id:         "org.eclipse.cdt.core.formatter.brace_position_for_type_declaration"
487
	 *     - possible values:   { END_OF_LINE, NEXT_LINE, NEXT_LINE_SHIFTED, NEXT_LINE_ON_WRAP }
488
	 *     - default:           END_OF_LINE
489
	 * </pre>
490
	 * @see #END_OF_LINE
491
	 * @see #NEXT_LINE
492
	 * @see #NEXT_LINE_SHIFTED
493
	 * @see #NEXT_LINE_ON_WRAP
494
	 */
495
	public static final String FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.brace_position_for_type_declaration";	//$NON-NLS-1$
496
497
//	/**
498
//	 * <pre>
499
//	 * FORMATTER / Option to control whether blank lines are cleared inside comments
500
//	 *     - option id:         "org.eclipse.cdt.core.formatter.comment.clear_blank_lines"
501
//	 *     - possible values:   { TRUE, FALSE }
502
//	 *     - default:           FALSE
503
//	 * </pre>
504
//	 * @see #TRUE
505
//	 * @see #FALSE
506
//	 */	
507
//	public final static String FORMATTER_COMMENT_CLEAR_BLANK_LINES = CCorePlugin.PLUGIN_ID + ".formatter.comment.clear_blank_lines"; //$NON-NLS-1$
508
	
509
//	/**
510
//	 * <pre>
511
//	 * FORMATTER / Option to control whether comments are formatted
512
//	 *     - option id:         "org.eclipse.cdt.core.formatter.comment.format_comments"
513
//	 *     - possible values:   { TRUE, FALSE }
514
//	 *     - default:           TRUE
515
//	 * </pre>
516
//	 * @see #TRUE
517
//	 * @see #FALSE
518
//	 */	
519
//	public final static String FORMATTER_COMMENT_FORMAT = CCorePlugin.PLUGIN_ID + ".formatter.comment.format_comments"; //$NON-NLS-1$
520
521
//	/**
522
//	 * <pre>
523
//	 * FORMATTER / Option to control whether the header comment of a C/C++ source file is formatted
524
//	 *     - option id:         "org.eclipse.cdt.core.formatter.comment.format_header"
525
//	 *     - possible values:   { TRUE, FALSE }
526
//	 *     - default:           FALSE
527
//	 * </pre>
528
//	 * @see #TRUE
529
//	 * @see #FALSE
530
//	 */	
531
//	public final static String FORMATTER_COMMENT_FORMAT_HEADER = CCorePlugin.PLUGIN_ID + ".formatter.comment.format_header"; //$NON-NLS-1$
532
533
//	/**
534
//	 * <pre>
535
//	 * FORMATTER / Option to control whether HTML tags are formatted.
536
//	 *     - option id:         "org.eclipse.cdt.core.formatter.comment.format_html"
537
//	 *     - possible values:   { TRUE, FALSE }
538
//	 *     - default:           TRUE
539
//	 * </pre>
540
//	 * @see #TRUE
541
//	 * @see #FALSE
542
//	 */	
543
//	public final static String FORMATTER_COMMENT_FORMAT_HTML = CCorePlugin.PLUGIN_ID + ".formatter.comment.format_html"; //$NON-NLS-1$
544
545
//	/**
546
//	 * <pre>
547
//	 * FORMATTER / Option to control whether code snippets are formatted in comments
548
//	 *     - option id:         "org.eclipse.cdt.core.formatter.comment.format_source_code"
549
//	 *     - possible values:   { TRUE, FALSE }
550
//	 *     - default:           TRUE
551
//	 * </pre>
552
//	 * @see #TRUE
553
//	 * @see #FALSE
554
//	 */	
555
//	public final static String FORMATTER_COMMENT_FORMAT_SOURCE = CCorePlugin.PLUGIN_ID + ".formatter.comment.format_source_code"; //$NON-NLS-1$
556
	
557
//	/**
558
//	 * <pre>
559
//	 * FORMATTER / Option to specify the line length for comments.
560
//	 *     - option id:         "org.eclipse.cdt.core.formatter.comment.line_length"
561
//	 *     - possible values:   "&lt;n&gt;", where n is zero or a positive integer
562
//	 *     - default:           "80"
563
//	 * </pre>
564
//	 */	
565
//	public final static String FORMATTER_COMMENT_LINE_LENGTH = CCorePlugin.PLUGIN_ID + ".formatter.comment.line_length"; //$NON-NLS-1$
566
567
//	/**
568
//	 * <pre>
569
//	 * FORMATTER / Option to compact else/if
570
//	 *     - option id:         "org.eclipse.cdt.core.formatter.compact_else_if"
571
//	 *     - possible values:   { TRUE, FALSE }
572
//	 *     - default:           TRUE
573
//	 * </pre>
574
//	 * @see #TRUE
575
//	 * @see #FALSE
576
//	 */
577
//	public static final String FORMATTER_COMPACT_ELSE_IF = CCorePlugin.PLUGIN_ID + ".formatter.compact_else_if";	//$NON-NLS-1$
578
579
	/**
580
	 * <pre>
581
	 * FORMATTER / Option to set the continuation indentation
582
	 *     - option id:         "org.eclipse.cdt.core.formatter.continuation_indentation"
583
	 *     - possible values:   "&lt;n&gt;", where n is zero or a positive integer
584
	 *     - default:           "2"
585
	 * </pre>
586
	 */
587
	public static final String FORMATTER_CONTINUATION_INDENTATION = CCorePlugin.PLUGIN_ID + ".formatter.continuation_indentation";	//$NON-NLS-1$
588
	/**
589
	 * <pre>
590
	 * FORMATTER / Option to set the continuation indentation inside array initializer
591
	 *     - option id:         "org.eclipse.cdt.core.formatter.continuation_indentation_for_array_initializer"
592
	 *     - possible values:   "&lt;n&gt;", where n is zero or a positive integer
593
	 *     - default:           "2"
594
	 * </pre>
595
	 */
596
	public static final String FORMATTER_CONTINUATION_INDENTATION_FOR_ARRAY_INITIALIZER = CCorePlugin.PLUGIN_ID + ".formatter.continuation_indentation_for_array_initializer";	//$NON-NLS-1$
597
	/**
598
	 * <pre>
599
	 * FORMATTER / Option to indent body declarations compare to its enclosing annotation declaration header
600
	 *     - option id:         "org.eclipse.cdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header"
601
	 *     - possible values:   { TRUE, FALSE }
602
	 *     - default:           TRUE
603
	 * </pre>
604
	 * @see #TRUE
605
	 * @see #FALSE
606
	 */
607
	public static final String FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_ANNOTATION_DECLARATION_HEADER = CCorePlugin.PLUGIN_ID + ".formatter.indent_body_declarations_compare_to_annotation_declaration_header";	//$NON-NLS-1$
608
	/**
609
	 * <pre>
610
	 * FORMATTER / Option to indent body declarations compare to its enclosing enum constant header
611
	 *     - option id:         "org.eclipse.cdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header"
612
	 *     - possible values:   { TRUE, FALSE }
613
	 *     - default:           TRUE
614
	 * </pre>
615
	 * @see #TRUE
616
	 * @see #FALSE
617
	 */
618
	public static final String FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_ENUM_CONSTANT_HEADER = CCorePlugin.PLUGIN_ID + ".formatter.indent_body_declarations_compare_to_enum_constant_header";	//$NON-NLS-1$
619
	/**
620
	 * <pre>
621
	 * FORMATTER / Option to indent body declarations compare to its enclosing enum declaration header
622
	 *     - option id:         "org.eclipse.cdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header"
623
	 *     - possible values:   { TRUE, FALSE }
624
	 *     - default:           TRUE
625
	 * </pre>
626
	 * @see #TRUE
627
	 * @see #FALSE
628
	 */
629
	public static final String FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_ENUM_DECLARATION_HEADER = CCorePlugin.PLUGIN_ID + ".formatter.indent_body_declarations_compare_to_enum_declaration_header";	//$NON-NLS-1$
630
	/**
631
	 * <pre>
632
	 * FORMATTER / Option to indent body declarations compare to its enclosing type header
633
	 *     - option id:         "org.eclipse.cdt.core.formatter.indent_body_declarations_compare_to_type_header"
634
	 *     - possible values:   { TRUE, FALSE }
635
	 *     - default:           TRUE
636
	 * </pre>
637
	 * @see #TRUE
638
	 * @see #FALSE
639
	 */
640
	public static final String FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_TYPE_HEADER = CCorePlugin.PLUGIN_ID + ".formatter.indent_body_declarations_compare_to_type_header";	//$NON-NLS-1$
641
	/**
642
	 * <pre>
643
	 * FORMATTER / Option to indent breaks compare to cases
644
	 *     - option id:         "org.eclipse.cdt.core.formatter.indent_breaks_compare_to_cases"
645
	 *     - possible values:   { TRUE, FALSE }
646
	 *     - default:           TRUE
647
	 * </pre>
648
	 * @see #TRUE
649
	 * @see #FALSE
650
	 */
651
	public static final String FORMATTER_INDENT_BREAKS_COMPARE_TO_CASES = CCorePlugin.PLUGIN_ID + ".formatter.indent_breaks_compare_to_cases";	//$NON-NLS-1$
652
	/**
653
	 * <pre>
654
	 * FORMATTER / Option to indent empty lines
655
	 *     - option id:         "org.eclipse.cdt.core.formatter.indent_empty_lines"
656
	 *     - possible values:   { TRUE, FALSE }
657
	 *     - default:           FALSE
658
	 * </pre>
659
	 * @see #TRUE
660
	 * @see #FALSE
661
	 */
662
	public static final String FORMATTER_INDENT_EMPTY_LINES = CCorePlugin.PLUGIN_ID + ".formatter.indent_empty_lines"; //$NON-NLS-1$	
663
	/**
664
	 * <pre>
665
	 * FORMATTER / Option to indent statements inside a block
666
	 *     - option id:         "org.eclipse.cdt.core.formatter.indent_statements_compare_to_block"
667
	 *     - possible values:   { TRUE, FALSE }
668
	 *     - default:           TRUE
669
	 * </pre>
670
	 * @see #TRUE
671
	 * @see #FALSE
672
	 */
673
	public static final String FORMATTER_INDENT_STATEMENTS_COMPARE_TO_BLOCK = CCorePlugin.PLUGIN_ID + ".formatter.indent_statements_compare_to_block"; //$NON-NLS-1$
674
	/**
675
	 * <pre>
676
	 * FORMATTER / Option to indent statements inside the body of a method or a constructor
677
	 *     - option id:         "org.eclipse.cdt.core.formatter.indent_statements_compare_to_body"
678
	 *     - possible values:   { TRUE, FALSE }
679
	 *     - default:           TRUE
680
	 * </pre>
681
	 * @see #TRUE
682
	 * @see #FALSE
683
	 */
684
	public static final String FORMATTER_INDENT_STATEMENTS_COMPARE_TO_BODY = CCorePlugin.PLUGIN_ID + ".formatter.indent_statements_compare_to_body"; //$NON-NLS-1$
685
	/**
686
	 * <pre>
687
	 * FORMATTER / Option to indent switch statements compare to cases
688
	 *     - option id:         "org.eclipse.cdt.core.formatter.indent_switchstatements_compare_to_cases"
689
	 *     - possible values:   { TRUE, FALSE }
690
	 *     - default:           TRUE
691
	 * </pre>
692
	 * @see #TRUE
693
	 * @see #FALSE
694
	 */
695
	public static final String FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_CASES = CCorePlugin.PLUGIN_ID + ".formatter.indent_switchstatements_compare_to_cases";	//$NON-NLS-1$
696
	/**
697
	 * <pre>
698
	 * FORMATTER / Option to indent switch statements compare to switch
699
	 *     - option id:         "org.eclipse.cdt.core.formatter.indent_switchstatements_compare_to_switch"
700
	 *     - possible values:   { TRUE, FALSE }
701
	 *     - default:           TRUE
702
	 * </pre>
703
	 * @see #TRUE
704
	 * @see #FALSE
705
	 */
706
	public static final String FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_SWITCH = CCorePlugin.PLUGIN_ID + ".formatter.indent_switchstatements_compare_to_switch";	//$NON-NLS-1$
707
708
	/**
709
	 * <pre>
710
	 * FORMATTER / Option to specify the equivalent number of spaces that represents one indentation 
711
	 *     - option id:         "org.eclipse.cdt.core.formatter.indentation.size"
712
	 *     - possible values:   "&lt;n&gt;", where n is zero or a positive integer
713
	 *     - default:           "4"
714
	 * </pre>
715
	 * <p>This option is used only if the tab char is set to MIXED.
716
	 * </p>
717
	 * @see #FORMATTER_TAB_CHAR
718
	 */
719
	public static final String FORMATTER_INDENTATION_SIZE = CCorePlugin.PLUGIN_ID + ".formatter.indentation.size"; //$NON-NLS-1$
720
721
//	/**
722
//	 * <pre>
723
//	 * FORMATTER / Option to insert a new line after an annotation
724
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_new_line_after_annotation"
725
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
726
//	 *     - default:           INSERT
727
//	 * </pre>
728
//	 * @see CCorePlugin#INSERT
729
//	 * @see CCorePlugin#DO_NOT_INSERT
730
//	 */
731
//	public static final String FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_new_line_after_annotation";//$NON-NLS-1$
732
//
733
//	/**
734
//	 * <pre>
735
//	 * FORMATTER / Option to insert a new line after the opening brace in an array initializer
736
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer"
737
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
738
//	 *     - default:           DO_NOT_INSERT
739
//	 * </pre>
740
//	 * @see CCorePlugin#INSERT
741
//	 * @see CCorePlugin#DO_NOT_INSERT
742
//	 */
743
//	public static final String FORMATTER_INSERT_NEW_LINE_AFTER_OPENING_BRACE_IN_ARRAY_INITIALIZER = CCorePlugin.PLUGIN_ID + ".formatter.insert_new_line_after_opening_brace_in_array_initializer";//$NON-NLS-1$
744
//
745
//	/**
746
//	 * <pre>
747
//	 * FORMATTER / Option to insert a new line at the end of the current file if missing
748
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_new_line_at_end_of_file_if_missing"
749
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
750
//	 *     - default:           DO_NOT_INSERT
751
//	 * </pre>
752
//	 * @see CCorePlugin#INSERT
753
//	 * @see CCorePlugin#DO_NOT_INSERT
754
//	 */
755
//	public static final String FORMATTER_INSERT_NEW_LINE_AT_END_OF_FILE_IF_MISSING = CCorePlugin.PLUGIN_ID + ".formatter.insert_new_line_at_end_of_file_if_missing";//$NON-NLS-1$
756
//	/**
757
//	 * <pre>
758
//	 * FORMATTER / Option to insert a new line before the catch keyword in try statement
759
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_new_line_before_catch_in_try_statement"
760
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
761
//	 *     - default:           DO_NOT_INSERT
762
//	 * </pre>
763
//	 * @see CCorePlugin#INSERT
764
//	 * @see CCorePlugin#DO_NOT_INSERT
765
//	 */
766
//	public static final String FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT = CCorePlugin.PLUGIN_ID + ".formatter.insert_new_line_before_catch_in_try_statement";	//$NON-NLS-1$
767
//	/**
768
//	 * <pre>
769
//	 * FORMATTER / Option to insert a new line before the closing brace in an array initializer
770
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer"
771
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
772
//	 *     - default:           DO_NOT_INSERT
773
//	 * </pre>
774
//	 * @see CCorePlugin#INSERT
775
//	 * @see CCorePlugin#DO_NOT_INSERT
776
//	 */
777
//	public static final String FORMATTER_INSERT_NEW_LINE_BEFORE_CLOSING_BRACE_IN_ARRAY_INITIALIZER = CCorePlugin.PLUGIN_ID + ".formatter.insert_new_line_before_closing_brace_in_array_initializer";//$NON-NLS-1$
778
//	/**
779
//	 * <pre>
780
//	 * FORMATTER / Option to insert a new line before the else keyword in if statement
781
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_new_line_before_else_in_if_statement"
782
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
783
//	 *     - default:           DO_NOT_INSERT
784
//	 * </pre>
785
//	 * @see CCorePlugin#INSERT
786
//	 * @see CCorePlugin#DO_NOT_INSERT
787
//	 */
788
//	public static final String FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT = CCorePlugin.PLUGIN_ID + ".formatter.insert_new_line_before_else_in_if_statement";	//$NON-NLS-1$
789
//	/**
790
//	 * <pre>
791
//	 * FORMATTER / Option to insert a new line before the finally keyword in try statement
792
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_new_line_before_finally_in_try_statement"
793
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
794
//	 *     - default:           DO_NOT_INSERT
795
//	 * </pre>
796
//	 * @see CCorePlugin#INSERT
797
//	 * @see CCorePlugin#DO_NOT_INSERT
798
//	 */
799
//	public static final String FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT = CCorePlugin.PLUGIN_ID + ".formatter.insert_new_line_before_finally_in_try_statement";	//$NON-NLS-1$
800
//	/**
801
//	 * <pre>
802
//	 * FORMATTER / Option to insert a new line before while in do statement
803
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_new_line_before_while_in_do_statement"
804
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
805
//	 *     - default:           DO_NOT_INSERT
806
//	 * </pre>
807
//	 * @see CCorePlugin#INSERT
808
//	 * @see CCorePlugin#DO_NOT_INSERT
809
//	 */
810
//	public static final String FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT = CCorePlugin.PLUGIN_ID + ".formatter.insert_new_line_before_while_in_do_statement";	//$NON-NLS-1$
811
//	/**
812
//	 * <pre>
813
//	 * FORMATTER / Option to insert a new line in an empty annotation declaration
814
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_new_line_in_empty_annotation_declaration"
815
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
816
//	 *     - default:           INSERT
817
//	 * </pre>
818
//	 * @see CCorePlugin#INSERT
819
//	 * @see CCorePlugin#DO_NOT_INSERT
820
//	 */
821
//	public static final String FORMATTER_INSERT_NEW_LINE_IN_EMPTY_ANNOTATION_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_new_line_in_empty_annotation_declaration";	//$NON-NLS-1$
822
//	/**
823
//	 * <pre>
824
//	 * FORMATTER / Option to insert a new line in an empty anonymous type declaration
825
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration"
826
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
827
//	 *     - default:           INSERT
828
//	 * </pre>
829
//	 * @see CCorePlugin#INSERT
830
//	 * @see CCorePlugin#DO_NOT_INSERT
831
//	 */
832
//	public static final String FORMATTER_INSERT_NEW_LINE_IN_EMPTY_ANONYMOUS_TYPE_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_new_line_in_empty_anonymous_type_declaration";	//$NON-NLS-1$
833
//	/**
834
//	 * <pre>
835
//	 * FORMATTER / Option to insert a new line in an empty block
836
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_new_line_in_empty_block"
837
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
838
//	 *     - default:           INSERT
839
//	 * </pre>
840
//	 * @see CCorePlugin#INSERT
841
//	 * @see CCorePlugin#DO_NOT_INSERT
842
//	 */
843
//	public static final String FORMATTER_INSERT_NEW_LINE_IN_EMPTY_BLOCK = CCorePlugin.PLUGIN_ID + ".formatter.insert_new_line_in_empty_block";	//$NON-NLS-1$
844
//	/**
845
//	 * <pre>
846
//	 * FORMATTER / Option to insert a new line in an empty enum constant
847
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_new_line_in_empty_enum_constant"
848
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
849
//	 *     - default:           INSERT
850
//	 * </pre>
851
//	 * @see CCorePlugin#INSERT
852
//	 * @see CCorePlugin#DO_NOT_INSERT
853
//	 */
854
//	public static final String FORMATTER_INSERT_NEW_LINE_IN_EMPTY_ENUM_CONSTANT = CCorePlugin.PLUGIN_ID + ".formatter.insert_new_line_in_empty_enum_constant";	//$NON-NLS-1$
855
//	/**
856
//	 * <pre>
857
//	 * FORMATTER / Option to insert a new line in an empty enum declaration
858
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_new_line_in_empty_enum_declaration"
859
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
860
//	 *     - default:           INSERT
861
//	 * </pre>
862
//	 * @see CCorePlugin#INSERT
863
//	 * @see CCorePlugin#DO_NOT_INSERT
864
//	 */
865
//	public static final String FORMATTER_INSERT_NEW_LINE_IN_EMPTY_ENUM_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_new_line_in_empty_enum_declaration";	//$NON-NLS-1$
866
//	/**
867
//	 * <pre>
868
//	 * FORMATTER / Option to insert a new line in an empty method body
869
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_new_line_in_empty_method_body"
870
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
871
//	 *     - default:           INSERT
872
//	 * </pre>
873
//	 * @see CCorePlugin#INSERT
874
//	 * @see CCorePlugin#DO_NOT_INSERT
875
//	 */
876
//	public static final String FORMATTER_INSERT_NEW_LINE_IN_EMPTY_METHOD_BODY = CCorePlugin.PLUGIN_ID + ".formatter.insert_new_line_in_empty_method_body";	//$NON-NLS-1$
877
//	/**
878
//	 * <pre>
879
//	 * FORMATTER / Option to insert a new line in an empty type declaration
880
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_new_line_in_empty_type_declaration"
881
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
882
//	 *     - default:           INSERT
883
//	 * </pre>
884
//	 * @see CCorePlugin#INSERT
885
//	 * @see CCorePlugin#DO_NOT_INSERT
886
//	 */
887
//	public static final String FORMATTER_INSERT_NEW_LINE_IN_EMPTY_TYPE_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_new_line_in_empty_type_declaration";	//$NON-NLS-1$
888
//	/**
889
//	 * <pre>
890
//	 * FORMATTER / Option to insert a space after and in wilcard
891
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_and_in_type_parameter"
892
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
893
//	 *     - default:           INSERT
894
//	 * </pre>
895
//	 * @see CCorePlugin#INSERT
896
//	 * @see CCorePlugin#DO_NOT_INSERT
897
//	 */
898
//	public static final String FORMATTER_INSERT_SPACE_AFTER_AND_IN_TYPE_PARAMETER = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_and_in_type_parameter"; //$NON-NLS-1$
899
//	/**
900
//	 * <pre>
901
//	 * FORMATTER / Option to insert a space after an assignment operator
902
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_assignment_operator"
903
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
904
//	 *     - default:           INSERT
905
//	 * </pre>
906
//	 * @see CCorePlugin#INSERT
907
//	 * @see CCorePlugin#DO_NOT_INSERT
908
//	 */
909
//	public static final String FORMATTER_INSERT_SPACE_AFTER_ASSIGNMENT_OPERATOR = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_assignment_operator"; //$NON-NLS-1$
910
//	/**
911
//	 * <pre>
912
//	 * FORMATTER / Option to insert a space after at in annotation
913
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_at_in_annotation"
914
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
915
//	 *     - default:           INSERT
916
//	 * </pre>
917
//	 * @see CCorePlugin#INSERT
918
//	 * @see CCorePlugin#DO_NOT_INSERT
919
//	 */
920
//	public static final String FORMATTER_INSERT_SPACE_AFTER_AT_IN_ANNOTATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_at_in_annotation"; //$NON-NLS-1$
921
//	/**
922
//	 * <pre>
923
//	 * FORMATTER / Option to insert a space after at in annotation type declaration
924
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_at_in_annotation_type_declaration"
925
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
926
//	 *     - default:           DO_NOT_INSERT
927
//	 * </pre>
928
//	 * @see CCorePlugin#INSERT
929
//	 * @see CCorePlugin#DO_NOT_INSERT
930
//	 */
931
//	public static final String FORMATTER_INSERT_SPACE_AFTER_AT_IN_ANNOTATION_TYPE_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_at_in_annotation_type_declaration"; //$NON-NLS-1$
932
//	/**
933
//	 * <pre>
934
//	 * FORMATTER / Option to insert a space after a binary operator
935
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_binary_operator"
936
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
937
//	 *     - default:           INSERT
938
//	 * </pre>
939
//	 * @see CCorePlugin#INSERT
940
//	 * @see CCorePlugin#DO_NOT_INSERT
941
//	 */
942
//	public static final String FORMATTER_INSERT_SPACE_AFTER_BINARY_OPERATOR = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_binary_operator"; //$NON-NLS-1$
943
//	/**
944
//	 * <pre>
945
//	 * FORMATTER / Option to insert a space after the closing angle bracket in type arguments
946
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments"
947
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
948
//	 *     - default:           INSERT
949
//	 * </pre>
950
//	 * @see CCorePlugin#INSERT
951
//	 * @see CCorePlugin#DO_NOT_INSERT
952
//	 */
953
//	public static final String FORMATTER_INSERT_SPACE_AFTER_CLOSING_ANGLE_BRACKET_IN_TYPE_ARGUMENTS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_closing_angle_bracket_in_type_arguments"; //$NON-NLS-1$
954
//	/**
955
//	 * <pre>
956
//	 * FORMATTER / Option to insert a space after the closing angle bracket in type parameters
957
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters"
958
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
959
//	 *     - default:           INSERT
960
//	 * </pre>
961
//	 * @see CCorePlugin#INSERT
962
//	 * @see CCorePlugin#DO_NOT_INSERT
963
//	 */
964
//	public static final String FORMATTER_INSERT_SPACE_AFTER_CLOSING_ANGLE_BRACKET_IN_TYPE_PARAMETERS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_closing_angle_bracket_in_type_parameters"; //$NON-NLS-1$
965
//	/**
966
//	 * <pre>
967
//	 * FORMATTER / Option to insert a space after the closing brace of a block
968
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_closing_brace_in_block"
969
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
970
//	 *     - default:           INSERT
971
//	 * </pre>
972
//	 * @see CCorePlugin#INSERT
973
//	 * @see CCorePlugin#DO_NOT_INSERT
974
//	 */
975
//	public static final String FORMATTER_INSERT_SPACE_AFTER_CLOSING_BRACE_IN_BLOCK = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_closing_brace_in_block"; //$NON-NLS-1$
976
//	/**
977
//	 * <pre>
978
//	 * FORMATTER / Option to insert a space after the closing parenthesis of a cast expression
979
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_closing_paren_in_cast"
980
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
981
//	 *     - default:           INSERT
982
//	 * </pre>
983
//	 * @see CCorePlugin#INSERT
984
//	 * @see CCorePlugin#DO_NOT_INSERT
985
//	 */
986
//	public static final String FORMATTER_INSERT_SPACE_AFTER_CLOSING_PAREN_IN_CAST = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_closing_paren_in_cast"; //$NON-NLS-1$
987
//	/**
988
//	 * <pre>
989
//	 * FORMATTER / Option to insert a space after the colon in an assert statement
990
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_colon_in_assert"
991
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
992
//	 *     - default:           INSERT
993
//	 * </pre>
994
//	 * @see CCorePlugin#INSERT
995
//	 * @see CCorePlugin#DO_NOT_INSERT
996
//	 */
997
//	public static final String FORMATTER_INSERT_SPACE_AFTER_COLON_IN_ASSERT = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_colon_in_assert"; //$NON-NLS-1$
998
//	/**
999
//	 * <pre>
1000
//	 * FORMATTER / Option to insert a space after colon in a case statement when a opening brace follows the colon
1001
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_colon_in_case"
1002
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1003
//	 *     - default:           INSERT
1004
//	 * </pre>
1005
//	 * @see CCorePlugin#INSERT
1006
//	 * @see CCorePlugin#DO_NOT_INSERT
1007
//	 */
1008
//	public static final String FORMATTER_INSERT_SPACE_AFTER_COLON_IN_CASE = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_colon_in_case";	//$NON-NLS-1$
1009
//	/**
1010
//	 * <pre>
1011
//	 * FORMATTER / Option to insert a space after the colon in a conditional expression
1012
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_colon_in_conditional"
1013
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1014
//	 *     - default:           INSERT
1015
//	 * </pre>
1016
//	 * @see CCorePlugin#INSERT
1017
//	 * @see CCorePlugin#DO_NOT_INSERT
1018
//	 */
1019
//	public static final String FORMATTER_INSERT_SPACE_AFTER_COLON_IN_CONDITIONAL = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_colon_in_conditional"; //$NON-NLS-1$
1020
//	/**
1021
//	 * <pre>
1022
//	 * FORMATTER / Option to insert a space after colon in a for statement
1023
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_colon_in_for"
1024
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1025
//	 *     - default:           INSERT
1026
//	 * </pre>
1027
//	 * @see CCorePlugin#INSERT
1028
//	 * @see CCorePlugin#DO_NOT_INSERT
1029
//	 */
1030
//	public static final String FORMATTER_INSERT_SPACE_AFTER_COLON_IN_FOR = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_colon_in_for";	//$NON-NLS-1$
1031
//	/**
1032
//	 * <pre>
1033
//	 * FORMATTER / Option to insert a space after the colon in a labeled statement
1034
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_colon_in_labeled_statement"
1035
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1036
//	 *     - default:           INSERT
1037
//	 * </pre>
1038
//	 * @see CCorePlugin#INSERT
1039
//	 * @see CCorePlugin#DO_NOT_INSERT
1040
//	 */
1041
//	public static final String FORMATTER_INSERT_SPACE_AFTER_COLON_IN_LABELED_STATEMENT = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_colon_in_labeled_statement"; //$NON-NLS-1$
1042
//	/**
1043
//	 * <pre>
1044
//	 * FORMATTER / Option to insert a space after the comma in an allocation expression
1045
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_comma_in_allocation_expression"
1046
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1047
//	 *     - default:           INSERT
1048
//	 * </pre>
1049
//	 * @see CCorePlugin#INSERT
1050
//	 * @see CCorePlugin#DO_NOT_INSERT
1051
//	 */
1052
//	public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ALLOCATION_EXPRESSION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_comma_in_allocation_expression"; //$NON-NLS-1$
1053
//	/**
1054
//	 * <pre>
1055
//	 * FORMATTER / Option to insert a space after the comma in annotation
1056
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_comma_in_annotation"
1057
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1058
//	 *     - default:           INSERT
1059
//	 * </pre>
1060
//	 * @see CCorePlugin#INSERT
1061
//	 * @see CCorePlugin#DO_NOT_INSERT
1062
//	 */
1063
//	public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ANNOTATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_comma_in_annotation"; //$NON-NLS-1$
1064
//	/**
1065
//	 * <pre>
1066
//	 * FORMATTER / Option to insert a space after the comma in an array initializer
1067
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_comma_in_array_initializer"
1068
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1069
//	 *     - default:           INSERT
1070
//	 * </pre>
1071
//	 * @see CCorePlugin#INSERT
1072
//	 * @see CCorePlugin#DO_NOT_INSERT
1073
//	 */
1074
//	public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ARRAY_INITIALIZER = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_comma_in_array_initializer"; //$NON-NLS-1$
1075
//	/**
1076
//	 * <pre>
1077
//	 * FORMATTER / Option to insert a space after the comma in the parameters of a constructor declaration
1078
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters"
1079
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1080
//	 *     - default:           INSERT
1081
//	 * </pre>
1082
//	 * @see CCorePlugin#INSERT
1083
//	 * @see CCorePlugin#DO_NOT_INSERT
1084
//	 */
1085
//	public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_CONSTRUCTOR_DECLARATION_PARAMETERS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_comma_in_constructor_declaration_parameters"; //$NON-NLS-1$
1086
//	/**
1087
//	 * <pre>
1088
//	 * FORMATTER / Option to insert a space after the comma in the exception names in a throws clause of a constructor declaration
1089
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws"
1090
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1091
//	 *     - default:           INSERT
1092
//	 * </pre>
1093
//	 * @see CCorePlugin#INSERT
1094
//	 * @see CCorePlugin#DO_NOT_INSERT
1095
//	 */
1096
//	public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_CONSTRUCTOR_DECLARATION_THROWS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_comma_in_constructor_declaration_throws"; //$NON-NLS-1$
1097
//	/**
1098
//	 * <pre>
1099
//	 * FORMATTER / Option to insert a space after the comma in the arguments of an enum constant
1100
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments"
1101
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1102
//	 *     - default:           INSERT
1103
//	 * </pre>
1104
//	 * @see CCorePlugin#INSERT
1105
//	 * @see CCorePlugin#DO_NOT_INSERT
1106
//	 */
1107
//	public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ENUM_CONSTANT_ARGUMENTS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_comma_in_enum_constant_arguments"; //$NON-NLS-1$
1108
//	/**
1109
//	 * <pre>
1110
//	 * FORMATTER / Option to insert a space after the comma in enum declarations
1111
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_comma_in_enum_declarations"
1112
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1113
//	 *     - default:           INSERT
1114
//	 * </pre>
1115
//	 * @see CCorePlugin#INSERT
1116
//	 * @see CCorePlugin#DO_NOT_INSERT
1117
//	 */
1118
//	public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ENUM_DECLARATIONS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_comma_in_enum_declarations"; //$NON-NLS-1$
1119
//	/**
1120
//	 * <pre>
1121
//	 * FORMATTER / Option to insert a space after the comma in the arguments of an explicit constructor call
1122
//	 *     - option id:         "org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments"
1123
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1124
//	 *     - default:           INSERT
1125
//	 * </pre>
1126
//	 * @see CCorePlugin#INSERT
1127
//	 * @see CCorePlugin#DO_NOT_INSERT
1128
//	 */
1129
//	public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_EXPLICIT_CONSTRUCTOR_CALL_ARGUMENTS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_comma_in_explicitconstructorcall_arguments"; //$NON-NLS-1$
1130
//	/**
1131
//	 * <pre>
1132
//	 * FORMATTER / Option to insert a space after the comma in the increments of a for statement
1133
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_comma_in_for_increments"
1134
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1135
//	 *     - default:           INSERT
1136
//	 * </pre>
1137
//	 * @see CCorePlugin#INSERT
1138
//	 * @see CCorePlugin#DO_NOT_INSERT
1139
//	 */
1140
//	public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_FOR_INCREMENTS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_comma_in_for_increments"; //$NON-NLS-1$
1141
//	/**
1142
//	 * <pre>
1143
//	 * FORMATTER / Option to insert a space after the comma in the initializations of a for statement
1144
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_comma_in_for_inits"
1145
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1146
//	 *     - default:           INSERT
1147
//	 * </pre>
1148
//	 * @see CCorePlugin#INSERT
1149
//	 * @see CCorePlugin#DO_NOT_INSERT
1150
//	 */
1151
//	public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_FOR_INITS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_comma_in_for_inits"; //$NON-NLS-1$
1152
//	/**
1153
//	 * <pre>
1154
//	 * FORMATTER / Option to insert a space after the comma in the parameters of a method declaration
1155
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters"
1156
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1157
//	 *     - default:           INSERT
1158
//	 * </pre>
1159
//	 * @see CCorePlugin#INSERT
1160
//	 * @see CCorePlugin#DO_NOT_INSERT
1161
//	 */
1162
//	public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_METHOD_DECLARATION_PARAMETERS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_comma_in_method_declaration_parameters"; //$NON-NLS-1$
1163
//	/**
1164
//	 * <pre>
1165
//	 * FORMATTER / Option to insert a space after the comma in the exception names in a throws clause of a method declaration
1166
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_comma_in_method_declaration_throws"
1167
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1168
//	 *     - default:           INSERT
1169
//	 * </pre>
1170
//	 * @see CCorePlugin#INSERT
1171
//	 * @see CCorePlugin#DO_NOT_INSERT
1172
//	 */
1173
//	public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_METHOD_DECLARATION_THROWS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_comma_in_method_declaration_throws"; //$NON-NLS-1$
1174
//	/**
1175
//	 * <pre>
1176
//	 * FORMATTER / Option to insert a space after the comma in the arguments of a method invocation
1177
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments"
1178
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1179
//	 *     - default:           INSERT
1180
//	 * </pre>
1181
//	 * @see CCorePlugin#INSERT
1182
//	 * @see CCorePlugin#DO_NOT_INSERT
1183
//	 */
1184
//	public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_METHOD_INVOCATION_ARGUMENTS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_comma_in_method_invocation_arguments"; //$NON-NLS-1$
1185
//	/**
1186
//	 * <pre>
1187
//	 * FORMATTER / Option to insert a space after the comma in multiple field declaration
1188
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations"
1189
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1190
//	 *     - default:           INSERT
1191
//	 * </pre>
1192
//	 * @see CCorePlugin#INSERT
1193
//	 * @see CCorePlugin#DO_NOT_INSERT
1194
//	 */
1195
//	public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_MULTIPLE_FIELD_DECLARATIONS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_comma_in_multiple_field_declarations"; //$NON-NLS-1$
1196
//	/**
1197
//	 * <pre>
1198
//	 * FORMATTER / Option to insert a space after the comma in multiple local declaration
1199
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations"
1200
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1201
//	 *     - default:           INSERT
1202
//	 * </pre>
1203
//	 * @see CCorePlugin#INSERT
1204
//	 * @see CCorePlugin#DO_NOT_INSERT
1205
//	 */
1206
//	public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_MULTIPLE_LOCAL_DECLARATIONS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_comma_in_multiple_local_declarations"; //$NON-NLS-1$
1207
//	/**
1208
//	 * <pre>
1209
//	 * FORMATTER / Option to insert a space after the comma in parameterized type reference
1210
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference"
1211
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1212
//	 *     - default:           INSERT
1213
//	 * </pre>
1214
//	 * @see CCorePlugin#INSERT
1215
//	 * @see CCorePlugin#DO_NOT_INSERT
1216
//	 */
1217
//	public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_PARAMETERIZED_TYPE_REFERENCE = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_comma_in_parameterized_type_reference"; //$NON-NLS-1$
1218
//	/**
1219
//	 * <pre>
1220
//	 * FORMATTER / Option to insert a space after the comma in superinterfaces names of a type header
1221
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_comma_in_superinterfaces"
1222
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1223
//	 *     - default:           INSERT
1224
//	 * </pre>
1225
//	 * @see CCorePlugin#INSERT
1226
//	 * @see CCorePlugin#DO_NOT_INSERT
1227
//	 */
1228
//	public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_SUPERINTERFACES = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_comma_in_superinterfaces"; //$NON-NLS-1$
1229
//	/**
1230
//	 * <pre>
1231
//	 * FORMATTER / Option to insert a space after the comma in type arguments
1232
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_comma_in_type_arguments"
1233
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1234
//	 *     - default:           INSERT
1235
//	 * </pre>
1236
//	 * @see CCorePlugin#INSERT
1237
//	 * @see CCorePlugin#DO_NOT_INSERT
1238
//	 */
1239
//	public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_TYPE_ARGUMENTS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_comma_in_type_arguments"; //$NON-NLS-1$
1240
//	/**
1241
//	 * <pre>
1242
//	 * FORMATTER / Option to insert a space after the comma in type parameters
1243
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_comma_in_type_parameters"
1244
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1245
//	 *     - default:           INSERT
1246
//	 * </pre>
1247
//	 * @see CCorePlugin#INSERT
1248
//	 * @see CCorePlugin#DO_NOT_INSERT
1249
//	 */
1250
//	public static final String FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_TYPE_PARAMETERS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_comma_in_type_parameters"; //$NON-NLS-1$
1251
//	/**
1252
//	 * <pre>
1253
//	 * FORMATTER / Option to insert a space after ellipsis
1254
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_ellipsis"
1255
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1256
//	 *     - default:           INSERT
1257
//	 * </pre>
1258
//	 * @see CCorePlugin#INSERT
1259
//	 * @see CCorePlugin#DO_NOT_INSERT
1260
//	 */
1261
//	public static final String FORMATTER_INSERT_SPACE_AFTER_ELLIPSIS  = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_ellipsis";	//$NON-NLS-1$
1262
//	/**
1263
//	 * <pre>
1264
//	 * FORMATTER / Option to insert a space after the opening angle bracket in parameterized type reference
1265
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference"
1266
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1267
//	 *     - default:           DO_NOT_INSERT
1268
//	 * </pre>
1269
//	 * @see CCorePlugin#INSERT
1270
//	 * @see CCorePlugin#DO_NOT_INSERT
1271
//	 */
1272
//	public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_ANGLE_BRACKET_IN_PARAMETERIZED_TYPE_REFERENCE = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference";//$NON-NLS-1$
1273
//	/**
1274
//	 * <pre>
1275
//	 * FORMATTER / Option to insert a space after the opening angle bracket in type arguments
1276
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments"
1277
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1278
//	 *     - default:           DO_NOT_INSERT
1279
//	 * </pre>
1280
//	 * @see CCorePlugin#INSERT
1281
//	 * @see CCorePlugin#DO_NOT_INSERT
1282
//	 */
1283
//	public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_ANGLE_BRACKET_IN_TYPE_ARGUMENTS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_opening_angle_bracket_in_type_arguments";//$NON-NLS-1$
1284
//	/**
1285
//	 * <pre>
1286
//	 * FORMATTER / Option to insert a space after the opening angle bracket in type parameters
1287
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters"
1288
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1289
//	 *     - default:           DO_NOT_INSERT
1290
//	 * </pre>
1291
//	 * @see CCorePlugin#INSERT
1292
//	 * @see CCorePlugin#DO_NOT_INSERT
1293
//	 */
1294
//	public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_ANGLE_BRACKET_IN_TYPE_PARAMETERS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_opening_angle_bracket_in_type_parameters";//$NON-NLS-1$
1295
//	/**
1296
//	 * <pre>
1297
//	 * FORMATTER / Option to insert a space after the opening brace in an array initializer
1298
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_opening_brace_in_array_initializer"
1299
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1300
//	 *     - default:           DO_NOT_INSERT
1301
//	 * </pre>
1302
//	 * @see CCorePlugin#INSERT
1303
//	 * @see CCorePlugin#DO_NOT_INSERT
1304
//	 */
1305
//	public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACE_IN_ARRAY_INITIALIZER = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_opening_brace_in_array_initializer";	//$NON-NLS-1$
1306
//	/**
1307
//	 * <pre>
1308
//	 * FORMATTER / Option to insert a space after the opening bracket inside an array allocation expression
1309
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression"
1310
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1311
//	 *     - default:           DO_NOT_INSERT
1312
//	 * </pre>
1313
//	 * @see CCorePlugin#INSERT
1314
//	 * @see CCorePlugin#DO_NOT_INSERT
1315
//	 */
1316
//	public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACKET_IN_ARRAY_ALLOCATION_EXPRESSION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_opening_bracket_in_array_allocation_expression";//$NON-NLS-1$
1317
//	/**
1318
//	 * <pre>
1319
//	 * FORMATTER / Option to insert a space after the opening bracket inside an array reference
1320
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_opening_bracket_in_array_reference"
1321
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1322
//	 *     - default:           DO_NOT_INSERT
1323
//	 * </pre>
1324
//	 * @see CCorePlugin#INSERT
1325
//	 * @see CCorePlugin#DO_NOT_INSERT
1326
//	 */
1327
//	public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACKET_IN_ARRAY_REFERENCE = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_opening_bracket_in_array_reference";//$NON-NLS-1$
1328
//	/**
1329
//	 * <pre>
1330
//	 * FORMATTER / Option to insert a space after the opening parenthesis in annotation
1331
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_annotation"
1332
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1333
//	 *     - default:           DO_NOT_INSERT
1334
//	 * </pre>
1335
//	 * @see CCorePlugin#INSERT
1336
//	 * @see CCorePlugin#DO_NOT_INSERT
1337
//	 */
1338
//	public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_ANNOTATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_opening_paren_in_annotation"; //$NON-NLS-1$
1339
//	/**
1340
//	 * <pre>
1341
//	 * FORMATTER / Option to insert a space after the opening parenthesis in a cast expression
1342
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_cast"
1343
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1344
//	 *     - default:           DO_NOT_INSERT
1345
//	 * </pre>
1346
//	 * @see CCorePlugin#INSERT
1347
//	 * @see CCorePlugin#DO_NOT_INSERT
1348
//	 */
1349
//	public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_CAST = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_opening_paren_in_cast"; //$NON-NLS-1$
1350
//	/**
1351
//	 * <pre>
1352
//	 * FORMATTER / Option to insert a space after the opening parenthesis in a catch
1353
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_catch"
1354
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1355
//	 *     - default:           DO_NOT_INSERT
1356
//	 * </pre>
1357
//	 * @see CCorePlugin#INSERT
1358
//	 * @see CCorePlugin#DO_NOT_INSERT
1359
//	 */
1360
//	public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_CATCH = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_opening_paren_in_catch"; //$NON-NLS-1$
1361
//	/**
1362
//	 * <pre>
1363
//	 * FORMATTER / Option to insert a space after the opening parenthesis in a constructor declaration
1364
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration"
1365
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1366
//	 *     - default:           DO_NOT_INSERT
1367
//	 * </pre>
1368
//	 * @see CCorePlugin#INSERT
1369
//	 * @see CCorePlugin#DO_NOT_INSERT
1370
//	 */
1371
//	public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_CONSTRUCTOR_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_opening_paren_in_constructor_declaration";	//$NON-NLS-1$
1372
//	/**
1373
//	 * <pre>
1374
//	 * FORMATTER / Option to insert a space after the opening parenthesis in enum constant
1375
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_enum_constant"
1376
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1377
//	 *     - default:           DO_NOT_INSERT
1378
//	 * </pre>
1379
//	 * @see CCorePlugin#INSERT
1380
//	 * @see CCorePlugin#DO_NOT_INSERT
1381
//	 */
1382
//	public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_ENUM_CONSTANT = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_opening_paren_in_enum_constant"; //$NON-NLS-1$
1383
//	/**
1384
//	 * <pre>
1385
//	 * FORMATTER / Option to insert a space after the opening parenthesis in a for statement
1386
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_for"
1387
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1388
//	 *     - default:           DO_NOT_INSERT
1389
//	 * </pre>
1390
//	 * @see CCorePlugin#INSERT
1391
//	 * @see CCorePlugin#DO_NOT_INSERT
1392
//	 */
1393
//	public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_FOR = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_opening_paren_in_for"; //$NON-NLS-1$
1394
//	/**
1395
//	 * <pre>
1396
//	 * FORMATTER / Option to insert a space after the opening parenthesis in an if statement
1397
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_if"
1398
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1399
//	 *     - default:           DO_NOT_INSERT
1400
//	 * </pre>
1401
//	 * @see CCorePlugin#INSERT
1402
//	 * @see CCorePlugin#DO_NOT_INSERT
1403
//	 */
1404
//	public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_IF = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_opening_paren_in_if"; //$NON-NLS-1$
1405
//	/**
1406
//	 * <pre>
1407
//	 * FORMATTER / Option to insert a space after the opening parenthesis in a method declaration
1408
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_method_declaration"
1409
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1410
//	 *     - default:           DO_NOT_INSERT
1411
//	 * </pre>
1412
//	 * @see CCorePlugin#INSERT
1413
//	 * @see CCorePlugin#DO_NOT_INSERT
1414
//	 */
1415
//	public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_METHOD_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_opening_paren_in_method_declaration";	//$NON-NLS-1$
1416
//	/**
1417
//	 * <pre>
1418
//	 * FORMATTER / Option to insert a space after the opening parenthesis in a method invocation
1419
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_method_invocation"
1420
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1421
//	 *     - default:           DO_NOT_INSERT
1422
//	 * </pre>
1423
//	 * @see CCorePlugin#INSERT
1424
//	 * @see CCorePlugin#DO_NOT_INSERT
1425
//	 */
1426
//	public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_METHOD_INVOCATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_opening_paren_in_method_invocation"; //$NON-NLS-1$
1427
//	/**
1428
//	 * <pre>
1429
//	 * FORMATTER / Option to insert a space after the opening parenthesis in a parenthesized expression
1430
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression"
1431
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1432
//	 *     - default:           DO_NOT_INSERT
1433
//	 * </pre>
1434
//	 * @see CCorePlugin#INSERT
1435
//	 * @see CCorePlugin#DO_NOT_INSERT
1436
//	 */
1437
//	public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_PARENTHESIZED_EXPRESSION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_opening_paren_in_parenthesized_expression"; //$NON-NLS-1$
1438
//	/**
1439
//	 * <pre>
1440
//	 * FORMATTER / Option to insert a space after the opening parenthesis in a switch statement
1441
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_switch"
1442
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1443
//	 *     - default:           DO_NOT_INSERT
1444
//	 * </pre>
1445
//	 * @see CCorePlugin#INSERT
1446
//	 * @see CCorePlugin#DO_NOT_INSERT
1447
//	 */
1448
//	public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_SWITCH = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_opening_paren_in_switch"; //$NON-NLS-1$
1449
//	/**
1450
//	 * <pre>
1451
//	 * FORMATTER / Option to insert a space after the opening parenthesis in a synchronized statement
1452
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_synchronized"
1453
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1454
//	 *     - default:           DO_NOT_INSERT
1455
//	 * </pre>
1456
//	 * @see CCorePlugin#INSERT
1457
//	 * @see CCorePlugin#DO_NOT_INSERT
1458
//	 */
1459
//	public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_SYNCHRONIZED = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_opening_paren_in_synchronized"; //$NON-NLS-1$
1460
//	/**
1461
//	 * <pre>
1462
//	 * FORMATTER / Option to insert a space after the opening parenthesis in a while statement
1463
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_while"
1464
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1465
//	 *     - default:           DO_NOT_INSERT
1466
//	 * </pre>
1467
//	 * @see CCorePlugin#INSERT
1468
//	 * @see CCorePlugin#DO_NOT_INSERT
1469
//	 */
1470
//	public static final String FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_WHILE = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_opening_paren_in_while"; //$NON-NLS-1$
1471
//	/**
1472
//	 * <pre>
1473
//	 * FORMATTER / Option to insert a space after a postfix operator
1474
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_postfix_operator"
1475
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1476
//	 *     - default:           DO_NOT_INSERT
1477
//	 * </pre>
1478
//	 * @see CCorePlugin#INSERT
1479
//	 * @see CCorePlugin#DO_NOT_INSERT
1480
//	 */
1481
//	public static final String FORMATTER_INSERT_SPACE_AFTER_POSTFIX_OPERATOR = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_postfix_operator"; //$NON-NLS-1$
1482
//	/**
1483
//	 * <pre>
1484
//	 * FORMATTER / Option to insert a space after a prefix operator
1485
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_prefix_operator"
1486
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1487
//	 *     - default:           DO_NOT_INSERT
1488
//	 * </pre>
1489
//	 * @see CCorePlugin#INSERT
1490
//	 * @see CCorePlugin#DO_NOT_INSERT
1491
//	 */
1492
//	public static final String FORMATTER_INSERT_SPACE_AFTER_PREFIX_OPERATOR = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_prefix_operator"; //$NON-NLS-1$
1493
//	/**
1494
//	 * <pre>
1495
//	 * FORMATTER / Option to insert a space after question mark in a conditional expression
1496
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_question_in_conditional"
1497
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1498
//	 *     - default:           DO_NOT_INSERT
1499
//	 * </pre>
1500
//	 * @see CCorePlugin#INSERT
1501
//	 * @see CCorePlugin#DO_NOT_INSERT
1502
//	 */
1503
//	public static final String FORMATTER_INSERT_SPACE_AFTER_QUESTION_IN_CONDITIONAL = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_question_in_conditional"; //$NON-NLS-1$
1504
//	/**
1505
//	 * <pre>
1506
//	 * FORMATTER / Option to insert a space after question mark in a wildcard
1507
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_question_in_wildcard"
1508
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1509
//	 *     - default:           DO_NOT_INSERT
1510
//	 * </pre>
1511
//	 * @see CCorePlugin#INSERT
1512
//	 * @see CCorePlugin#DO_NOT_INSERT
1513
//	 */
1514
//	public static final String FORMATTER_INSERT_SPACE_AFTER_QUESTION_IN_WILDCARD = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_question_in_wildcard"; //$NON-NLS-1$
1515
//	/**
1516
//	 * <pre>
1517
//	 * FORMATTER / Option to insert a space after semicolon in a for statement
1518
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_semicolon_in_for"
1519
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1520
//	 *     - default:           INSERT
1521
//	 * </pre>
1522
//	 * @see CCorePlugin#INSERT
1523
//	 * @see CCorePlugin#DO_NOT_INSERT
1524
//	 */
1525
//	public static final String FORMATTER_INSERT_SPACE_AFTER_SEMICOLON_IN_FOR = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_semicolon_in_for"; //$NON-NLS-1$
1526
//	/**
1527
//	 * <pre>
1528
//	 * FORMATTER / Option to insert a space after an unary operator
1529
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_after_unary_operator"
1530
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1531
//	 *     - default:           DO_NOT_INSERT
1532
//	 * </pre>
1533
//	 * @see CCorePlugin#INSERT
1534
//	 * @see CCorePlugin#DO_NOT_INSERT
1535
//	 */
1536
//	public static final String FORMATTER_INSERT_SPACE_AFTER_UNARY_OPERATOR = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_after_unary_operator"; //$NON-NLS-1$
1537
//	/**
1538
//	 * <pre>
1539
//	 * FORMATTER / Option to insert a space before and in wildcard
1540
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_and_in_type_parameter"
1541
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1542
//	 *     - default:           INSERT
1543
//	 * </pre>
1544
//	 * @see CCorePlugin#INSERT
1545
//	 * @see CCorePlugin#DO_NOT_INSERT
1546
//	 */
1547
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_AND_IN_TYPE_PARAMETER = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_and_in_type_parameter";	//$NON-NLS-1$
1548
//	/**
1549
//	 * <pre>
1550
//	 * FORMATTER / Option to insert a space before an assignment operator
1551
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_assignment_operator"
1552
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1553
//	 *     - default:           INSERT
1554
//	 * </pre>
1555
//	 * @see CCorePlugin#INSERT
1556
//	 * @see CCorePlugin#DO_NOT_INSERT
1557
//	 */
1558
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_ASSIGNMENT_OPERATOR = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_assignment_operator";	//$NON-NLS-1$
1559
//	/**
1560
//	 * <pre>
1561
//	 * FORMATTER / Option to insert a space before at in annotation type declaration
1562
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_at_in_annotation_type_declaration"
1563
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1564
//	 *     - default:           INSERT
1565
//	 * </pre>
1566
//	 * @see CCorePlugin#INSERT
1567
//	 * @see CCorePlugin#DO_NOT_INSERT
1568
//	 */
1569
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_AT_IN_ANNOTATION_TYPE_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_at_in_annotation_type_declaration";	//$NON-NLS-1$
1570
//	/**
1571
//	 * <pre>
1572
//	 * FORMATTER / Option to insert a space before an binary operator
1573
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_binary_operator"
1574
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1575
//	 *     - default:           DO_NOT_INSERT
1576
//	 * </pre>
1577
//	 * @see CCorePlugin#INSERT
1578
//	 * @see CCorePlugin#DO_NOT_INSERT
1579
//	 */
1580
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_BINARY_OPERATOR = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_binary_operator";	//$NON-NLS-1$
1581
//	/**
1582
//	 * <pre>
1583
//	 * FORMATTER / Option to insert a space before the closing angle bracket in parameterized type reference
1584
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference"
1585
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1586
//	 *     - default:           DO_NOT_INSERT
1587
//	 * </pre>
1588
//	 * @see CCorePlugin#INSERT
1589
//	 * @see CCorePlugin#DO_NOT_INSERT
1590
//	 */
1591
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_ANGLE_BRACKET_IN_PARAMETERIZED_TYPE_REFERENCE = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference";		//$NON-NLS-1$
1592
//	/**
1593
//	 * <pre>
1594
//	 * FORMATTER / Option to insert a space before the closing angle bracket in type arguments
1595
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments"
1596
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1597
//	 *     - default:           DO_NOT_INSERT
1598
//	 * </pre>
1599
//	 * @see CCorePlugin#INSERT
1600
//	 * @see CCorePlugin#DO_NOT_INSERT
1601
//	 */
1602
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_ANGLE_BRACKET_IN_TYPE_ARGUMENTS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_closing_angle_bracket_in_type_arguments";		//$NON-NLS-1$
1603
//	/**
1604
//	 * <pre>
1605
//	 * FORMATTER / Option to insert a space before the closing angle bracket in type parameters
1606
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters"
1607
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1608
//	 *     - default:           DO_NOT_INSERT
1609
//	 * </pre>
1610
//	 * @see CCorePlugin#INSERT
1611
//	 * @see CCorePlugin#DO_NOT_INSERT
1612
//	 */
1613
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_ANGLE_BRACKET_IN_TYPE_PARAMETERS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_closing_angle_bracket_in_type_parameters";		//$NON-NLS-1$
1614
//	/**
1615
//	 * <pre>
1616
//	 * FORMATTER / Option to insert a space before the closing brace in an array initializer
1617
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_closing_brace_in_array_initializer"
1618
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1619
//	 *     - default:           DO_NOT_INSERT
1620
//	 * </pre>
1621
//	 * @see CCorePlugin#INSERT
1622
//	 * @see CCorePlugin#DO_NOT_INSERT
1623
//	 */
1624
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_BRACE_IN_ARRAY_INITIALIZER = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_closing_brace_in_array_initializer";		//$NON-NLS-1$
1625
//	/**
1626
//	 * <pre>
1627
//	 * FORMATTER / Option to insert a space before the closing bracket in an array allocation expression
1628
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression"
1629
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1630
//	 *     - default:           DO_NOT_INSERT
1631
//	 * </pre>
1632
//	 * @see CCorePlugin#INSERT
1633
//	 * @see CCorePlugin#DO_NOT_INSERT
1634
//	 */
1635
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_BRACKET_IN_ARRAY_ALLOCATION_EXPRESSION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_closing_bracket_in_array_allocation_expression";//$NON-NLS-1$
1636
//	/**
1637
//	 * <pre>
1638
//	 * FORMATTER / Option to insert a space before the closing bracket in an array reference
1639
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_closing_bracket_in_array_reference"
1640
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1641
//	 *     - default:           DO_NOT_INSERT
1642
//	 * </pre>
1643
//	 * @see CCorePlugin#INSERT
1644
//	 * @see CCorePlugin#DO_NOT_INSERT
1645
//	 */
1646
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_BRACKET_IN_ARRAY_REFERENCE = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_closing_bracket_in_array_reference";//$NON-NLS-1$
1647
//	/**
1648
//	 * <pre>
1649
//	 * FORMATTER / Option to insert a space before the closing parenthesis in annotation
1650
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_annotation"
1651
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1652
//	 *     - default:           DO_NOT_INSERT
1653
//	 * </pre>
1654
//	 * @see CCorePlugin#INSERT
1655
//	 * @see CCorePlugin#DO_NOT_INSERT
1656
//	 */
1657
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_ANNOTATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_closing_paren_in_annotation";	//$NON-NLS-1$
1658
//	/**
1659
//	 * <pre>
1660
//	 * FORMATTER / Option to insert a space before the closing parenthesis in a cast expression
1661
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_cast"
1662
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1663
//	 *     - default:           DO_NOT_INSERT
1664
//	 * </pre>
1665
//	 * @see CCorePlugin#INSERT
1666
//	 * @see CCorePlugin#DO_NOT_INSERT
1667
//	 */
1668
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_CAST = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_closing_paren_in_cast";	//$NON-NLS-1$
1669
//	/**
1670
//	 * <pre>
1671
//	 * FORMATTER / Option to insert a space before the closing parenthesis in a catch
1672
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_catch"
1673
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1674
//	 *     - default:           DO_NOT_INSERT
1675
//	 * </pre>
1676
//	 * @see CCorePlugin#INSERT
1677
//	 * @see CCorePlugin#DO_NOT_INSERT
1678
//	 */
1679
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_CATCH = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_closing_paren_in_catch";	//$NON-NLS-1$
1680
//	/**
1681
//	 * <pre>
1682
//	 * FORMATTER / Option to insert a space before the closing parenthesis in a constructor declaration
1683
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration"
1684
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1685
//	 *     - default:           DO_NOT_INSERT
1686
//	 * </pre>
1687
//	 * @see CCorePlugin#INSERT
1688
//	 * @see CCorePlugin#DO_NOT_INSERT
1689
//	 */
1690
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_CONSTRUCTOR_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_closing_paren_in_constructor_declaration";	//$NON-NLS-1$
1691
//	/**
1692
//	 * <pre>
1693
//	 * FORMATTER / Option to insert a space before the closing parenthesis in enum constant
1694
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_enum_constant"
1695
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1696
//	 *     - default:           DO_NOT_INSERT
1697
//	 * </pre>
1698
//	 * @see CCorePlugin#INSERT
1699
//	 * @see CCorePlugin#DO_NOT_INSERT
1700
//	 */
1701
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_ENUM_CONSTANT = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_closing_paren_in_enum_constant";	//$NON-NLS-1$
1702
//	/**
1703
//	 * <pre>
1704
//	 * FORMATTER / Option to insert a space before the closing parenthesis in a for statement
1705
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_for"
1706
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1707
//	 *     - default:           DO_NOT_INSERT
1708
//	 * </pre>
1709
//	 * @see CCorePlugin#INSERT
1710
//	 * @see CCorePlugin#DO_NOT_INSERT
1711
//	 */
1712
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_FOR = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_closing_paren_in_for";	//$NON-NLS-1$
1713
//	/**
1714
//	 * <pre>
1715
//	 * FORMATTER / Option to insert a space before the closing parenthesis in an if statement
1716
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_if"
1717
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1718
//	 *     - default:           DO_NOT_INSERT
1719
//	 * </pre>
1720
//	 * @see CCorePlugin#INSERT
1721
//	 * @see CCorePlugin#DO_NOT_INSERT
1722
//	 */
1723
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_IF = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_closing_paren_in_if";	//$NON-NLS-1$
1724
//	/**
1725
//	 * <pre>
1726
//	 * FORMATTER / Option to insert a space before the closing parenthesis in a method declaration
1727
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_method_declaration"
1728
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1729
//	 *     - default:           DO_NOT_INSERT
1730
//	 * </pre>
1731
//	 * @see CCorePlugin#INSERT
1732
//	 * @see CCorePlugin#DO_NOT_INSERT
1733
//	 */
1734
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_METHOD_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_closing_paren_in_method_declaration";	//$NON-NLS-1$
1735
//	/**
1736
//	 * <pre>
1737
//	 * FORMATTER / Option to insert a space before the closing parenthesis in a method invocation
1738
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_method_invocation"
1739
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1740
//	 *     - default:           DO_NOT_INSERT
1741
//	 * </pre>
1742
//	 * @see CCorePlugin#INSERT
1743
//	 * @see CCorePlugin#DO_NOT_INSERT
1744
//	 */
1745
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_METHOD_INVOCATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_closing_paren_in_method_invocation"; //$NON-NLS-1$
1746
//	/**
1747
//	 * <pre>
1748
//	 * FORMATTER / Option to insert a space before the closing parenthesis in a parenthesized expression
1749
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression"
1750
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1751
//	 *     - default:           DO_NOT_INSERT
1752
//	 * </pre>
1753
//	 * @see CCorePlugin#INSERT
1754
//	 * @see CCorePlugin#DO_NOT_INSERT
1755
//	 */
1756
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_PARENTHESIZED_EXPRESSION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_closing_paren_in_parenthesized_expression"; //$NON-NLS-1$
1757
//	/**
1758
//	 * <pre>
1759
//	 * FORMATTER / Option to insert a space before the closing parenthesis in a switch statement
1760
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_switch"
1761
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1762
//	 *     - default:           DO_NOT_INSERT
1763
//	 * </pre>
1764
//	 * @see CCorePlugin#INSERT
1765
//	 * @see CCorePlugin#DO_NOT_INSERT
1766
//	 */
1767
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_SWITCH = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_closing_paren_in_switch";	//$NON-NLS-1$
1768
//	/**
1769
//	 * <pre>
1770
//	 * FORMATTER / Option to insert a space before the closing parenthesis in a synchronized statement
1771
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_synchronized"
1772
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1773
//	 *     - default:           DO_NOT_INSERT
1774
//	 * </pre>
1775
//	 * @see CCorePlugin#INSERT
1776
//	 * @see CCorePlugin#DO_NOT_INSERT
1777
//	 */
1778
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_SYNCHRONIZED = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_closing_paren_in_synchronized";	//$NON-NLS-1$
1779
//	/**
1780
//	 * <pre>
1781
//	 * FORMATTER / Option to insert a space before the closing parenthesis in a while statement
1782
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_while"
1783
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1784
//	 *     - default:           DO_NOT_INSERT
1785
//	 * </pre>
1786
//	 * @see CCorePlugin#INSERT
1787
//	 * @see CCorePlugin#DO_NOT_INSERT
1788
//	 */
1789
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_WHILE = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_closing_paren_in_while";	//$NON-NLS-1$
1790
//	/**
1791
//	 * <pre>
1792
//	 * FORMATTER / Option to insert a space before colon in an assert statement
1793
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_colon_in_assert"
1794
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1795
//	 *     - default:           INSERT
1796
//	 * </pre>
1797
//	 * @see CCorePlugin#INSERT
1798
//	 * @see CCorePlugin#DO_NOT_INSERT
1799
//	 */
1800
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_ASSERT = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_colon_in_assert";	//$NON-NLS-1$
1801
//	/**
1802
//	 * <pre>
1803
//	 * FORMATTER / Option to insert a space before colon in a case statement
1804
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_colon_in_case"
1805
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1806
//	 *     - default:           INSERT
1807
//	 * </pre>
1808
//	 * @see CCorePlugin#INSERT
1809
//	 * @see CCorePlugin#DO_NOT_INSERT
1810
//	 */
1811
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_CASE = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_colon_in_case";	//$NON-NLS-1$
1812
//	/**
1813
//	 * <pre>
1814
//	 * FORMATTER / Option to insert a space before colon in a conditional expression
1815
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_colon_in_conditional"
1816
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1817
//	 *     - default:           INSERT
1818
//	 * </pre>
1819
//	 * @see CCorePlugin#INSERT
1820
//	 * @see CCorePlugin#DO_NOT_INSERT
1821
//	 */
1822
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_CONDITIONAL = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_colon_in_conditional";	//$NON-NLS-1$
1823
//	/**
1824
//	 * <pre>
1825
//	 * FORMATTER / Option to insert a space before colon in a default statement
1826
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_colon_in_default"
1827
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1828
//	 *     - default:           INSERT
1829
//	 * </pre>
1830
//	 * @see CCorePlugin#INSERT
1831
//	 * @see CCorePlugin#DO_NOT_INSERT
1832
//	 */
1833
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_DEFAULT = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_colon_in_default";	//$NON-NLS-1$
1834
//	/**
1835
//	 * <pre>
1836
//	 * FORMATTER / Option to insert a space before colon in a for statement
1837
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_colon_in_for"
1838
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1839
//	 *     - default:           INSERT
1840
//	 * </pre>
1841
//	 * @see CCorePlugin#INSERT
1842
//	 * @see CCorePlugin#DO_NOT_INSERT
1843
//	 */
1844
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_FOR = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_colon_in_for";	//$NON-NLS-1$
1845
//	/**
1846
//	 * <pre>
1847
//	 * FORMATTER / Option to insert a space before colon in a labeled statement
1848
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_colon_in_labeled_statement"
1849
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1850
//	 *     - default:           INSERT
1851
//	 * </pre>
1852
//	 * @see CCorePlugin#INSERT
1853
//	 * @see CCorePlugin#DO_NOT_INSERT
1854
//	 */
1855
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_LABELED_STATEMENT = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_colon_in_labeled_statement";	//$NON-NLS-1$
1856
//	/**
1857
//	 * <pre>
1858
//	 * FORMATTER / Option to insert a space before comma in an allocation expression
1859
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_comma_in_allocation_expression"
1860
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1861
//	 *     - default:           DO_NOT_INSERT
1862
//	 * </pre>
1863
//	 * @see CCorePlugin#INSERT
1864
//	 * @see CCorePlugin#DO_NOT_INSERT
1865
//	 */
1866
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ALLOCATION_EXPRESSION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_allocation_expression";	//$NON-NLS-1$
1867
//	/**
1868
//	 * <pre>
1869
//	 * FORMATTER / Option to insert a space before comma in annotation
1870
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_comma_in_annotation"
1871
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1872
//	 *     - default:           DO_NOT_INSERT
1873
//	 * </pre>
1874
//	 * @see CCorePlugin#INSERT
1875
//	 * @see CCorePlugin#DO_NOT_INSERT
1876
//	 */
1877
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ANNOTATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_annotation";	//$NON-NLS-1$
1878
//	/**
1879
//	 * <pre>
1880
//	 * FORMATTER / Option to insert a space before comma in an array initializer
1881
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_comma_in_array_initializer"
1882
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1883
//	 *     - default:           DO_NOT_INSERT
1884
//	 * </pre>
1885
//	 * @see CCorePlugin#INSERT
1886
//	 * @see CCorePlugin#DO_NOT_INSERT
1887
//	 */
1888
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ARRAY_INITIALIZER = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_array_initializer";	//$NON-NLS-1$
1889
//	/**
1890
//	 * <pre>
1891
//	 * FORMATTER / Option to insert a space before comma in the parameters of a constructor declaration
1892
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters"
1893
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1894
//	 *     - default:           DO_NOT_INSERT
1895
//	 * </pre>
1896
//	 * @see CCorePlugin#INSERT
1897
//	 * @see CCorePlugin#DO_NOT_INSERT
1898
//	 */
1899
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_CONSTRUCTOR_DECLARATION_PARAMETERS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_constructor_declaration_parameters";	//$NON-NLS-1$
1900
//	/**
1901
//	 * <pre>
1902
//	 * FORMATTER / Option to insert a space before comma in the exception names of the throws clause of a constructor declaration
1903
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws"
1904
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1905
//	 *     - default:           DO_NOT_INSERT
1906
//	 * </pre>
1907
//	 * @see CCorePlugin#INSERT
1908
//	 * @see CCorePlugin#DO_NOT_INSERT
1909
//	 */
1910
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_CONSTRUCTOR_DECLARATION_THROWS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_constructor_declaration_throws";	//$NON-NLS-1$
1911
//	/**
1912
//	 * <pre>
1913
//	 * FORMATTER / Option to insert a space before comma in the arguments of enum constant
1914
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments"
1915
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1916
//	 *     - default:           DO_NOT_INSERT
1917
//	 * </pre>
1918
//	 * @see CCorePlugin#INSERT
1919
//	 * @see CCorePlugin#DO_NOT_INSERT
1920
//	 */
1921
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ENUM_CONSTANT_ARGUMENTS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_enum_constant_arguments";	//$NON-NLS-1$
1922
//	/**
1923
//	 * <pre>
1924
//	 * FORMATTER / Option to insert a space before comma in enum declarations
1925
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_comma_in_enum_declarations"
1926
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1927
//	 *     - default:           DO_NOT_INSERT
1928
//	 * </pre>
1929
//	 * @see CCorePlugin#INSERT
1930
//	 * @see CCorePlugin#DO_NOT_INSERT
1931
//	 */
1932
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ENUM_DECLARATIONS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_enum_declarations";	//$NON-NLS-1$
1933
//	/**
1934
//	 * <pre>
1935
//	 * FORMATTER / Option to insert a space before comma in the arguments of an explicit constructor call
1936
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments"
1937
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1938
//	 *     - default:           DO_NOT_INSERT
1939
//	 * </pre>
1940
//	 * @see CCorePlugin#INSERT
1941
//	 * @see CCorePlugin#DO_NOT_INSERT
1942
//	 */
1943
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_EXPLICIT_CONSTRUCTOR_CALL_ARGUMENTS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_explicitconstructorcall_arguments";	//$NON-NLS-1$
1944
//	/**
1945
//	 * <pre>
1946
//	 * FORMATTER / Option to insert a space before comma in the increments of a for statement
1947
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_comma_in_for_increments"
1948
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1949
//	 *     - default:           DO_NOT_INSERT
1950
//	 * </pre>
1951
//	 * @see CCorePlugin#INSERT
1952
//	 * @see CCorePlugin#DO_NOT_INSERT
1953
//	 */
1954
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_FOR_INCREMENTS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_for_increments";	//$NON-NLS-1$
1955
//	/**
1956
//	 * <pre>
1957
//	 * FORMATTER / Option to insert a space before comma in the initializations of a for statement
1958
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_comma_in_for_inits"
1959
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1960
//	 *     - default:           DO_NOT_INSERT
1961
//	 * </pre>
1962
//	 * @see CCorePlugin#INSERT
1963
//	 * @see CCorePlugin#DO_NOT_INSERT
1964
//	 */
1965
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_FOR_INITS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_for_inits";	//$NON-NLS-1$
1966
//	/**
1967
//	 * <pre>
1968
//	 * FORMATTER / Option to insert a space before comma in the parameters of a method declaration
1969
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters"
1970
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1971
//	 *     - default:           DO_NOT_INSERT
1972
//	 * </pre>
1973
//	 * @see CCorePlugin#INSERT
1974
//	 * @see CCorePlugin#DO_NOT_INSERT
1975
//	 */
1976
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_METHOD_DECLARATION_PARAMETERS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_method_declaration_parameters";	//$NON-NLS-1$
1977
//	/**
1978
//	 * <pre>
1979
//	 * FORMATTER / Option to insert a space before comma in the exception names of the throws clause of a method declaration
1980
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_comma_in_method_declaration_throws"
1981
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1982
//	 *     - default:           DO_NOT_INSERT
1983
//	 * </pre>
1984
//	 * @see CCorePlugin#INSERT
1985
//	 * @see CCorePlugin#DO_NOT_INSERT
1986
//	 */
1987
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_METHOD_DECLARATION_THROWS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_method_declaration_throws";	//$NON-NLS-1$
1988
//	/**
1989
//	 * <pre>
1990
//	 * FORMATTER / Option to insert a space before comma in the arguments of a method invocation
1991
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments"
1992
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1993
//	 *     - default:           DO_NOT_INSERT
1994
//	 * </pre>
1995
//	 * @see CCorePlugin#INSERT
1996
//	 * @see CCorePlugin#DO_NOT_INSERT
1997
//	 */
1998
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_METHOD_INVOCATION_ARGUMENTS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_method_invocation_arguments";	//$NON-NLS-1$
1999
//	/**
2000
//	 * <pre>
2001
//	 * FORMATTER / Option to insert a space before comma in a multiple field declaration
2002
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations"
2003
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
2004
//	 *     - default:           DO_NOT_INSERT
2005
//	 * </pre>
2006
//	 * @see CCorePlugin#INSERT
2007
//	 * @see CCorePlugin#DO_NOT_INSERT
2008
//	 */
2009
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_MULTIPLE_FIELD_DECLARATIONS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_multiple_field_declarations";	//$NON-NLS-1$
2010
//	/**
2011
//	 * <pre>
2012
//	 * FORMATTER / Option to insert a space before comma in a multiple local declaration
2013
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations"
2014
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
2015
//	 *     - default:           DO_NOT_INSERT
2016
//	 * </pre>
2017
//	 * @see CCorePlugin#INSERT
2018
//	 * @see CCorePlugin#DO_NOT_INSERT
2019
//	 */
2020
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_MULTIPLE_LOCAL_DECLARATIONS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_multiple_local_declarations";	//$NON-NLS-1$
2021
//	/**
2022
//	 * <pre>
2023
//	 * FORMATTER / Option to insert a space before comma in parameterized type reference
2024
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference"
2025
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
2026
//	 *     - default:           DO_NOT_INSERT
2027
//	 * </pre>
2028
//	 * @see CCorePlugin#INSERT
2029
//	 * @see CCorePlugin#DO_NOT_INSERT
2030
//	 */
2031
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_PARAMETERIZED_TYPE_REFERENCE = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_parameterized_type_reference";	//$NON-NLS-1$
2032
//	/**
2033
//	 * <pre>
2034
//	 * FORMATTER / Option to insert a space before comma in the superinterfaces names in a type header
2035
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_comma_in_superinterfaces"
2036
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
2037
//	 *     - default:           DO_NOT_INSERT
2038
//	 * </pre>
2039
//	 * @see CCorePlugin#INSERT
2040
//	 * @see CCorePlugin#DO_NOT_INSERT
2041
//	 */
2042
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_SUPERINTERFACES = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_superinterfaces";	//$NON-NLS-1$
2043
//	/**
2044
//	 * <pre>
2045
//	 * FORMATTER / Option to insert a space before comma in type arguments
2046
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_comma_in_type_arguments"
2047
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
2048
//	 *     - default:           DO_NOT_INSERT
2049
//	 * </pre>
2050
//	 * @see CCorePlugin#INSERT
2051
//	 * @see CCorePlugin#DO_NOT_INSERT
2052
//	 */
2053
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_TYPE_ARGUMENTS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_type_arguments";	//$NON-NLS-1$
2054
//	/**
2055
//	 * <pre>
2056
//	 * FORMATTER / Option to insert a space before comma in type parameters
2057
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_comma_in_type_parameters"
2058
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
2059
//	 *     - default:           DO_NOT_INSERT
2060
//	 * </pre>
2061
//	 * @see CCorePlugin#INSERT
2062
//	 * @see CCorePlugin#DO_NOT_INSERT
2063
//	 */
2064
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_TYPE_PARAMETERS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_comma_in_type_parameters";	//$NON-NLS-1$
2065
//	/**
2066
//	 * <pre>
2067
//	 * FORMATTER / Option to insert a space before ellipsis
2068
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_ellipsis"
2069
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
2070
//	 *     - default:           DO_NOT_INSERT
2071
//	 * </pre>
2072
//	 * @see CCorePlugin#INSERT
2073
//	 * @see CCorePlugin#DO_NOT_INSERT
2074
//	 */
2075
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_ELLIPSIS  = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_ellipsis";	//$NON-NLS-1$
2076
//	/**
2077
//	 * <pre>
2078
//	 * FORMATTER / Option to insert a space before the opening angle bracket in parameterized type reference
2079
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference"
2080
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
2081
//	 *     - default:           DO_NOT_INSERT
2082
//	 * </pre>
2083
//	 * @see CCorePlugin#INSERT
2084
//	 * @see CCorePlugin#DO_NOT_INSERT
2085
//	 */
2086
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_ANGLE_BRACKET_IN_PARAMETERIZED_TYPE_REFERENCE  = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference";	//$NON-NLS-1$
2087
//	/**
2088
//	 * <pre>
2089
//	 * FORMATTER / Option to insert a space before the opening angle bracket in type arguments
2090
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments"
2091
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
2092
//	 *     - default:           DO_NOT_INSERT
2093
//	 * </pre>
2094
//	 * @see CCorePlugin#INSERT
2095
//	 * @see CCorePlugin#DO_NOT_INSERT
2096
//	 */
2097
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_ANGLE_BRACKET_IN_TYPE_ARGUMENTS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_angle_bracket_in_type_arguments";	//$NON-NLS-1$
2098
//	/**
2099
//	 * <pre>
2100
//	 * FORMATTER / Option to insert a space before the opening angle bracket in type parameters
2101
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters"
2102
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
2103
//	 *     - default:           DO_NOT_INSERT
2104
//	 * </pre>
2105
//	 * @see CCorePlugin#INSERT
2106
//	 * @see CCorePlugin#DO_NOT_INSERT
2107
//	 */
2108
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_ANGLE_BRACKET_IN_TYPE_PARAMETERS = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_angle_bracket_in_type_parameters";	//$NON-NLS-1$
2109
//	/**
2110
//	 * <pre>
2111
//	 * FORMATTER / Option to insert a space before the opening brace in an annotation type declaration
2112
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration"
2113
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
2114
//	 *     - default:           INSERT
2115
//	 * </pre>
2116
//	 * @see CCorePlugin#INSERT
2117
//	 * @see CCorePlugin#DO_NOT_INSERT
2118
//	 */
2119
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ANNOTATION_TYPE_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_brace_in_annotation_type_declaration"; 	//$NON-NLS-1$
2120
//	/**
2121
//	 * <pre>
2122
//	 * FORMATTER / Option to insert a space before the opening brace in an anonymous type declaration
2123
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration"
2124
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
2125
//	 *     - default:           INSERT
2126
//	 * </pre>
2127
//	 * @see CCorePlugin#INSERT
2128
//	 * @see CCorePlugin#DO_NOT_INSERT
2129
//	 */
2130
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ANONYMOUS_TYPE_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_brace_in_anonymous_type_declaration"; 	//$NON-NLS-1$
2131
//	/**
2132
//	 * <pre>
2133
//	 * FORMATTER / Option to insert a space before the opening brace in an array initializer
2134
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_array_initializer"
2135
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
2136
//	 *     - default:           DO_NOT_INSERT
2137
//	 * </pre>
2138
//	 * @see CCorePlugin#INSERT
2139
//	 * @see CCorePlugin#DO_NOT_INSERT
2140
//	 */
2141
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ARRAY_INITIALIZER = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_brace_in_array_initializer"; //$NON-NLS-1$
2142
//	/**
2143
//	 * <pre>
2144
//	 * FORMATTER / Option to insert a space before the opening brace in a block
2145
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_block"
2146
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
2147
//	 *     - default:           INSERT
2148
//	 * </pre>
2149
//	 * @see CCorePlugin#INSERT
2150
//	 * @see CCorePlugin#DO_NOT_INSERT
2151
//	 */
2152
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_BLOCK = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_brace_in_block";	//$NON-NLS-1$
2153
//	/**
2154
//	 * <pre>
2155
//	 * FORMATTER / Option to insert a space before the opening brace in a constructor declaration
2156
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration"
2157
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
2158
//	 *     - default:           INSERT
2159
//	 * </pre>
2160
//	 * @see CCorePlugin#INSERT
2161
//	 * @see CCorePlugin#DO_NOT_INSERT
2162
//	 */
2163
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_CONSTRUCTOR_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_brace_in_constructor_declaration";	//$NON-NLS-1$
2164
//	/**
2165
//	 * <pre>
2166
//	 * FORMATTER / Option to insert a space before the opening brace in an enum constant
2167
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_enum_constant"
2168
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
2169
//	 *     - default:           INSERT
2170
//	 * </pre>
2171
//	 * @see CCorePlugin#INSERT
2172
//	 * @see CCorePlugin#DO_NOT_INSERT
2173
//	 */
2174
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ENUM_CONSTANT = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_brace_in_enum_constant";	//$NON-NLS-1$
2175
//	/**
2176
//	 * <pre>
2177
//	 * FORMATTER / Option to insert a space before the opening brace in an enum declaration
2178
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration"
2179
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
2180
//	 *     - default:           INSERT
2181
//	 * </pre>
2182
//	 * @see CCorePlugin#INSERT
2183
//	 * @see CCorePlugin#DO_NOT_INSERT
2184
//	 */
2185
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ENUM_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_brace_in_enum_declaration";	//$NON-NLS-1$
2186
//	/**
2187
//	 * <pre>
2188
//	 * FORMATTER / Option to insert a space before the opening brace in a method declaration
2189
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_method_declaration"
2190
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
2191
//	 *     - default:           INSERT
2192
//	 * </pre>
2193
//	 * @see CCorePlugin#INSERT
2194
//	 * @see CCorePlugin#DO_NOT_INSERT
2195
//	 */
2196
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_METHOD_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_brace_in_method_declaration";	//$NON-NLS-1$
2197
//	/**
2198
//	 * <pre>
2199
//	 * FORMATTER / Option to insert a space before the opening brace in a switch statement
2200
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_switch"
2201
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
2202
//	 *     - default:           INSERT
2203
//	 * </pre>
2204
//	 * @see CCorePlugin#INSERT
2205
//	 * @see CCorePlugin#DO_NOT_INSERT
2206
//	 */
2207
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_SWITCH = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_brace_in_switch";	//$NON-NLS-1$
2208
//	/**
2209
//	 * <pre>
2210
//	 * FORMATTER / Option to insert a space before the opening brace in a type declaration
2211
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_type_declaration"
2212
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
2213
//	 *     - default:           INSERT
2214
//	 * </pre>
2215
//	 * @see CCorePlugin#INSERT
2216
//	 * @see CCorePlugin#DO_NOT_INSERT
2217
//	 */
2218
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_TYPE_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_brace_in_type_declaration";	//$NON-NLS-1$
2219
//	/**
2220
//	 * <pre>
2221
//	 * FORMATTER / Option to insert a space before the opening bracket in an array allocation expression
2222
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression"
2223
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
2224
//	 *     - default:           DO_NOT_INSERT
2225
//	 * </pre>
2226
//	 * @see CCorePlugin#INSERT
2227
//	 * @see CCorePlugin#DO_NOT_INSERT
2228
//	 */
2229
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACKET_IN_ARRAY_ALLOCATION_EXPRESSION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_bracket_in_array_allocation_expression";//$NON-NLS-1$
2230
//	/**
2231
//	 * <pre>
2232
//	 * FORMATTER / Option to insert a space before the opening bracket in an array reference
2233
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_opening_bracket_in_array_reference"
2234
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
2235
//	 *     - default:           DO_NOT_INSERT
2236
//	 * </pre>
2237
//	 * @see CCorePlugin#INSERT
2238
//	 * @see CCorePlugin#DO_NOT_INSERT
2239
//	 */
2240
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACKET_IN_ARRAY_REFERENCE = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_bracket_in_array_reference";//$NON-NLS-1$
2241
//	/**
2242
//	 * <pre>
2243
//	 * FORMATTER / Option to insert a space before the opening bracket in an array type reference
2244
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference"
2245
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
2246
//	 *     - default:           DO_NOT_INSERT
2247
//	 * </pre>
2248
//	 * @see CCorePlugin#INSERT
2249
//	 * @see CCorePlugin#DO_NOT_INSERT
2250
//	 */
2251
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACKET_IN_ARRAY_TYPE_REFERENCE = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_bracket_in_array_type_reference";	//$NON-NLS-1$
2252
//	/**
2253
//	 * <pre>
2254
//	 * FORMATTER / Option to insert a space before the opening parenthesis in annotation
2255
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_annotation"
2256
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
2257
//	 *     - default:           DO_NOT_INSERT
2258
//	 * </pre>
2259
//	 * @see CCorePlugin#INSERT
2260
//	 * @see CCorePlugin#DO_NOT_INSERT
2261
//	 */
2262
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_ANNOTATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_paren_in_annotation";	//$NON-NLS-1$
2263
//	/**
2264
//	 * <pre>
2265
//	 * FORMATTER / Option to insert a space before the opening parenthesis in annotation type member declaration
2266
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration"
2267
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
2268
//	 *     - default:           DO_NOT_INSERT
2269
//	 * </pre>
2270
//	 * @see CCorePlugin#INSERT
2271
//	 * @see CCorePlugin#DO_NOT_INSERT
2272
//	 */
2273
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_ANNOTATION_TYPE_MEMBER_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration";	//$NON-NLS-1$
2274
//	/**
2275
//	 * <pre>
2276
//	 * FORMATTER / Option to insert a space before the opening parenthesis in a catch
2277
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_catch"
2278
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
2279
//	 *     - default:           INSERT
2280
//	 * </pre>
2281
//	 * @see CCorePlugin#INSERT
2282
//	 * @see CCorePlugin#DO_NOT_INSERT
2283
//	 */
2284
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_CATCH = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_paren_in_catch";	//$NON-NLS-1$
2285
//	/**
2286
//	 * <pre>
2287
//	 * FORMATTER / Option to insert a space before the opening parenthesis in a constructor declaration
2288
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration"
2289
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
2290
//	 *     - default:           DO_NOT_INSERT
2291
//	 * </pre>
2292
//	 * @see CCorePlugin#INSERT
2293
//	 * @see CCorePlugin#DO_NOT_INSERT
2294
//	 */
2295
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_CONSTRUCTOR_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_paren_in_constructor_declaration";	//$NON-NLS-1$
2296
//	/**
2297
//	 * <pre>
2298
//	 * FORMATTER / Option to insert a space before the opening parenthesis in enum constant
2299
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_enum_constant"
2300
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
2301
//	 *     - default:           DO_NOT_INSERT
2302
//	 * </pre>
2303
//	 * @see CCorePlugin#INSERT
2304
//	 * @see CCorePlugin#DO_NOT_INSERT
2305
//	 */
2306
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_ENUM_CONSTANT = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_paren_in_enum_constant";	//$NON-NLS-1$
2307
//	/**
2308
//	 * <pre>
2309
//	 * FORMATTER / Option to insert a space before the opening parenthesis in a for statement
2310
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_for"
2311
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
2312
//	 *     - default:           INSERT
2313
//	 * </pre>
2314
//	 * @see CCorePlugin#INSERT
2315
//	 * @see CCorePlugin#DO_NOT_INSERT
2316
//	 */
2317
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_FOR = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_paren_in_for";	//$NON-NLS-1$
2318
//	/**
2319
//	 * <pre>
2320
//	 * FORMATTER / Option to insert a space before the opening parenthesis in an if statement
2321
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_if"
2322
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
2323
//	 *     - default:           INSERT
2324
//	 * </pre>
2325
//	 * @see CCorePlugin#INSERT
2326
//	 * @see CCorePlugin#DO_NOT_INSERT
2327
//	 */
2328
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_IF = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_paren_in_if";	//$NON-NLS-1$
2329
//	/**
2330
//	 * <pre>
2331
//	 * FORMATTER / Option to insert a space before the opening parenthesis in a method declaration
2332
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_method_declaration"
2333
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
2334
//	 *     - default:           DO_NOT_INSERT
2335
//	 * </pre>
2336
//	 * @see CCorePlugin#INSERT
2337
//	 * @see CCorePlugin#DO_NOT_INSERT
2338
//	 */
2339
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_METHOD_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_paren_in_method_declaration";	//$NON-NLS-1$
2340
//	/**
2341
//	 * <pre>
2342
//	 * FORMATTER / Option to insert a space before the opening parenthesis in a method invocation
2343
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_method_invocation"
2344
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
2345
//	 *     - default:           DO_NOT_INSERT
2346
//	 * </pre>
2347
//	 * @see CCorePlugin#INSERT
2348
//	 * @see CCorePlugin#DO_NOT_INSERT
2349
//	 */
2350
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_METHOD_INVOCATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_paren_in_method_invocation";	//$NON-NLS-1$
2351
//	/**
2352
//	 * <pre>
2353
//	 * FORMATTER / Option to insert a space before the opening parenthesis in a parenthesized expression
2354
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression"
2355
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
2356
//	 *     - default:           DO_NOT_INSERT
2357
//	 * </pre>
2358
//	 * @see CCorePlugin#INSERT
2359
//	 * @see CCorePlugin#DO_NOT_INSERT
2360
//	 */
2361
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_PARENTHESIZED_EXPRESSION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_paren_in_parenthesized_expression"; //$NON-NLS-1$
2362
//	/**
2363
//	 * <pre>
2364
//	 * FORMATTER / Option to insert a space before the opening parenthesis in a switch statement
2365
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_switch"
2366
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
2367
//	 *     - default:           INSERT
2368
//	 * </pre>
2369
//	 * @see CCorePlugin#INSERT
2370
//	 * @see CCorePlugin#DO_NOT_INSERT
2371
//	 */
2372
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_SWITCH = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_paren_in_switch";	//$NON-NLS-1$
2373
//	/**
2374
//	 * <pre>
2375
//	 * FORMATTER / Option to insert a space before the opening parenthesis in a synchronized statement
2376
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_synchronized"
2377
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
2378
//	 *     - default:           INSERT
2379
//	 * </pre>
2380
//	 * @see CCorePlugin#INSERT
2381
//	 * @see CCorePlugin#DO_NOT_INSERT
2382
//	 */
2383
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_SYNCHRONIZED = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_paren_in_synchronized";	//$NON-NLS-1$
2384
//	/**
2385
//	 * <pre>
2386
//	 * FORMATTER / Option to insert a space before the opening parenthesis in a while statement
2387
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_while"
2388
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
2389
//	 *     - default:           INSERT
2390
//	 * </pre>
2391
//	 * @see CCorePlugin#INSERT
2392
//	 * @see CCorePlugin#DO_NOT_INSERT
2393
//	 */
2394
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_WHILE = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_opening_paren_in_while";	//$NON-NLS-1$
2395
//	/**
2396
//	 * <pre>
2397
//	 * FORMATTER / Option to insert a space before parenthesized expression in return statement
2398
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_parenthesized_expression_in_return"
2399
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
2400
//	 *     - default:           INSERT
2401
//	 * </pre>
2402
//	 * 
2403
//	 * @see CCorePlugin#INSERT
2404
//	 * @see CCorePlugin#DO_NOT_INSERT
2405
//	 */
2406
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_PARENTHESIZED_EXPRESSION_IN_RETURN  = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_parenthesized_expression_in_return";	//$NON-NLS-1$
2407
//	/**
2408
//	 * <pre>
2409
//	 * FORMATTER / Option to insert a space before a postfix operator
2410
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_postfix_operator"
2411
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
2412
//	 *     - default:           DO_NOT_INSERT
2413
//	 * </pre>
2414
//	 * @see CCorePlugin#INSERT
2415
//	 * @see CCorePlugin#DO_NOT_INSERT
2416
//	 */
2417
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_POSTFIX_OPERATOR = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_postfix_operator";	//$NON-NLS-1$
2418
//	/**
2419
//	 * <pre>
2420
//	 * FORMATTER / Option to insert a space before a prefix operator
2421
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_prefix_operator"
2422
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
2423
//	 *     - default:           DO_NOT_INSERT
2424
//	 * </pre>
2425
//	 * @see CCorePlugin#INSERT
2426
//	 * @see CCorePlugin#DO_NOT_INSERT
2427
//	 */
2428
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_PREFIX_OPERATOR = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_prefix_operator";	//$NON-NLS-1$
2429
//	/**
2430
//	 * <pre>
2431
//	 * FORMATTER / Option to insert a space before question mark in a conditional expression
2432
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_question_in_conditional"
2433
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
2434
//	 *     - default:           INSERT
2435
//	 * </pre>
2436
//	 * @see CCorePlugin#INSERT
2437
//	 * @see CCorePlugin#DO_NOT_INSERT
2438
//	 */
2439
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_QUESTION_IN_CONDITIONAL = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_question_in_conditional";	//$NON-NLS-1$
2440
//	/**
2441
//	 * <pre>
2442
//	 * FORMATTER / Option to insert a space before question mark in a wildcard
2443
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_question_in_wildcard"
2444
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
2445
//	 *     - default:           DO_NOT_INSERT
2446
//	 * </pre>
2447
//	 * @see CCorePlugin#INSERT
2448
//	 * @see CCorePlugin#DO_NOT_INSERT
2449
//	 */
2450
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_QUESTION_IN_WILDCARD = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_question_in_wildcard"; //$NON-NLS-1$
2451
//	/**
2452
//	 * <pre>
2453
//	 * FORMATTER / Option to insert a space before semicolon
2454
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_semicolon"
2455
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
2456
//	 *     - default:           DO_NOT_INSERT
2457
//	 * </pre>
2458
//	 * @see CCorePlugin#INSERT
2459
//	 * @see CCorePlugin#DO_NOT_INSERT
2460
//	 */
2461
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_SEMICOLON = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_semicolon";	//$NON-NLS-1$
2462
//	/**
2463
//	 * <pre>
2464
//	 * FORMATTER / Option to insert a space before semicolon in for statement
2465
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_semicolon_in_for"
2466
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
2467
//	 *     - default:           DO_NOT_INSERT
2468
//	 * </pre>
2469
//	 * @see CCorePlugin#INSERT
2470
//	 * @see CCorePlugin#DO_NOT_INSERT
2471
//	 */
2472
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_SEMICOLON_IN_FOR = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_semicolon_in_for";	//$NON-NLS-1$
2473
//	/**
2474
//	 * <pre>
2475
//	 * FORMATTER / Option to insert a space before unary operator
2476
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_before_unary_operator"
2477
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
2478
//	 *     - default:           DO_NOT_INSERT
2479
//	 * </pre>
2480
//	 * @see CCorePlugin#INSERT
2481
//	 * @see CCorePlugin#DO_NOT_INSERT
2482
//	 */
2483
//	public static final String FORMATTER_INSERT_SPACE_BEFORE_UNARY_OPERATOR = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_before_unary_operator";	//$NON-NLS-1$
2484
//
2485
//	/**
2486
//	 * <pre>
2487
//	 * FORMATTER / Option to insert a space between brackets in an array type reference
2488
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_between_brackets_in_array_type_reference"
2489
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
2490
//	 *     - default:           DO_NOT_INSERT
2491
//	 * </pre>
2492
//	 * @see CCorePlugin#INSERT
2493
//	 * @see CCorePlugin#DO_NOT_INSERT
2494
//	 */
2495
//	public static final String FORMATTER_INSERT_SPACE_BETWEEN_BRACKETS_IN_ARRAY_TYPE_REFERENCE = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_between_brackets_in_array_type_reference";	//$NON-NLS-1$
2496
//	/**
2497
//	 * <pre>
2498
//	 * FORMATTER / Option to insert a space between empty braces in an array initializer
2499
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_between_empty_braces_in_array_initializer"
2500
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
2501
//	 *     - default:           DO_NOT_INSERT
2502
//	 * </pre>
2503
//	 * @see CCorePlugin#INSERT
2504
//	 * @see CCorePlugin#DO_NOT_INSERT
2505
//	 */
2506
//	public static final String FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_BRACES_IN_ARRAY_INITIALIZER = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_between_empty_braces_in_array_initializer";	//$NON-NLS-1$
2507
//	/**
2508
//	 * <pre>
2509
//	 * FORMATTER / Option to insert a space between empty brackets in an array allocation expression
2510
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression"
2511
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
2512
//	 *     - default:           DO_NOT_INSERT
2513
//	 * </pre>
2514
//	 * @see CCorePlugin#INSERT
2515
//	 * @see CCorePlugin#DO_NOT_INSERT
2516
//	 */
2517
//	public static final String FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_BRACKETS_IN_ARRAY_ALLOCATION_EXPRESSION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_between_empty_brackets_in_array_allocation_expression";	//$NON-NLS-1$
2518
//	/**
2519
//	 * <pre>
2520
//	 * FORMATTER / Option to insert a space between empty parenthesis in an annotation type member declaration
2521
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration"
2522
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
2523
//	 *     - default:           DO_NOT_INSERT
2524
//	 * </pre>
2525
//	 * @see CCorePlugin#INSERT
2526
//	 * @see CCorePlugin#DO_NOT_INSERT
2527
//	 */
2528
//	public static final String FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_ANNOTATION_TYPE_MEMBER_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration";	//$NON-NLS-1$
2529
//	/**
2530
//	 * <pre>
2531
//	 * FORMATTER / Option to insert a space between empty parenthesis in a constructor declaration
2532
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration"
2533
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
2534
//	 *     - default:           DO_NOT_INSERT
2535
//	 * </pre>
2536
//	 * @see CCorePlugin#INSERT
2537
//	 * @see CCorePlugin#DO_NOT_INSERT
2538
//	 */
2539
//	public static final String FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_CONSTRUCTOR_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_between_empty_parens_in_constructor_declaration";	//$NON-NLS-1$
2540
//	/**
2541
//	 * <pre>
2542
//	 * FORMATTER / Option to insert a space between empty parenthesis in enum constant
2543
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_between_empty_parens_in_enum_constant"
2544
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
2545
//	 *     - default:           DO_NOT_INSERT
2546
//	 * </pre>
2547
//	 * @see CCorePlugin#INSERT
2548
//	 * @see CCorePlugin#DO_NOT_INSERT
2549
//	 */
2550
//	public static final String FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_ENUM_CONSTANT = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_between_empty_parens_in_enum_constant";	//$NON-NLS-1$
2551
//	/**
2552
//	 * <pre>
2553
//	 * FORMATTER / Option to insert a space between empty parenthesis in a method declaration
2554
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_between_empty_parens_in_method_declaration"
2555
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
2556
//	 *     - default:           DO_NOT_INSERT
2557
//	 * </pre>
2558
//	 * @see CCorePlugin#INSERT
2559
//	 * @see CCorePlugin#DO_NOT_INSERT
2560
//	 */
2561
//	public static final String FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_METHOD_DECLARATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_between_empty_parens_in_method_declaration";	//$NON-NLS-1$
2562
//	/**
2563
//	 * <pre>
2564
//	 * FORMATTER / Option to insert a space between empty parenthesis in a method invocation
2565
//	 *     - option id:         "org.eclipse.cdt.core.formatter.insert_space_between_empty_parens_in_method_invocation"
2566
//	 *     - possible values:   { INSERT, DO_NOT_INSERT }
2567
//	 *     - default:           DO_NOT_INSERT
2568
//	 * </pre>
2569
//	 * @see CCorePlugin#INSERT
2570
//	 * @see CCorePlugin#DO_NOT_INSERT
2571
//	 */
2572
//	public static final String FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_METHOD_INVOCATION = CCorePlugin.PLUGIN_ID + ".formatter.insert_space_between_empty_parens_in_method_invocation";	//$NON-NLS-1$
2573
//	/**
2574
//	 * <pre>
2575
//	 * FORMATTER / Option to keep else statement on the same line
2576
//	 *     - option id:         "org.eclipse.cdt.core.formatter.keep_else_statement_on_same_line"
2577
//	 *     - possible values:   { TRUE, FALSE }
2578
//	 *     - default:           FALSE
2579
//	 * </pre>
2580
//	 * @see #TRUE
2581
//	 * @see #FALSE
2582
//	 */
2583
//	public static final String FORMATTER_KEEP_ELSE_STATEMENT_ON_SAME_LINE = CCorePlugin.PLUGIN_ID + ".formatter.keep_else_statement_on_same_line"; //$NON-NLS-1$
2584
//	/**
2585
//	 * <pre>
2586
//	 * FORMATTER / Option to keep empty array initializer one one line
2587
//	 *     - option id:         "org.eclipse.cdt.core.formatter.keep_empty_array_initializer_on_one_line"
2588
//	 *     - possible values:   { TRUE, FALSE }
2589
//	 *     - default:           FALSE
2590
//	 * </pre>
2591
//	 * @see #TRUE
2592
//	 * @see #FALSE
2593
//	 */
2594
//	public static final String FORMATTER_KEEP_EMPTY_ARRAY_INITIALIZER_ON_ONE_LINE = CCorePlugin.PLUGIN_ID + ".formatter.keep_empty_array_initializer_on_one_line"; //$NON-NLS-1$
2595
//	/**
2596
//	 * <pre>
2597
//	 * FORMATTER / Option to keep guardian clause on one line
2598
//	 *     - option id:         "org.eclipse.cdt.core.formatter.format_guardian_clause_on_one_line"
2599
//	 *     - possible values:   { TRUE, FALSE }
2600
//	 *     - default:           FALSE
2601
//	 * </pre>
2602
//	 * @see #TRUE
2603
//	 * @see #FALSE
2604
//	 */
2605
//	public static final String FORMATTER_KEEP_GUARDIAN_CLAUSE_ON_ONE_LINE = CCorePlugin.PLUGIN_ID + ".formatter.format_guardian_clause_on_one_line";	//$NON-NLS-1$
2606
//	/**
2607
//	 * <pre>
2608
//	 * FORMATTER / Option to keep simple if statement on the one line
2609
//	 *     - option id:         "org.eclipse.cdt.core.formatter.keep_imple_if_on_one_line"
2610
//	 *     - possible values:   { TRUE, FALSE }
2611
//	 *     - default:           FALSE
2612
//	 * </pre>
2613
//	 * @see #TRUE
2614
//	 * @see #FALSE
2615
//	 */
2616
//	public static final String FORMATTER_KEEP_SIMPLE_IF_ON_ONE_LINE = CCorePlugin.PLUGIN_ID + ".formatter.keep_imple_if_on_one_line"; //$NON-NLS-1$
2617
//	/**
2618
//	 * <pre>
2619
//	 * FORMATTER / Option to keep then statement on the same line
2620
//	 *     - option id:         "org.eclipse.cdt.core.formatter.keep_then_statement_on_same_line"
2621
//	 *     - possible values:   { TRUE, FALSE }
2622
//	 *     - default:           FALSE
2623
//	 * </pre>
2624
//	 * @see #TRUE
2625
//	 * @see #FALSE
2626
//	 */
2627
//	public static final String FORMATTER_KEEP_THEN_STATEMENT_ON_SAME_LINE = CCorePlugin.PLUGIN_ID + ".formatter.keep_then_statement_on_same_line";//$NON-NLS-1$
2628
2629
	/**
2630
	 * <pre>
2631
	 * FORMATTER / Option to specify the length of the page. Beyond this length, the formatter will try to split the code
2632
	 *     - option id:         "org.eclipse.cdt.core.formatter.lineSplit"
2633
	 *     - possible values:   "&lt;n&gt;", where n is zero or a positive integer
2634
	 *     - default:           "80"
2635
	 * </pre>
2636
	 */
2637
	public static final String FORMATTER_LINE_SPLIT = CCorePlugin.PLUGIN_ID + ".formatter.lineSplit"; //$NON-NLS-1$
2638
//
2639
//	/**
2640
//	 * <pre>
2641
//	 * FORMATTER / Option to specify the number of empty lines to preserve
2642
//	 *     - option id:         "org.eclipse.cdt.core.formatter.number_of_empty_lines_to_preserve"
2643
//	 *     - possible values:   "&lt;n&gt;", where n is zero or a positive integer
2644
//	 *     - default:           "0"
2645
//	 * </pre>
2646
//	 */
2647
//	public static final String FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE = CCorePlugin.PLUGIN_ID + ".formatter.number_of_empty_lines_to_preserve";	//$NON-NLS-1$
2648
//	/**
2649
//	 * <pre>
2650
//	 * FORMATTER / Option to specify whether or not empty statement should be on a new line
2651
//	 *     - option id:         "org.eclipse.cdt.core.formatter.put_empty_statement_on_new_line"
2652
//	 *     - possible values:   { TRUE, FALSE }
2653
//	 *     - default:           FALSE
2654
//	 * </pre>
2655
//	 * @see #TRUE
2656
//	 * @see #FALSE
2657
//	 */
2658
//	public static final String FORMATTER_PUT_EMPTY_STATEMENT_ON_NEW_LINE = CCorePlugin.PLUGIN_ID + ".formatter.put_empty_statement_on_new_line";	//$NON-NLS-1$
2659
	/**
2660
	 * <pre>
2661
	 * FORMATTER / Option to specify the tabulation size
2662
	 *     - option id:         "org.eclipse.cdt.core.formatter.tabulation.char"
2663
	 *     - possible values:   { TAB, SPACE, MIXED }
2664
	 *     - default:           TAB
2665
	 * </pre>
2666
	 * More values may be added in the future.
2667
	 * 
2668
	 * @see CCorePlugin#TAB
2669
	 * @see CCorePlugin#SPACE
2670
	 * @see #MIXED
2671
	 */
2672
	public static final String FORMATTER_TAB_CHAR = CCorePlugin.PLUGIN_ID + ".formatter.tabulation.char"; //$NON-NLS-1$
2673
	/**
2674
	 * <pre>
2675
	 * FORMATTER / Option to specify the equivalent number of spaces that represents one tabulation 
2676
	 *     - option id:         "org.eclipse.cdt.core.formatter.tabulation.size"
2677
	 *     - possible values:   "&lt;n&gt;", where n is zero or a positive integer
2678
	 *     - default:           "4"
2679
	 * </pre>
2680
	 */
2681
	public static final String FORMATTER_TAB_SIZE = CCorePlugin.PLUGIN_ID + ".formatter.tabulation.size"; //$NON-NLS-1$
2682
2683
	/**
2684
	 * <pre>
2685
	 * FORMATTER / Option to use tabulations only for leading indentations 
2686
	 *     - option id:         "org.eclipse.cdt.core.formatter.use_tabs_only_for_leading_indentations"
2687
	 *     - possible values:   { TRUE, FALSE }
2688
	 *     - default:           FALSE
2689
	 * </pre>
2690
	 * @see #TRUE
2691
	 * @see #FALSE
2692
	 */
2693
	public static final String FORMATTER_USE_TABS_ONLY_FOR_LEADING_INDENTATIONS = CCorePlugin.PLUGIN_ID + ".formatter.use_tabs_only_for_leading_indentations"; //$NON-NLS-1$
2694
2695
	/**
2696
	 * <pre>
2697
	 * FORMATTER / The wrapping is done by indenting by one compare to the current indentation.
2698
	 * </pre>
2699
	 */
2700
	public static final int INDENT_BY_ONE= 2;
2701
	
2702
	/**
2703
	 * <pre>
2704
	 * FORMATTER / The wrapping is done by using the current indentation.
2705
	 * </pre>
2706
	 */
2707
	public static final int INDENT_DEFAULT= 0;
2708
	/**
2709
	 * <pre>
2710
	 * FORMATTER / The wrapping is done by indenting on column under the splitting location.
2711
	 * </pre>
2712
	 */
2713
	public static final int INDENT_ON_COLUMN = 1;
2714
	
2715
	/**
2716
	 * <pre>
2717
	 * FORMATTER / Possible value for the option FORMATTER_TAB_CHAR
2718
	 * </pre>
2719
	 * @see CCorePlugin#TAB
2720
	 * @see CCorePlugin#SPACE
2721
	 * @see #FORMATTER_TAB_CHAR
2722
	 */
2723
	public static final String MIXED = "mixed"; //$NON-NLS-1$
2724
//	/**
2725
//	 * <pre>
2726
//	 * FORMATTER / Value to set a brace location at the start of the next line with
2727
//	 *             the right indentation.
2728
//	 * </pre>
2729
//	 * @see #FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION
2730
//	 * @see #FORMATTER_BRACE_POSITION_FOR_ARRAY_INITIALIZER
2731
//	 * @see #FORMATTER_BRACE_POSITION_FOR_BLOCK
2732
//	 * @see #FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION
2733
// 	 * @see #FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION
2734
// 	 * @see #FORMATTER_BRACE_POSITION_FOR_SWITCH
2735
//	 * @see #FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION
2736
//	 */
2737
//	public static final String NEXT_LINE = "next_line"; //$NON-NLS-1$
2738
//	/**
2739
//	 * <pre>
2740
//	 * FORMATTER / Value to set a brace location at the start of the next line if a wrapping
2741
//	 *             occured.
2742
//	 * </pre>
2743
//	 * @see #FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION
2744
//	 * @see #FORMATTER_BRACE_POSITION_FOR_ARRAY_INITIALIZER
2745
//	 * @see #FORMATTER_BRACE_POSITION_FOR_BLOCK
2746
//	 * @see #FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION
2747
// 	 * @see #FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION
2748
// 	 * @see #FORMATTER_BRACE_POSITION_FOR_SWITCH
2749
//	 * @see #FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION
2750
//	 */
2751
//    public static final String NEXT_LINE_ON_WRAP = "next_line_on_wrap"; //$NON-NLS-1$
2752
	/**
2753
	 * <pre>
2754
	 * FORMATTER / Value to set a brace location at the start of the next line with
2755
	 *             an extra indentation.
2756
	 * </pre>
2757
	 * @see #FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION
2758
	 * @see #FORMATTER_BRACE_POSITION_FOR_ARRAY_INITIALIZER
2759
	 * @see #FORMATTER_BRACE_POSITION_FOR_BLOCK
2760
	 * @see #FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION
2761
 	 * @see #FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION
2762
 	 * @see #FORMATTER_BRACE_POSITION_FOR_SWITCH
2763
	 * @see #FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION
2764
	 */
2765
	public static final String NEXT_LINE_SHIFTED = "next_line_shifted";	//$NON-NLS-1$
2766
	/**
2767
	 * <pre>
2768
	 * FORMATTER / Value to set an option to true.
2769
	 * </pre>
2770
	 */
2771
	public static final String TRUE = "true"; //$NON-NLS-1$
2772
	/**
2773
	 * <pre>
2774
	 * FORMATTER / The wrapping is done using as few lines as possible.
2775
	 * </pre>
2776
	 */
2777
	public static final int WRAP_COMPACT= 1;
2778
	/**
2779
	 * <pre>
2780
	 * FORMATTER / The wrapping is done putting the first element on a new
2781
	 *             line and then wrapping next elements using as few lines as possible.
2782
	 * </pre>
2783
	 */
2784
	public static final int WRAP_COMPACT_FIRST_BREAK= 2;
2785
	/**
2786
	 * <pre>
2787
	 * FORMATTER / The wrapping is done by putting each element on its own line
2788
	 *             except the first element.
2789
	 * </pre>
2790
	 */
2791
	public static final int WRAP_NEXT_PER_LINE= 5;
2792
	/**
2793
	 * <pre>
2794
	 * FORMATTER / The wrapping is done by putting each element on its own line.
2795
	 *             All elements are indented by one except the first element.
2796
	 * </pre>
2797
	 */
2798
	public static final int WRAP_NEXT_SHIFTED= 4;
2799
2800
	/**
2801
	 * <pre>
2802
	 * FORMATTER / Value to disable alignment.
2803
	 * </pre>
2804
	 */
2805
	public static final int WRAP_NO_SPLIT= 0;
2806
	/**
2807
	 * <pre>
2808
	 * FORMATTER / The wrapping is done by putting each element on its own line.
2809
	 * </pre>
2810
	 */
2811
	public static final int WRAP_ONE_PER_LINE= 3;
2812
2813
	/*
2814
	 * Private constants.
2815
	 */
2816
	private static final IllegalArgumentException WRONG_ARGUMENT = new IllegalArgumentException();
2817
	
2818
	/**
2819
	 * Create a new alignment value according to the given values. This must be used to set up
2820
	 * the alignment options.
2821
	 * 
2822
	 * @param forceSplit the given force value
2823
	 * @param wrapStyle the given wrapping style
2824
	 * @param indentStyle the given indent style
2825
	 * 
2826
	 * @return the new alignement value
2827
	 */
2828
	public static String createAlignmentValue(boolean forceSplit, int wrapStyle, int indentStyle) {
2829
		int alignmentValue = 0; 
2830
		switch(wrapStyle) {
2831
			case WRAP_COMPACT :
2832
				alignmentValue |= Alignment.M_COMPACT_SPLIT;
2833
				break;
2834
			case WRAP_COMPACT_FIRST_BREAK :
2835
				alignmentValue |= Alignment.M_COMPACT_FIRST_BREAK_SPLIT;
2836
				break;
2837
			case WRAP_NEXT_PER_LINE :
2838
				alignmentValue |= Alignment.M_NEXT_PER_LINE_SPLIT;
2839
				break;
2840
			case WRAP_NEXT_SHIFTED :
2841
				alignmentValue |= Alignment.M_NEXT_SHIFTED_SPLIT;
2842
				break;
2843
			case WRAP_ONE_PER_LINE :
2844
				alignmentValue |= Alignment.M_ONE_PER_LINE_SPLIT;
2845
				break;
2846
		}		
2847
		if (forceSplit) {
2848
			alignmentValue |= Alignment.M_FORCE;
2849
		}
2850
		switch(indentStyle) {
2851
			case INDENT_BY_ONE :
2852
				alignmentValue |= Alignment.M_INDENT_BY_ONE;
2853
				break;
2854
			case INDENT_ON_COLUMN :
2855
				alignmentValue |= Alignment.M_INDENT_ON_COLUMN;
2856
		}
2857
		return String.valueOf(alignmentValue);
2858
	}
2859
2860
	/**
2861
	 * Returns the default Eclipse formatter settings
2862
	 * 
2863
	 * @return the Eclipse default settings
2864
	 */
2865
	public static Map getEclipseDefaultSettings() {
2866
		return DefaultCodeFormatterOptions.getEclipseDefaultSettings().getMap();
2867
	}
2868
2869
	/**
2870
	 * <p>Return the force value of the given alignment value.
2871
	 * The given alignment value should be created using the <code>createAlignmentValue(boolean, int, int)</code>
2872
	 * API.
2873
	 * </p>
2874
	 *
2875
	 * @param value the given alignment value
2876
	 * @return the force value of the given alignment value
2877
	 * @see #createAlignmentValue(boolean, int, int)
2878
	 * @exception IllegalArgumentException if the given alignment value is null, or if it 
2879
	 * doesn't have a valid format.
2880
	 */
2881
	public static boolean getForceWrapping(String value) {
2882
		if (value == null) {
2883
			throw WRONG_ARGUMENT;
2884
		}
2885
		try {
2886
			int existingValue = Integer.parseInt(value);
2887
			return (existingValue & Alignment.M_FORCE) != 0;
2888
		} catch (NumberFormatException e) {
2889
			throw WRONG_ARGUMENT;
2890
		}
2891
	}
40
	
2892
	
2893
	/**
2894
	 * <p>Return the indentation style of the given alignment value.
2895
	 * The given alignment value should be created using the <code>createAlignmentValue(boolean, int, int)</code>
2896
	 * API.
2897
	 * </p>
2898
	 *
2899
	 * @param value the given alignment value
2900
	 * @return the indentation style of the given alignment value
2901
	 * @see #createAlignmentValue(boolean, int, int)
2902
	 * @exception IllegalArgumentException if the given alignment value is null, or if it 
2903
	 * doesn't have a valid format.
2904
	 */
2905
	public static int getIndentStyle(String value) {
2906
		if (value == null) {
2907
			throw WRONG_ARGUMENT;
2908
		}
2909
		try {
2910
			int existingValue = Integer.parseInt(value);
2911
			if ((existingValue & Alignment.M_INDENT_BY_ONE) != 0) {
2912
				return INDENT_BY_ONE;
2913
			} else if ((existingValue & Alignment.M_INDENT_ON_COLUMN) != 0) {
2914
				return INDENT_ON_COLUMN;
2915
			} else {
2916
				return INDENT_DEFAULT;
2917
			}
2918
		} catch (NumberFormatException e) {
2919
			throw WRONG_ARGUMENT;
2920
		}
2921
	}
41
2922
2923
	/**
2924
	 * <p>Return the wrapping style of the given alignment value.
2925
	 * The given alignment value should be created using the <code>createAlignmentValue(boolean, int, int)</code>
2926
	 * API.
2927
	 * </p>
2928
	 *
2929
	 * @param value the given alignment value
2930
	 * @return the wrapping style of the given alignment value
2931
	 * @see #createAlignmentValue(boolean, int, int)
2932
	 * @exception IllegalArgumentException if the given alignment value is null, or if it 
2933
	 * doesn't have a valid format.
2934
	 */
2935
	public static int getWrappingStyle(String value) {
2936
		if (value == null) {
2937
			throw WRONG_ARGUMENT;
2938
		}
2939
		try {
2940
			int existingValue = Integer.parseInt(value) & Alignment.SPLIT_MASK;
2941
			switch(existingValue) {
2942
				case Alignment.M_COMPACT_SPLIT :
2943
					return WRAP_COMPACT;
2944
				case Alignment.M_COMPACT_FIRST_BREAK_SPLIT :
2945
					return WRAP_COMPACT_FIRST_BREAK;
2946
				case Alignment.M_NEXT_PER_LINE_SPLIT :
2947
					return WRAP_NEXT_PER_LINE;
2948
				case Alignment.M_NEXT_SHIFTED_SPLIT :
2949
					return WRAP_NEXT_SHIFTED;
2950
				case Alignment.M_ONE_PER_LINE_SPLIT :
2951
					return WRAP_ONE_PER_LINE;
2952
				default:
2953
					return WRAP_NO_SPLIT;
2954
			}
2955
		} catch (NumberFormatException e) {
2956
			throw WRONG_ARGUMENT;
2957
		}
2958
	}
2959
	/**
2960
	 * <p>Set the force value of the given alignment value and return the new value.
2961
	 * The given alignment value should be created using the <code>createAlignmentValue(boolean, int, int)</code>
2962
	 * API.
2963
	 * </p>
2964
	 *
2965
	 * @param value the given alignment value
2966
	 * @param force the given force value
2967
	 * @return the new alignment value
2968
	 * @see #createAlignmentValue(boolean, int, int)
2969
	 * @exception IllegalArgumentException if the given alignment value is null, or if it 
2970
	 * doesn't have a valid format.
2971
	 */
2972
	public static String setForceWrapping(String value, boolean force) {
2973
		if (value == null) {
2974
			throw WRONG_ARGUMENT;
2975
		}
2976
		try {
2977
			int existingValue = Integer.parseInt(value);
2978
			// clear existing force bit
2979
			existingValue &= ~Alignment.M_FORCE;
2980
			if (force) {
2981
				existingValue |= Alignment.M_FORCE;
2982
			}
2983
			return String.valueOf(existingValue);
2984
		} catch (NumberFormatException e) {
2985
			throw WRONG_ARGUMENT;
2986
		}		
2987
	}
2988
	
2989
	/**
2990
	 * <p>Set the indentation style of the given alignment value and return the new value.
2991
	 * The given value should be created using the <code>createAlignmentValue(boolean, int, int)</code>
2992
	 * API.
2993
	 * </p>
2994
	 *
2995
	 * @param value the given alignment value
2996
	 * @param indentStyle the given indentation style
2997
	 * @return the new alignment value
2998
	 * @see #INDENT_BY_ONE
2999
	 * @see #INDENT_DEFAULT
3000
	 * @see #INDENT_ON_COLUMN
3001
	 * @see #createAlignmentValue(boolean, int, int)
3002
	 * @exception IllegalArgumentException if the given alignment value is null, if the given
3003
	 * indentation style is not one of the possible indentation styles, or if the given
3004
	 * alignment value doesn't have a valid format.
3005
	 */
3006
	public static String setIndentStyle(String value, int indentStyle) {
3007
		if (value == null) {
3008
			throw WRONG_ARGUMENT;
3009
		}
3010
		switch(indentStyle) {
3011
			case INDENT_BY_ONE :
3012
			case INDENT_DEFAULT :
3013
			case INDENT_ON_COLUMN :
3014
				break;
3015
			default :
3016
				throw WRONG_ARGUMENT;
3017
		}
3018
		try {
3019
			int existingValue = Integer.parseInt(value);
3020
			// clear existing indent bits
3021
			existingValue &= ~(Alignment.M_INDENT_BY_ONE | Alignment.M_INDENT_ON_COLUMN);
3022
			switch(indentStyle) {
3023
				case INDENT_BY_ONE :
3024
					existingValue |= Alignment.M_INDENT_BY_ONE;
3025
					break;
3026
				case INDENT_ON_COLUMN :
3027
					existingValue |= Alignment.M_INDENT_ON_COLUMN;
3028
			}
3029
			return String.valueOf(existingValue);
3030
		} catch (NumberFormatException e) {
3031
			throw WRONG_ARGUMENT;
3032
		}
3033
	}
3034
	/**
3035
	 * <p>Set the wrapping style of the given alignment value and return the new value.
3036
	 * The given value should be created using the <code>createAlignmentValue(boolean, int, int)</code>
3037
	 * API.
3038
	 * </p>
3039
	 *
3040
	 * @param value the given alignment value
3041
	 * @param wrappingStyle the given wrapping style
3042
	 * @return the new alignment value
3043
	 * @see #WRAP_COMPACT
3044
	 * @see #WRAP_COMPACT_FIRST_BREAK
3045
	 * @see #WRAP_NEXT_PER_LINE
3046
	 * @see #WRAP_NEXT_SHIFTED
3047
	 * @see #WRAP_NO_SPLIT
3048
	 * @see #WRAP_ONE_PER_LINE
3049
	 * @see #createAlignmentValue(boolean, int, int)
3050
	 * @exception IllegalArgumentException if the given alignment value is null, if the given
3051
	 * wrapping style is not one of the possible wrapping styles, or if the given
3052
	 * alignment value doesn't have a valid format.
3053
	 */
3054
	public static String setWrappingStyle(String value, int wrappingStyle) {
3055
		if (value == null) {
3056
			throw WRONG_ARGUMENT;
3057
		}
3058
		switch(wrappingStyle) {
3059
			case WRAP_COMPACT :
3060
			case WRAP_COMPACT_FIRST_BREAK :
3061
			case WRAP_NEXT_PER_LINE :
3062
			case WRAP_NEXT_SHIFTED :
3063
			case WRAP_NO_SPLIT :
3064
			case WRAP_ONE_PER_LINE :
3065
				break;
3066
			default:
3067
				throw WRONG_ARGUMENT;
3068
		}
3069
		try {
3070
			int existingValue = Integer.parseInt(value);
3071
			// clear existing split bits
3072
			existingValue &= ~(Alignment.SPLIT_MASK);
3073
			switch(wrappingStyle) {
3074
				case WRAP_COMPACT :
3075
					existingValue |= Alignment.M_COMPACT_SPLIT;
3076
					break;
3077
				case WRAP_COMPACT_FIRST_BREAK :
3078
					existingValue |= Alignment.M_COMPACT_FIRST_BREAK_SPLIT;
3079
					break;
3080
				case WRAP_NEXT_PER_LINE :
3081
					existingValue |= Alignment.M_NEXT_PER_LINE_SPLIT;
3082
					break;
3083
				case WRAP_NEXT_SHIFTED :
3084
					existingValue |= Alignment.M_NEXT_SHIFTED_SPLIT;
3085
					break;
3086
				case WRAP_ONE_PER_LINE :
3087
					existingValue |= Alignment.M_ONE_PER_LINE_SPLIT;
3088
					break;
3089
			}
3090
			return String.valueOf(existingValue);
3091
		} catch (NumberFormatException e) {
3092
			throw WRONG_ARGUMENT;
3093
		}
3094
	}
42
}
3095
}
(-)src/org/eclipse/cdt/internal/core/CCorePreferenceInitializer.java (-11 / +23 lines)
Lines 7-22 Link Here
7
 *
7
 *
8
 * Contributors:
8
 * Contributors:
9
 *     QNX Software Systems - Initial API and implementation
9
 *     QNX Software Systems - Initial API and implementation
10
 *     Sergey Prigogin, Google
10
 *******************************************************************************/
11
 *******************************************************************************/
11
package org.eclipse.cdt.internal.core;
12
package org.eclipse.cdt.internal.core;
12
13
13
import java.util.HashSet;
14
import java.util.HashSet;
15
import java.util.Iterator;
16
import java.util.Map;
14
17
15
import org.eclipse.cdt.core.CCorePlugin;
18
import org.eclipse.cdt.core.CCorePlugin;
16
import org.eclipse.cdt.core.CCorePreferenceConstants;
19
import org.eclipse.cdt.core.CCorePreferenceConstants;
20
import org.eclipse.cdt.core.formatter.CodeFormatterConstants;
17
import org.eclipse.cdt.internal.core.model.CModelManager;
21
import org.eclipse.cdt.internal.core.model.CModelManager;
18
import org.eclipse.core.runtime.Preferences;
22
//import org.eclipse.core.runtime.Preferences;
19
import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
23
import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
24
import org.eclipse.core.runtime.preferences.DefaultScope;
25
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
26
import org.eclipse.core.runtime.preferences.IScopeContext;
20
27
21
28
22
public class CCorePreferenceInitializer extends AbstractPreferenceInitializer {
29
public class CCorePreferenceInitializer extends AbstractPreferenceInitializer {
Lines 25-43 Link Here
25
	 * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
32
	 * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
26
	 */
33
	 */
27
	public void initializeDefaultPreferences() {
34
	public void initializeDefaultPreferences() {
28
        Preferences preferences = CCorePlugin.getDefault().getPluginPreferences();
29
        HashSet optionNames = CModelManager.OptionNames;
35
        HashSet optionNames = CModelManager.OptionNames;
30
    
36
    
31
        // Compiler settings
37
		// Formatter settings
32
        preferences.setDefault(CCorePreferenceConstants.TRANSLATION_TASK_TAGS, CCorePreferenceConstants.DEFAULT_TASK_TAG); 
38
		Map defaultOptionsMap = CodeFormatterConstants.getEclipseDefaultSettings(); // code formatter defaults
33
        optionNames.add(CCorePreferenceConstants.TRANSLATION_TASK_TAGS);
39
34
40
		// Compiler settings
35
        preferences.setDefault(CCorePreferenceConstants.TRANSLATION_TASK_PRIORITIES, CCorePreferenceConstants.DEFAULT_TASK_PRIORITY); 
41
		defaultOptionsMap.put(CCorePreferenceConstants.TRANSLATION_TASK_TAGS, CCorePreferenceConstants.DEFAULT_TASK_TAG); 
36
        optionNames.add(CCorePreferenceConstants.TRANSLATION_TASK_PRIORITIES);
42
		defaultOptionsMap.put(CCorePreferenceConstants.TRANSLATION_TASK_PRIORITIES, CCorePreferenceConstants.DEFAULT_TASK_PRIORITY); 
37
        
43
		defaultOptionsMap.put(CCorePreferenceConstants.CODE_FORMATTER, CCorePreferenceConstants.DEFAULT_CODE_FORMATTER); 
38
        preferences.setDefault(CCorePreferenceConstants.CODE_FORMATTER, CCorePreferenceConstants.DEFAULT_CODE_FORMATTER); 
39
        optionNames.add(CCorePreferenceConstants.CODE_FORMATTER);
40
                
44
                
45
		// Store default values to default preferences
46
	 	IEclipsePreferences defaultPreferences = ((IScopeContext) new DefaultScope()).getNode(CCorePlugin.PLUGIN_ID);
47
		for (Iterator iter = defaultOptionsMap.entrySet().iterator(); iter.hasNext();) {
48
			Map.Entry entry = (Map.Entry) iter.next();
49
			String optionName = (String) entry.getKey();
50
			defaultPreferences.put(optionName, (String)entry.getValue());
51
			optionNames.add(optionName);
52
		}
41
	}
53
	}
42
54
43
}
55
}
(-)src/org/eclipse/cdt/internal/formatter/align/Alignment.java (+124 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2005 IBM Corporation and others.
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
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.cdt.internal.formatter.align;
12
13
14
/**
15
 * Alignment management
16
 */
17
public class Alignment {
18
19
	// name of alignment
20
	public String name;
21
	
22
	// link to enclosing alignment
23
	public Alignment enclosing;
24
	 
25
	// indentation management
26
	public int fragmentIndex;
27
	public int fragmentCount;
28
	public int[] fragmentIndentations;
29
	public boolean needRedoColumnAlignment;
30
31
	// chunk management
32
	public int chunkStartIndex;
33
	public int chunkKind;
34
35
	// break management	
36
	public int originalIndentationLevel;
37
	public int breakIndentationLevel;
38
	public int shiftBreakIndentationLevel;
39
	public int[] fragmentBreaks;
40
	public boolean wasSplit;
41
42
	/* 
43
	 * Alignment modes
44
	 */
45
	public static final int M_FORCE = 1; // if bit set, then alignment will be non-optional (default is optional)
46
	public static final int M_INDENT_ON_COLUMN = 2; // if bit set, broken fragments will be aligned on current location column (default is to break at current indentation level)
47
	public static final int	M_INDENT_BY_ONE = 4; // if bit set, broken fragments will be indented one level below current (not using continuation indentation)
48
49
	// split modes can be combined either with M_FORCE or M_INDENT_ON_COLUMN
50
	
51
	/** foobar(#fragment1, #fragment2, <ul>
52
	 *  <li>    #fragment3, #fragment4 </li>
53
	 * </ul>
54
	 */
55
	public static final int M_COMPACT_SPLIT = 16; // fill each line with all possible fragments
56
57
	/** foobar(<ul>
58
	 * <li>    #fragment1, #fragment2,  </li>
59
	 * <li>     #fragment5, #fragment4, </li>
60
	 * </ul>
61
	 */
62
	public static final int M_COMPACT_FIRST_BREAK_SPLIT = 32; //  compact mode, but will first try to break before first fragment
63
64
	/** foobar(<ul>
65
	 * <li>     #fragment1,  </li>
66
	 * <li>     #fragment2,  </li>
67
	 * <li>     #fragment3 </li>
68
	 * <li>     #fragment4,  </li>
69
	 * </ul>
70
	 */
71
	public static final int M_ONE_PER_LINE_SPLIT = 32+16; // one fragment per line
72
73
	/** 
74
	 * foobar(<ul>
75
	 * <li>     #fragment1,  </li>
76
	 * <li>        #fragment2,  </li>
77
	 * <li>        #fragment3 </li>
78
	 * <li>        #fragment4,  </li>
79
	 * </ul>
80
	 */ 
81
	public static final int M_NEXT_SHIFTED_SPLIT = 64; // one fragment per line, subsequent are indented further
82
83
	/** foobar(#fragment1, <ul>
84
	 * <li>      #fragment2,  </li>
85
	 * <li>      #fragment3 </li>
86
	 * <li>      #fragment4,  </li>
87
	 * </ul>
88
	 */
89
	public static final int M_NEXT_PER_LINE_SPLIT = 64+16; // one per line, except first fragment (if possible)
90
91
	//64+32
92
	//64+32+16
93
	
94
	// mode controlling column alignments
95
	/** 
96
	 * <table BORDER COLS=4 WIDTH="100%" >
97
	 * <tr><td>#fragment1A</td>            <td>#fragment2A</td>       <td>#fragment3A</td>  <td>#very-long-fragment4A</td></tr>
98
	 * <tr><td>#fragment1B</td>            <td>#long-fragment2B</td>  <td>#fragment3B</td>  <td>#fragment4B</td></tr>
99
	 * <tr><td>#very-long-fragment1C</td>  <td>#fragment2C</td>       <td>#fragment3C</td>  <td>#fragment4C</td></tr>
100
	 * </table>
101
	 */
102
	public static final int M_MULTICOLUMN = 256; // fragments are on same line, but multiple line of fragments will be aligned vertically
103
	
104
	public static final int M_NO_ALIGNMENT = 0;
105
	
106
	public int mode;
107
	
108
	public static final int SPLIT_MASK = M_ONE_PER_LINE_SPLIT | M_NEXT_SHIFTED_SPLIT | M_COMPACT_SPLIT | M_COMPACT_FIRST_BREAK_SPLIT | M_NEXT_PER_LINE_SPLIT;
109
110
	// alignment tie-break rules - when split is needed, will decide whether innermost/outermost alignment is to be chosen
111
	public static final int R_OUTERMOST = 1;
112
	public static final int R_INNERMOST = 2;
113
	public int tieBreakRule;
114
	
115
	// alignment effects on a per fragment basis
116
	public static int NONE = 0;
117
	public static int BREAK = 1;
118
	
119
	// chunk kind
120
	public static final int CHUNK_FIELD = 1;
121
	public static final int CHUNK_METHOD = 2;
122
	public static final int CHUNK_TYPE = 3;
123
	public static final int CHUNK_ENUM = 4;
124
}
(-)src/org/eclipse/cdt/internal/formatter/DefaultCodeFormatterOptions.java (+2158 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2006 IBM Corporation and others.
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
 *     IBM Corporation - initial API and implementation
10
 *     Sergey Prigogin, Google
11
 *******************************************************************************/
12
package org.eclipse.cdt.internal.formatter;
13
14
import java.util.HashMap;
15
import java.util.Map;
16
17
import org.eclipse.cdt.core.formatter.CodeFormatterConstants;
18
import org.eclipse.cdt.core.CCorePlugin;
19
import org.eclipse.cdt.internal.formatter.align.Alignment;
20
21
22
public class DefaultCodeFormatterOptions {
23
	public static final int TAB = 1;
24
	public static final int SPACE = 2;
25
	public static final int MIXED = 4;
26
	
27
	public static DefaultCodeFormatterOptions getDefaultSettings() {
28
		DefaultCodeFormatterOptions options = new DefaultCodeFormatterOptions();
29
		options.setDefaultSettings();
30
		return options;
31
	}
32
	
33
	public static DefaultCodeFormatterOptions getEclipseDefaultSettings() {
34
		DefaultCodeFormatterOptions options = new DefaultCodeFormatterOptions();
35
		options.setEclipseDefaultSettings();
36
		return options;
37
	}
38
39
	public int alignment_for_arguments_in_allocation_expression;
40
	public int alignment_for_arguments_in_enum_constant;
41
	public int alignment_for_arguments_in_explicit_constructor_call;
42
	public int alignment_for_arguments_in_method_invocation;
43
	public int alignment_for_arguments_in_qualified_allocation_expression;
44
	public int alignment_for_assignment;
45
	public int alignment_for_binary_expression;
46
	public int alignment_for_compact_if;
47
	public int alignment_for_conditional_expression;
48
	public int alignment_for_enum_constants;
49
	public int alignment_for_expressions_in_array_initializer;
50
	public int alignment_for_multiple_fields;
51
	public int alignment_for_parameters_in_constructor_declaration;
52
	public int alignment_for_parameters_in_method_declaration;
53
	public int alignment_for_selector_in_method_invocation;
54
	public int alignment_for_superclass_in_type_declaration;
55
	public int alignment_for_superinterfaces_in_enum_declaration;
56
	public int alignment_for_superinterfaces_in_type_declaration;
57
	public int alignment_for_throws_clause_in_constructor_declaration;
58
	public int alignment_for_throws_clause_in_method_declaration;
59
	
60
	public boolean align_type_members_on_columns;
61
	
62
	public String brace_position_for_array_initializer;
63
	public String brace_position_for_block;
64
	public String brace_position_for_block_in_case;
65
	public String brace_position_for_constructor_declaration;
66
	public String brace_position_for_enum_constant;
67
	public String brace_position_for_enum_declaration;
68
	public String brace_position_for_method_declaration;
69
	public String brace_position_for_type_declaration;
70
	public String brace_position_for_switch;
71
	
72
	public int continuation_indentation;
73
	public int continuation_indentation_for_array_initializer;
74
	
75
//	public int blank_lines_after_imports;
76
//	public int blank_lines_after_package;
77
//	public int blank_lines_before_field;
78
//	public int blank_lines_before_first_class_body_declaration;
79
//	public int blank_lines_before_imports;
80
//	public int blank_lines_before_member_type;
81
//	public int blank_lines_before_method;
82
//	public int blank_lines_before_new_chunk;
83
//	public int blank_lines_before_package;
84
//	public int blank_lines_between_type_declarations;
85
//	public int blank_lines_at_beginning_of_method_body;
86
	
87
//	public boolean comment_clear_blank_lines;
88
//	public boolean comment_format;
89
//	public boolean comment_format_header;
90
//	public boolean comment_format_html;
91
//	public boolean comment_format_source;
92
//	public int comment_line_length;
93
	
94
	public boolean indent_statements_compare_to_block;
95
	public boolean indent_statements_compare_to_body;
96
	public boolean indent_body_declarations_compare_to_enum_constant_header;
97
	public boolean indent_body_declarations_compare_to_enum_declaration_header;
98
	public boolean indent_body_declarations_compare_to_type_header;
99
	public boolean indent_breaks_compare_to_cases;
100
	public boolean indent_empty_lines;
101
	public boolean indent_switchstatements_compare_to_cases;
102
	public boolean indent_switchstatements_compare_to_switch;
103
	public int indentation_size;
104
105
//	public boolean insert_new_line_after_opening_brace_in_array_initializer;
106
//	public boolean insert_new_line_at_end_of_file_if_missing;
107
//	public boolean insert_new_line_before_catch_in_try_statement;
108
//	public boolean insert_new_line_before_closing_brace_in_array_initializer;
109
//	public boolean insert_new_line_before_else_in_if_statement;
110
//	public boolean insert_new_line_before_finally_in_try_statement;
111
//	public boolean insert_new_line_before_while_in_do_statement;
112
//	public boolean insert_new_line_in_empty_block;
113
//	public boolean insert_new_line_in_empty_enum_constant;
114
//	public boolean insert_new_line_in_empty_enum_declaration;
115
//	public boolean insert_new_line_in_empty_method_body;
116
//	public boolean insert_new_line_in_empty_type_declaration;
117
//	public boolean insert_space_after_and_in_type_parameter;
118
//	public boolean insert_space_after_assignment_operator;
119
//	public boolean insert_space_after_binary_operator;
120
//	public boolean insert_space_after_closing_angle_bracket_in_type_arguments;
121
//	public boolean insert_space_after_closing_angle_bracket_in_type_parameters;
122
//	public boolean insert_space_after_closing_paren_in_cast;
123
//	public boolean insert_space_after_closing_brace_in_block;
124
//	public boolean insert_space_after_colon_in_assert;
125
//	public boolean insert_space_after_colon_in_case;
126
//	public boolean insert_space_after_colon_in_conditional;
127
//	public boolean insert_space_after_colon_in_for;
128
//	public boolean insert_space_after_colon_in_labeled_statement;
129
//	public boolean insert_space_after_comma_in_allocation_expression;
130
//	public boolean insert_space_after_comma_in_array_initializer;
131
//	public boolean insert_space_after_comma_in_constructor_declaration_parameters;
132
//	public boolean insert_space_after_comma_in_constructor_declaration_throws;
133
//	public boolean insert_space_after_comma_in_enum_constant_arguments;
134
//	public boolean insert_space_after_comma_in_enum_declarations;
135
//	public boolean insert_space_after_comma_in_explicit_constructor_call_arguments;
136
//	public boolean insert_space_after_comma_in_for_increments;
137
//	public boolean insert_space_after_comma_in_for_inits;
138
//	public boolean insert_space_after_comma_in_method_invocation_arguments;
139
//	public boolean insert_space_after_comma_in_method_declaration_parameters;
140
//	public boolean insert_space_after_comma_in_method_declaration_throws;
141
//	public boolean insert_space_after_comma_in_multiple_field_declarations;
142
//	public boolean insert_space_after_comma_in_multiple_local_declarations;
143
//	public boolean insert_space_after_comma_in_parameterized_type_reference;
144
//	public boolean insert_space_after_comma_in_superinterfaces;
145
//	public boolean insert_space_after_comma_in_type_arguments;
146
//	public boolean insert_space_after_comma_in_type_parameters;
147
//	public boolean insert_space_after_ellipsis;
148
//	public boolean insert_space_after_opening_angle_bracket_in_parameterized_type_reference;
149
//	public boolean insert_space_after_opening_angle_bracket_in_type_arguments;
150
//	public boolean insert_space_after_opening_angle_bracket_in_type_parameters;
151
//	public boolean insert_space_after_opening_bracket_in_array_allocation_expression;
152
//	public boolean insert_space_after_opening_bracket_in_array_reference;
153
//	public boolean insert_space_after_opening_brace_in_array_initializer;
154
//	public boolean insert_space_after_opening_paren_in_cast;
155
//	public boolean insert_space_after_opening_paren_in_catch;
156
//	public boolean insert_space_after_opening_paren_in_constructor_declaration;
157
//	public boolean insert_space_after_opening_paren_in_enum_constant;
158
//	public boolean insert_space_after_opening_paren_in_for;
159
//	public boolean insert_space_after_opening_paren_in_if;
160
//	public boolean insert_space_after_opening_paren_in_method_declaration;
161
//	public boolean insert_space_after_opening_paren_in_method_invocation;
162
//	public boolean insert_space_after_opening_paren_in_parenthesized_expression;
163
//	public boolean insert_space_after_opening_paren_in_switch;
164
//	public boolean insert_space_after_opening_paren_in_synchronized;
165
//	public boolean insert_space_after_opening_paren_in_while;
166
//	public boolean insert_space_after_postfix_operator;
167
//	public boolean insert_space_after_prefix_operator;
168
//	public boolean insert_space_after_question_in_conditional;
169
//	public boolean insert_space_after_question_in_wilcard;
170
//	public boolean insert_space_after_semicolon_in_for;
171
//	public boolean insert_space_after_unary_operator;
172
//	public boolean insert_space_before_and_in_type_parameter;
173
//	public boolean insert_space_before_assignment_operator;
174
//	public boolean insert_space_before_binary_operator;
175
//	public boolean insert_space_before_closing_angle_bracket_in_parameterized_type_reference;
176
//	public boolean insert_space_before_closing_angle_bracket_in_type_arguments;
177
//	public boolean insert_space_before_closing_angle_bracket_in_type_parameters;
178
//	public boolean insert_space_before_closing_brace_in_array_initializer;
179
//	public boolean insert_space_before_closing_bracket_in_array_allocation_expression;
180
//	public boolean insert_space_before_closing_bracket_in_array_reference;
181
//	public boolean insert_space_before_closing_paren_in_cast;
182
//	public boolean insert_space_before_closing_paren_in_catch;
183
//	public boolean insert_space_before_closing_paren_in_constructor_declaration;
184
//	public boolean insert_space_before_closing_paren_in_enum_constant;
185
//	public boolean insert_space_before_closing_paren_in_for;
186
//	public boolean insert_space_before_closing_paren_in_if;
187
//	public boolean insert_space_before_closing_paren_in_method_declaration;
188
//	public boolean insert_space_before_closing_paren_in_method_invocation;
189
//	public boolean insert_space_before_closing_paren_in_parenthesized_expression;
190
//	public boolean insert_space_before_closing_paren_in_switch;
191
//	public boolean insert_space_before_closing_paren_in_synchronized;
192
//	public boolean insert_space_before_closing_paren_in_while;
193
//	public boolean insert_space_before_colon_in_assert;
194
//	public boolean insert_space_before_colon_in_case;
195
//	public boolean insert_space_before_colon_in_conditional;
196
//	public boolean insert_space_before_colon_in_default;
197
//	public boolean insert_space_before_colon_in_for;
198
//	public boolean insert_space_before_colon_in_labeled_statement;
199
//	public boolean insert_space_before_comma_in_allocation_expression;
200
//	public boolean insert_space_before_comma_in_array_initializer;
201
//	public boolean insert_space_before_comma_in_constructor_declaration_parameters;
202
//	public boolean insert_space_before_comma_in_constructor_declaration_throws;
203
//	public boolean insert_space_before_comma_in_enum_constant_arguments;
204
//	public boolean insert_space_before_comma_in_enum_declarations;
205
//	public boolean insert_space_before_comma_in_explicit_constructor_call_arguments;
206
//	public boolean insert_space_before_comma_in_for_increments;
207
//	public boolean insert_space_before_comma_in_for_inits;
208
//	public boolean insert_space_before_comma_in_method_invocation_arguments;
209
//	public boolean insert_space_before_comma_in_method_declaration_parameters;
210
//	public boolean insert_space_before_comma_in_method_declaration_throws;
211
//	public boolean insert_space_before_comma_in_multiple_field_declarations;
212
//	public boolean insert_space_before_comma_in_multiple_local_declarations;
213
//	public boolean insert_space_before_comma_in_parameterized_type_reference;
214
//	public boolean insert_space_before_comma_in_superinterfaces;
215
//	public boolean insert_space_before_comma_in_type_arguments;
216
//	public boolean insert_space_before_comma_in_type_parameters;
217
//	public boolean insert_space_before_ellipsis;
218
//	public boolean insert_space_before_parenthesized_expression_in_return;
219
//	public boolean insert_space_before_question_in_wilcard;
220
//	public boolean insert_space_before_opening_angle_bracket_in_parameterized_type_reference;
221
//	public boolean insert_space_before_opening_angle_bracket_in_type_arguments;
222
//	public boolean insert_space_before_opening_angle_bracket_in_type_parameters;
223
//	public boolean insert_space_before_opening_brace_in_array_initializer;
224
//	public boolean insert_space_before_opening_brace_in_block;
225
//	public boolean insert_space_before_opening_brace_in_constructor_declaration;
226
//	public boolean insert_space_before_opening_brace_in_enum_constant;
227
//	public boolean insert_space_before_opening_brace_in_enum_declaration;
228
//	public boolean insert_space_before_opening_brace_in_method_declaration;
229
//	public boolean insert_space_before_opening_brace_in_type_declaration;
230
//	public boolean insert_space_before_opening_bracket_in_array_allocation_expression;
231
//	public boolean insert_space_before_opening_bracket_in_array_reference;
232
//	public boolean insert_space_before_opening_bracket_in_array_type_reference;
233
//	public boolean insert_space_before_opening_paren_in_catch;
234
//	public boolean insert_space_before_opening_paren_in_constructor_declaration;
235
//	public boolean insert_space_before_opening_paren_in_enum_constant;
236
//	public boolean insert_space_before_opening_paren_in_for;
237
//	public boolean insert_space_before_opening_paren_in_if;
238
//	public boolean insert_space_before_opening_paren_in_method_invocation;
239
//	public boolean insert_space_before_opening_paren_in_method_declaration;
240
//	public boolean insert_space_before_opening_paren_in_switch;
241
//	public boolean insert_space_before_opening_brace_in_switch;
242
//	public boolean insert_space_before_opening_paren_in_synchronized;
243
//	public boolean insert_space_before_opening_paren_in_parenthesized_expression;
244
//	public boolean insert_space_before_opening_paren_in_while;
245
//	public boolean insert_space_before_postfix_operator;
246
//	public boolean insert_space_before_prefix_operator;
247
//	public boolean insert_space_before_question_in_conditional;
248
//	public boolean insert_space_before_semicolon;
249
//	public boolean insert_space_before_semicolon_in_for;
250
//	public boolean insert_space_before_unary_operator;
251
//	public boolean insert_space_between_brackets_in_array_type_reference;
252
//	public boolean insert_space_between_empty_braces_in_array_initializer;
253
//	public boolean insert_space_between_empty_brackets_in_array_allocation_expression;
254
//	public boolean insert_space_between_empty_parens_in_constructor_declaration;
255
//	public boolean insert_space_between_empty_parens_in_enum_constant;
256
//	public boolean insert_space_between_empty_parens_in_method_declaration;
257
//	public boolean insert_space_between_empty_parens_in_method_invocation;
258
//	public boolean compact_else_if;
259
//	public boolean keep_guardian_clause_on_one_line;
260
//	public boolean keep_else_statement_on_same_line;
261
//	public boolean keep_empty_array_initializer_on_one_line;
262
//	public boolean keep_simple_if_on_one_line;
263
//	public boolean keep_then_statement_on_same_line;
264
//	public int number_of_empty_lines_to_preserve;
265
//	public boolean put_empty_statement_on_new_line;
266
	public int tab_size;
267
	public final char filling_space = ' ';
268
	public int page_width;
269
	public int tab_char = TAB;
270
	public boolean use_tabs_only_for_leading_indentations;
271
	
272
	public int initial_indentation_level;
273
	public String line_separator;
274
	
275
	private DefaultCodeFormatterOptions() {
276
		// cannot be instantiated
277
	}
278
279
	public DefaultCodeFormatterOptions(Map settings) {
280
		setDefaultSettings();
281
		if (settings == null) return;
282
		set(settings);
283
	}
284
285
	private String getAlignment(int alignment) {
286
		return Integer.toString(alignment);
287
	}
288
289
	public Map getMap() {
290
		Map options = new HashMap();
291
		options.put(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_ALLOCATION_EXPRESSION, getAlignment(this.alignment_for_arguments_in_allocation_expression));
292
		options.put(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_ENUM_CONSTANT, getAlignment(this.alignment_for_arguments_in_enum_constant));
293
		options.put(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_EXPLICIT_CONSTRUCTOR_CALL, getAlignment(this.alignment_for_arguments_in_explicit_constructor_call));
294
		options.put(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_METHOD_INVOCATION, getAlignment(this.alignment_for_arguments_in_method_invocation));
295
		options.put(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_QUALIFIED_ALLOCATION_EXPRESSION, getAlignment(this.alignment_for_arguments_in_qualified_allocation_expression));
296
		options.put(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ASSIGNMENT, getAlignment(this.alignment_for_assignment));
297
		options.put(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_BINARY_EXPRESSION, getAlignment(this.alignment_for_binary_expression));
298
		options.put(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_COMPACT_IF, getAlignment(this.alignment_for_compact_if));
299
		options.put(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_CONDITIONAL_EXPRESSION, getAlignment(this.alignment_for_conditional_expression));
300
		options.put(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ENUM_CONSTANTS, getAlignment(this.alignment_for_enum_constants));
301
		options.put(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER, getAlignment(this.alignment_for_expressions_in_array_initializer));
302
		options.put(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_MULTIPLE_FIELDS, getAlignment(this.alignment_for_multiple_fields));
303
		options.put(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_CONSTRUCTOR_DECLARATION, getAlignment(this.alignment_for_parameters_in_constructor_declaration));
304
		options.put(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_METHOD_DECLARATION, getAlignment(this.alignment_for_parameters_in_method_declaration));
305
		options.put(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_SELECTOR_IN_METHOD_INVOCATION, getAlignment(this.alignment_for_selector_in_method_invocation));
306
		options.put(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_SUPERCLASS_IN_TYPE_DECLARATION, getAlignment(this.alignment_for_superclass_in_type_declaration));
307
		options.put(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_SUPERINTERFACES_IN_ENUM_DECLARATION, getAlignment(this.alignment_for_superinterfaces_in_enum_declaration));
308
		options.put(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_SUPERINTERFACES_IN_TYPE_DECLARATION, getAlignment(this.alignment_for_superinterfaces_in_type_declaration));
309
		options.put(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_THROWS_CLAUSE_IN_CONSTRUCTOR_DECLARATION, getAlignment(this.alignment_for_throws_clause_in_constructor_declaration));
310
		options.put(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_THROWS_CLAUSE_IN_METHOD_DECLARATION, getAlignment(this.alignment_for_throws_clause_in_method_declaration));
311
		options.put(CodeFormatterConstants.FORMATTER_ALIGN_TYPE_MEMBERS_ON_COLUMNS, this.align_type_members_on_columns ? CodeFormatterConstants.TRUE : CodeFormatterConstants.FALSE);
312
		options.put(CodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ARRAY_INITIALIZER, this.brace_position_for_array_initializer);
313
		options.put(CodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK, this.brace_position_for_block);
314
		options.put(CodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK_IN_CASE, this.brace_position_for_block_in_case);
315
		options.put(CodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION, this.brace_position_for_constructor_declaration);
316
		options.put(CodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ENUM_CONSTANT, this.brace_position_for_enum_constant);
317
		options.put(CodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ENUM_DECLARATION, this.brace_position_for_enum_declaration);
318
		options.put(CodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION, this.brace_position_for_method_declaration);
319
		options.put(CodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION, this.brace_position_for_type_declaration);
320
		options.put(CodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH, this.brace_position_for_switch);
321
//		options.put(CodeFormatterConstants.FORMATTER_COMMENT_CLEAR_BLANK_LINES, this.comment_clear_blank_lines ? CodeFormatterConstants.TRUE : CodeFormatterConstants.FALSE);
322
//		options.put(CodeFormatterConstants.FORMATTER_COMMENT_FORMAT, this.comment_format ? CodeFormatterConstants.TRUE : CodeFormatterConstants.FALSE);
323
//		options.put(CodeFormatterConstants.FORMATTER_COMMENT_FORMAT_HEADER, this.comment_format_header ? CodeFormatterConstants.TRUE : CodeFormatterConstants.FALSE);
324
//		options.put(CodeFormatterConstants.FORMATTER_COMMENT_FORMAT_HTML, this.comment_format_html ? CodeFormatterConstants.TRUE : CodeFormatterConstants.FALSE);
325
//		options.put(CodeFormatterConstants.FORMATTER_COMMENT_FORMAT_SOURCE, this.comment_format_source ? CodeFormatterConstants.TRUE : CodeFormatterConstants.FALSE);
326
//		options.put(CodeFormatterConstants.FORMATTER_COMMENT_LINE_LENGTH, Integer.toString(this.comment_line_length));
327
		options.put(CodeFormatterConstants.FORMATTER_CONTINUATION_INDENTATION, Integer.toString(this.continuation_indentation));
328
		options.put(CodeFormatterConstants.FORMATTER_CONTINUATION_INDENTATION_FOR_ARRAY_INITIALIZER, Integer.toString(this.continuation_indentation_for_array_initializer));
329
//		options.put(CodeFormatterConstants.FORMATTER_BLANK_LINES_AFTER_IMPORTS, Integer.toString(this.blank_lines_after_imports));
330
//		options.put(CodeFormatterConstants.FORMATTER_BLANK_LINES_AFTER_PACKAGE, Integer.toString(this.blank_lines_after_package));
331
//		options.put(CodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_FIELD, Integer.toString(this.blank_lines_before_field));
332
//		options.put(CodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_FIRST_CLASS_BODY_DECLARATION, Integer.toString(this.blank_lines_before_first_class_body_declaration));
333
//		options.put(CodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_IMPORTS, Integer.toString(this.blank_lines_before_imports));
334
//		options.put(CodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_MEMBER_TYPE, Integer.toString(this.blank_lines_before_member_type));
335
//		options.put(CodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_METHOD, Integer.toString(this.blank_lines_before_method));
336
//		options.put(CodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_NEW_CHUNK, Integer.toString(this.blank_lines_before_new_chunk));
337
//		options.put(CodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_PACKAGE, Integer.toString(this.blank_lines_before_package));
338
//		options.put(CodeFormatterConstants.FORMATTER_BLANK_LINES_BETWEEN_TYPE_DECLARATIONS, Integer.toString(this.blank_lines_between_type_declarations));
339
//		options.put(CodeFormatterConstants.FORMATTER_BLANK_LINES_AT_BEGINNING_OF_METHOD_BODY, Integer.toString(this.blank_lines_at_beginning_of_method_body));
340
		options.put(CodeFormatterConstants.FORMATTER_INDENT_STATEMENTS_COMPARE_TO_BLOCK, this.indent_statements_compare_to_block ? CodeFormatterConstants.TRUE : CodeFormatterConstants.FALSE);
341
		options.put(CodeFormatterConstants.FORMATTER_INDENT_STATEMENTS_COMPARE_TO_BODY, this.indent_statements_compare_to_body ? CodeFormatterConstants.TRUE : CodeFormatterConstants.FALSE);
342
		options.put(CodeFormatterConstants.FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_ENUM_CONSTANT_HEADER, this.indent_body_declarations_compare_to_enum_constant_header ? CodeFormatterConstants.TRUE : CodeFormatterConstants.FALSE);
343
		options.put(CodeFormatterConstants.FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_ENUM_DECLARATION_HEADER, this.indent_body_declarations_compare_to_enum_declaration_header ? CodeFormatterConstants.TRUE : CodeFormatterConstants.FALSE);
344
		options.put(CodeFormatterConstants.FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_TYPE_HEADER, this.indent_body_declarations_compare_to_type_header ? CodeFormatterConstants.TRUE : CodeFormatterConstants.FALSE);
345
		options.put(CodeFormatterConstants.FORMATTER_INDENT_BREAKS_COMPARE_TO_CASES, this.indent_breaks_compare_to_cases ? CodeFormatterConstants.TRUE : CodeFormatterConstants.FALSE);
346
		options.put(CodeFormatterConstants.FORMATTER_INDENT_EMPTY_LINES, this.indent_empty_lines ? CodeFormatterConstants.TRUE : CodeFormatterConstants.FALSE);
347
		options.put(CodeFormatterConstants.FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_CASES, this.indent_switchstatements_compare_to_cases ? CodeFormatterConstants.TRUE : CodeFormatterConstants.FALSE);
348
		options.put(CodeFormatterConstants.FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_SWITCH, this.indent_switchstatements_compare_to_switch ? CodeFormatterConstants.TRUE : CodeFormatterConstants.FALSE);
349
		options.put(CodeFormatterConstants.FORMATTER_INDENTATION_SIZE, Integer.toString(this.indentation_size));
350
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_OPENING_BRACE_IN_ARRAY_INITIALIZER, this.insert_new_line_after_opening_brace_in_array_initializer? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
351
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AT_END_OF_FILE_IF_MISSING, this.insert_new_line_at_end_of_file_if_missing ? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
352
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT, this.insert_new_line_before_catch_in_try_statement? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
353
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CLOSING_BRACE_IN_ARRAY_INITIALIZER, this.insert_new_line_before_closing_brace_in_array_initializer? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
354
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT, this.insert_new_line_before_else_in_if_statement? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
355
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT, this.insert_new_line_before_finally_in_try_statement? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
356
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT, this.insert_new_line_before_while_in_do_statement? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
357
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_IN_EMPTY_BLOCK, this.insert_new_line_in_empty_block? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
358
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_IN_EMPTY_ENUM_CONSTANT, this.insert_new_line_in_empty_enum_constant? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
359
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_IN_EMPTY_ENUM_DECLARATION, this.insert_new_line_in_empty_enum_declaration? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
360
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_IN_EMPTY_METHOD_BODY, this.insert_new_line_in_empty_method_body? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
361
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_IN_EMPTY_TYPE_DECLARATION, this.insert_new_line_in_empty_type_declaration? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
362
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_AND_IN_TYPE_PARAMETER, this.insert_space_after_and_in_type_parameter? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
363
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_ASSIGNMENT_OPERATOR, this.insert_space_after_assignment_operator? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
364
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_BINARY_OPERATOR, this.insert_space_after_binary_operator? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
365
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_CLOSING_ANGLE_BRACKET_IN_TYPE_ARGUMENTS, this.insert_space_after_closing_angle_bracket_in_type_arguments ? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
366
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_CLOSING_ANGLE_BRACKET_IN_TYPE_PARAMETERS, this.insert_space_after_closing_angle_bracket_in_type_parameters ? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
367
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_CLOSING_PAREN_IN_CAST, this.insert_space_after_closing_paren_in_cast? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
368
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_CLOSING_BRACE_IN_BLOCK, this.insert_space_after_closing_brace_in_block? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
369
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COLON_IN_ASSERT, this.insert_space_after_colon_in_assert ? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
370
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COLON_IN_CASE, this.insert_space_after_colon_in_case ? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
371
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COLON_IN_CONDITIONAL, this.insert_space_after_colon_in_conditional ? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
372
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COLON_IN_FOR, this.insert_space_after_colon_in_for ? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
373
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COLON_IN_LABELED_STATEMENT, this.insert_space_after_colon_in_labeled_statement? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
374
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ALLOCATION_EXPRESSION, this.insert_space_after_comma_in_allocation_expression? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
375
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ARRAY_INITIALIZER, this.insert_space_after_comma_in_array_initializer? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
376
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_CONSTRUCTOR_DECLARATION_PARAMETERS, this.insert_space_after_comma_in_constructor_declaration_parameters? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
377
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_CONSTRUCTOR_DECLARATION_THROWS, this.insert_space_after_comma_in_constructor_declaration_throws? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
378
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ENUM_CONSTANT_ARGUMENTS, this.insert_space_after_comma_in_enum_constant_arguments ? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
379
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ENUM_DECLARATIONS, this.insert_space_after_comma_in_enum_declarations ? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
380
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_EXPLICIT_CONSTRUCTOR_CALL_ARGUMENTS, this.insert_space_after_comma_in_explicit_constructor_call_arguments? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
381
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_FOR_INCREMENTS, this.insert_space_after_comma_in_for_increments? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
382
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_FOR_INITS, this.insert_space_after_comma_in_for_inits? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
383
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_METHOD_INVOCATION_ARGUMENTS, this.insert_space_after_comma_in_method_invocation_arguments? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
384
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_METHOD_DECLARATION_PARAMETERS, this.insert_space_after_comma_in_method_declaration_parameters? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
385
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_METHOD_DECLARATION_THROWS, this.insert_space_after_comma_in_method_declaration_throws? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
386
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_MULTIPLE_FIELD_DECLARATIONS, this.insert_space_after_comma_in_multiple_field_declarations? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
387
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_MULTIPLE_LOCAL_DECLARATIONS, this.insert_space_after_comma_in_multiple_local_declarations? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
388
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_PARAMETERIZED_TYPE_REFERENCE, this.insert_space_after_comma_in_parameterized_type_reference? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
389
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_SUPERINTERFACES, this.insert_space_after_comma_in_superinterfaces? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
390
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_TYPE_ARGUMENTS, this.insert_space_after_comma_in_type_arguments ? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
391
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_TYPE_PARAMETERS, this.insert_space_after_comma_in_type_parameters ? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
392
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACKET_IN_ARRAY_ALLOCATION_EXPRESSION, this.insert_space_after_opening_bracket_in_array_allocation_expression? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
393
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_ELLIPSIS, this.insert_space_after_ellipsis ? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
394
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_ANGLE_BRACKET_IN_PARAMETERIZED_TYPE_REFERENCE, this.insert_space_after_opening_angle_bracket_in_parameterized_type_reference? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
395
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_ANGLE_BRACKET_IN_TYPE_ARGUMENTS, this.insert_space_after_opening_angle_bracket_in_type_arguments? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
396
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_ANGLE_BRACKET_IN_TYPE_PARAMETERS, this.insert_space_after_opening_angle_bracket_in_type_parameters? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
397
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACKET_IN_ARRAY_REFERENCE, this.insert_space_after_opening_bracket_in_array_reference? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
398
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACE_IN_ARRAY_INITIALIZER, this.insert_space_after_opening_brace_in_array_initializer? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
399
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_CAST, this.insert_space_after_opening_paren_in_cast? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
400
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_CATCH, this.insert_space_after_opening_paren_in_catch? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
401
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_CONSTRUCTOR_DECLARATION, this.insert_space_after_opening_paren_in_constructor_declaration? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
402
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_ENUM_CONSTANT, this.insert_space_after_opening_paren_in_enum_constant? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
403
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_FOR, this.insert_space_after_opening_paren_in_for? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
404
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_IF, this.insert_space_after_opening_paren_in_if? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
405
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_METHOD_DECLARATION, this.insert_space_after_opening_paren_in_method_declaration? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
406
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_METHOD_INVOCATION, this.insert_space_after_opening_paren_in_method_invocation? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
407
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_PARENTHESIZED_EXPRESSION, this.insert_space_after_opening_paren_in_parenthesized_expression? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
408
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_SWITCH, this.insert_space_after_opening_paren_in_switch? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
409
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_SYNCHRONIZED, this.insert_space_after_opening_paren_in_synchronized? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
410
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_WHILE, this.insert_space_after_opening_paren_in_while? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
411
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_POSTFIX_OPERATOR, this.insert_space_after_postfix_operator? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
412
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_PREFIX_OPERATOR, this.insert_space_after_prefix_operator? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
413
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_QUESTION_IN_CONDITIONAL, this.insert_space_after_question_in_conditional? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
414
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_QUESTION_IN_WILDCARD, this.insert_space_after_question_in_wilcard? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
415
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_SEMICOLON_IN_FOR, this.insert_space_after_semicolon_in_for? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
416
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_UNARY_OPERATOR, this.insert_space_after_unary_operator? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
417
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_AND_IN_TYPE_PARAMETER, this.insert_space_before_and_in_type_parameter ? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
418
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_ASSIGNMENT_OPERATOR, this.insert_space_before_assignment_operator? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
419
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_BINARY_OPERATOR, this.insert_space_before_binary_operator? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
420
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_ANGLE_BRACKET_IN_PARAMETERIZED_TYPE_REFERENCE, this.insert_space_before_closing_angle_bracket_in_parameterized_type_reference? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
421
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_ANGLE_BRACKET_IN_TYPE_ARGUMENTS, this.insert_space_before_closing_angle_bracket_in_type_arguments? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
422
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_ANGLE_BRACKET_IN_TYPE_PARAMETERS, this.insert_space_before_closing_angle_bracket_in_type_parameters? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
423
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_BRACE_IN_ARRAY_INITIALIZER, this.insert_space_before_closing_brace_in_array_initializer? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
424
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_BRACKET_IN_ARRAY_ALLOCATION_EXPRESSION, this.insert_space_before_closing_bracket_in_array_allocation_expression? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
425
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_BRACKET_IN_ARRAY_REFERENCE, this.insert_space_before_closing_bracket_in_array_reference? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
426
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_CAST, this.insert_space_before_closing_paren_in_cast? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
427
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_CATCH, this.insert_space_before_closing_paren_in_catch? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
428
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_CONSTRUCTOR_DECLARATION, this.insert_space_before_closing_paren_in_constructor_declaration? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
429
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_ENUM_CONSTANT, this.insert_space_before_closing_paren_in_enum_constant? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
430
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_FOR, this.insert_space_before_closing_paren_in_for? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
431
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_IF, this.insert_space_before_closing_paren_in_if? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
432
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_METHOD_DECLARATION, this.insert_space_before_closing_paren_in_method_declaration? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
433
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_METHOD_INVOCATION, this.insert_space_before_closing_paren_in_method_invocation? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
434
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_PARENTHESIZED_EXPRESSION, this.insert_space_before_closing_paren_in_parenthesized_expression? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
435
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_SWITCH, this.insert_space_before_closing_paren_in_switch? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
436
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_SYNCHRONIZED, this.insert_space_before_closing_paren_in_synchronized? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
437
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_WHILE, this.insert_space_before_closing_paren_in_while? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
438
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_ASSERT, this.insert_space_before_colon_in_assert? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
439
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_CASE, this.insert_space_before_colon_in_case? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
440
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_CONDITIONAL, this.insert_space_before_colon_in_conditional? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
441
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_DEFAULT, this.insert_space_before_colon_in_default? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
442
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_FOR, this.insert_space_before_colon_in_for ? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
443
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_LABELED_STATEMENT, this.insert_space_before_colon_in_labeled_statement? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
444
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ALLOCATION_EXPRESSION, this.insert_space_before_comma_in_allocation_expression? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
445
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ARRAY_INITIALIZER, this.insert_space_before_comma_in_array_initializer? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
446
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_CONSTRUCTOR_DECLARATION_PARAMETERS, this.insert_space_before_comma_in_constructor_declaration_parameters? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
447
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_CONSTRUCTOR_DECLARATION_THROWS, this.insert_space_before_comma_in_constructor_declaration_throws? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
448
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ENUM_CONSTANT_ARGUMENTS, this.insert_space_before_comma_in_enum_constant_arguments? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
449
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ENUM_DECLARATIONS, this.insert_space_before_comma_in_enum_declarations? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
450
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_EXPLICIT_CONSTRUCTOR_CALL_ARGUMENTS, this.insert_space_before_comma_in_explicit_constructor_call_arguments? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
451
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_FOR_INCREMENTS, this.insert_space_before_comma_in_for_increments? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
452
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_FOR_INITS, this.insert_space_before_comma_in_for_inits? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
453
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_METHOD_INVOCATION_ARGUMENTS, this.insert_space_before_comma_in_method_invocation_arguments? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
454
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_METHOD_DECLARATION_PARAMETERS, this.insert_space_before_comma_in_method_declaration_parameters? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
455
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_METHOD_DECLARATION_THROWS, this.insert_space_before_comma_in_method_declaration_throws? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
456
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_MULTIPLE_FIELD_DECLARATIONS, this.insert_space_before_comma_in_multiple_field_declarations? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
457
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_MULTIPLE_LOCAL_DECLARATIONS, this.insert_space_before_comma_in_multiple_local_declarations? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
458
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_SUPERINTERFACES, this.insert_space_before_comma_in_superinterfaces? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
459
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_TYPE_ARGUMENTS, this.insert_space_before_comma_in_type_arguments ? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
460
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_TYPE_PARAMETERS, this.insert_space_before_comma_in_type_parameters? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
461
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_PARAMETERIZED_TYPE_REFERENCE, this.insert_space_before_comma_in_parameterized_type_reference? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
462
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_ELLIPSIS, this.insert_space_before_ellipsis ? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
463
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_ANGLE_BRACKET_IN_PARAMETERIZED_TYPE_REFERENCE, this.insert_space_before_opening_angle_bracket_in_parameterized_type_reference? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
464
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_ANGLE_BRACKET_IN_TYPE_ARGUMENTS, this.insert_space_before_opening_angle_bracket_in_type_arguments? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
465
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_ANGLE_BRACKET_IN_TYPE_PARAMETERS, this.insert_space_before_opening_angle_bracket_in_type_parameters? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
466
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ARRAY_INITIALIZER, this.insert_space_before_opening_brace_in_array_initializer? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
467
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_BLOCK, this.insert_space_before_opening_brace_in_block? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
468
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_CONSTRUCTOR_DECLARATION, this.insert_space_before_opening_brace_in_constructor_declaration? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
469
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ENUM_CONSTANT, this.insert_space_before_opening_brace_in_enum_constant? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
470
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ENUM_DECLARATION, this.insert_space_before_opening_brace_in_enum_declaration? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
471
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_METHOD_DECLARATION, this.insert_space_before_opening_brace_in_method_declaration? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
472
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_TYPE_DECLARATION, this.insert_space_before_opening_brace_in_type_declaration? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
473
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACKET_IN_ARRAY_ALLOCATION_EXPRESSION, this.insert_space_before_opening_bracket_in_array_allocation_expression ? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
474
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACKET_IN_ARRAY_REFERENCE, this.insert_space_before_opening_bracket_in_array_reference? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
475
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACKET_IN_ARRAY_TYPE_REFERENCE, this.insert_space_before_opening_bracket_in_array_type_reference? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
476
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_CATCH, this.insert_space_before_opening_paren_in_catch? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
477
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_CONSTRUCTOR_DECLARATION, this.insert_space_before_opening_paren_in_constructor_declaration? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
478
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_ENUM_CONSTANT, this.insert_space_before_opening_paren_in_enum_constant? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
479
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_FOR, this.insert_space_before_opening_paren_in_for? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
480
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_IF, this.insert_space_before_opening_paren_in_if? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
481
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_METHOD_INVOCATION, this.insert_space_before_opening_paren_in_method_invocation? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
482
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_METHOD_DECLARATION, this.insert_space_before_opening_paren_in_method_declaration? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
483
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_SWITCH, this.insert_space_before_opening_paren_in_switch? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
484
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_SWITCH, this.insert_space_before_opening_brace_in_switch? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
485
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_SYNCHRONIZED, this.insert_space_before_opening_paren_in_synchronized? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
486
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_PARENTHESIZED_EXPRESSION, this.insert_space_before_opening_paren_in_parenthesized_expression? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
487
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_WHILE, this.insert_space_before_opening_paren_in_while? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
488
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_PARENTHESIZED_EXPRESSION_IN_RETURN, this.insert_space_before_parenthesized_expression_in_return ? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
489
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_POSTFIX_OPERATOR, this.insert_space_before_postfix_operator? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
490
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_PREFIX_OPERATOR, this.insert_space_before_prefix_operator? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
491
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_QUESTION_IN_CONDITIONAL, this.insert_space_before_question_in_conditional? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
492
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_QUESTION_IN_WILDCARD, this.insert_space_before_question_in_wilcard? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
493
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_SEMICOLON, this.insert_space_before_semicolon? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
494
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_SEMICOLON_IN_FOR, this.insert_space_before_semicolon_in_for? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
495
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_UNARY_OPERATOR, this.insert_space_before_unary_operator? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
496
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_BRACKETS_IN_ARRAY_TYPE_REFERENCE, this.insert_space_between_brackets_in_array_type_reference? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
497
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_BRACES_IN_ARRAY_INITIALIZER, this.insert_space_between_empty_braces_in_array_initializer? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
498
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_BRACKETS_IN_ARRAY_ALLOCATION_EXPRESSION, this.insert_space_between_empty_brackets_in_array_allocation_expression? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
499
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_CONSTRUCTOR_DECLARATION, this.insert_space_between_empty_parens_in_constructor_declaration? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
500
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_ENUM_CONSTANT, this.insert_space_between_empty_parens_in_enum_constant? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
501
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_METHOD_DECLARATION, this.insert_space_between_empty_parens_in_method_declaration? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
502
//		options.put(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_METHOD_INVOCATION, this.insert_space_between_empty_parens_in_method_invocation? CCorePlugin.INSERT : CCorePlugin.DO_NOT_INSERT);
503
//		options.put(CodeFormatterConstants.FORMATTER_COMPACT_ELSE_IF, this.compact_else_if ? CodeFormatterConstants.TRUE : CodeFormatterConstants.FALSE);
504
//		options.put(CodeFormatterConstants.FORMATTER_KEEP_GUARDIAN_CLAUSE_ON_ONE_LINE, this.keep_guardian_clause_on_one_line ? CodeFormatterConstants.TRUE : CodeFormatterConstants.FALSE);
505
//		options.put(CodeFormatterConstants.FORMATTER_KEEP_ELSE_STATEMENT_ON_SAME_LINE, this.keep_else_statement_on_same_line ? CodeFormatterConstants.TRUE : CodeFormatterConstants.FALSE);
506
//		options.put(CodeFormatterConstants.FORMATTER_KEEP_EMPTY_ARRAY_INITIALIZER_ON_ONE_LINE, this.keep_empty_array_initializer_on_one_line ? CodeFormatterConstants.TRUE : CodeFormatterConstants.FALSE);
507
//		options.put(CodeFormatterConstants.FORMATTER_KEEP_SIMPLE_IF_ON_ONE_LINE, this.keep_simple_if_on_one_line ? CodeFormatterConstants.TRUE : CodeFormatterConstants.FALSE);
508
//		options.put(CodeFormatterConstants.FORMATTER_KEEP_THEN_STATEMENT_ON_SAME_LINE, this.keep_then_statement_on_same_line ? CodeFormatterConstants.TRUE : CodeFormatterConstants.FALSE);
509
//		options.put(CodeFormatterConstants.FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE, Integer.toString(this.number_of_empty_lines_to_preserve));
510
//		options.put(CodeFormatterConstants.FORMATTER_PUT_EMPTY_STATEMENT_ON_NEW_LINE, this.put_empty_statement_on_new_line ? CodeFormatterConstants.TRUE : CodeFormatterConstants.FALSE);
511
//		options.put(CodeFormatterConstants.FORMATTER_LINE_SPLIT, Integer.toString(this.page_width));
512
		switch(this.tab_char) {
513
			case SPACE :
514
				options.put(CodeFormatterConstants.FORMATTER_TAB_CHAR, CCorePlugin.SPACE);
515
				break;
516
			case TAB :
517
				options.put(CodeFormatterConstants.FORMATTER_TAB_CHAR, CCorePlugin.TAB);
518
				break;
519
			case MIXED :
520
				options.put(CodeFormatterConstants.FORMATTER_TAB_CHAR, CodeFormatterConstants.MIXED);
521
				break;
522
		}
523
		options.put(CodeFormatterConstants.FORMATTER_TAB_SIZE, Integer.toString(this.tab_size));
524
		options.put(CodeFormatterConstants.FORMATTER_USE_TABS_ONLY_FOR_LEADING_INDENTATIONS, this.use_tabs_only_for_leading_indentations ?  CodeFormatterConstants.TRUE : CodeFormatterConstants.FALSE);
525
		return options;
526
	}
527
528
	public void set(Map settings) {
529
		final Object alignmentForArgumentsInAllocationExpressionOption = settings.get(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_ALLOCATION_EXPRESSION);
530
		if (alignmentForArgumentsInAllocationExpressionOption != null) {
531
			try {
532
				this.alignment_for_arguments_in_allocation_expression = Integer.parseInt((String) alignmentForArgumentsInAllocationExpressionOption);
533
			} catch (NumberFormatException e) {
534
				this.alignment_for_arguments_in_allocation_expression = Alignment.M_COMPACT_SPLIT;
535
			} catch (ClassCastException e) {
536
				this.alignment_for_arguments_in_allocation_expression = Alignment.M_COMPACT_SPLIT;
537
			}
538
		}
539
		final Object alignmentForArgumentsInEnumConstantOption = settings.get(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_ENUM_CONSTANT);
540
		if (alignmentForArgumentsInEnumConstantOption != null) {
541
			try {
542
				this.alignment_for_arguments_in_enum_constant = Integer.parseInt((String) alignmentForArgumentsInEnumConstantOption);
543
			} catch (NumberFormatException e) {
544
				this.alignment_for_arguments_in_enum_constant = Alignment.M_COMPACT_SPLIT;
545
			} catch (ClassCastException e) {
546
				this.alignment_for_arguments_in_enum_constant = Alignment.M_COMPACT_SPLIT;
547
			}
548
		}
549
		final Object alignmentForArgumentsInExplicitConstructorCallOption = settings.get(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_EXPLICIT_CONSTRUCTOR_CALL);
550
		if (alignmentForArgumentsInExplicitConstructorCallOption != null) {
551
			try {
552
				this.alignment_for_arguments_in_explicit_constructor_call = Integer.parseInt((String) alignmentForArgumentsInExplicitConstructorCallOption);
553
			} catch (NumberFormatException e) {
554
				this.alignment_for_arguments_in_explicit_constructor_call = Alignment.M_COMPACT_SPLIT;
555
			} catch (ClassCastException e) {
556
				this.alignment_for_arguments_in_explicit_constructor_call = Alignment.M_COMPACT_SPLIT;
557
			}
558
		}
559
		final Object alignmentForArgumentsInMethodInvocationOption = settings.get(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_METHOD_INVOCATION);
560
		if (alignmentForArgumentsInMethodInvocationOption != null) {
561
			try {
562
				this.alignment_for_arguments_in_method_invocation = Integer.parseInt((String) alignmentForArgumentsInMethodInvocationOption);
563
			} catch (NumberFormatException e) {
564
				this.alignment_for_arguments_in_method_invocation = Alignment.M_COMPACT_SPLIT;
565
			} catch (ClassCastException e) {
566
				this.alignment_for_arguments_in_method_invocation = Alignment.M_COMPACT_SPLIT;
567
			}
568
		}
569
		final Object alignmentForArgumentsInQualifiedAllocationExpressionOption = settings.get(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_QUALIFIED_ALLOCATION_EXPRESSION);
570
		if (alignmentForArgumentsInQualifiedAllocationExpressionOption != null) {
571
			try {
572
				this.alignment_for_arguments_in_qualified_allocation_expression = Integer.parseInt((String) alignmentForArgumentsInQualifiedAllocationExpressionOption);
573
			} catch (NumberFormatException e) {
574
				this.alignment_for_arguments_in_qualified_allocation_expression = Alignment.M_COMPACT_SPLIT;
575
			} catch (ClassCastException e) {
576
				this.alignment_for_arguments_in_qualified_allocation_expression = Alignment.M_COMPACT_SPLIT;
577
			}
578
		}
579
		final Object alignmentForAssignmentOption = settings.get(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ASSIGNMENT);
580
		if (alignmentForAssignmentOption != null) {
581
			try {
582
				this.alignment_for_assignment = Integer.parseInt((String) alignmentForAssignmentOption);
583
			} catch (NumberFormatException e) {
584
				this.alignment_for_assignment =  Alignment.M_ONE_PER_LINE_SPLIT;
585
			} catch (ClassCastException e) {
586
				this.alignment_for_assignment =  Alignment.M_ONE_PER_LINE_SPLIT;
587
			}
588
		}
589
		final Object alignmentForBinaryExpressionOption = settings.get(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_BINARY_EXPRESSION);
590
		if (alignmentForBinaryExpressionOption != null) {
591
			try {
592
				this.alignment_for_binary_expression = Integer.parseInt((String) alignmentForBinaryExpressionOption);
593
			} catch (NumberFormatException e) {
594
				this.alignment_for_binary_expression =  Alignment.M_COMPACT_SPLIT;
595
			} catch (ClassCastException e) {
596
				this.alignment_for_binary_expression =  Alignment.M_COMPACT_SPLIT;
597
			}
598
		}
599
		final Object alignmentForCompactIfOption = settings.get(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_COMPACT_IF);
600
		if (alignmentForCompactIfOption != null) {
601
			try {
602
				this.alignment_for_compact_if = Integer.parseInt((String) alignmentForCompactIfOption);
603
			} catch (NumberFormatException e) {
604
				this.alignment_for_compact_if = Alignment.M_ONE_PER_LINE_SPLIT | Alignment.M_INDENT_BY_ONE;
605
			} catch (ClassCastException e) {
606
				this.alignment_for_compact_if = Alignment.M_ONE_PER_LINE_SPLIT | Alignment.M_INDENT_BY_ONE;
607
			}
608
		}
609
		final Object alignmentForConditionalExpressionOption = settings.get(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_CONDITIONAL_EXPRESSION);
610
		if (alignmentForConditionalExpressionOption != null) {
611
			try {
612
				this.alignment_for_conditional_expression = Integer.parseInt((String) alignmentForConditionalExpressionOption);
613
			} catch (NumberFormatException e) {
614
				this.alignment_for_conditional_expression = Alignment.M_ONE_PER_LINE_SPLIT;
615
			} catch (ClassCastException e) {
616
				this.alignment_for_conditional_expression = Alignment.M_ONE_PER_LINE_SPLIT;
617
			}
618
		}
619
		final Object alignmentForEnumConstantsOption = settings.get(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ENUM_CONSTANTS);
620
		if (alignmentForEnumConstantsOption != null) {
621
			try {
622
				this.alignment_for_enum_constants = Integer.parseInt((String) alignmentForEnumConstantsOption);
623
			} catch (NumberFormatException e) {
624
				this.alignment_for_enum_constants = Alignment.NONE;
625
			} catch (ClassCastException e) {
626
				this.alignment_for_enum_constants = Alignment.NONE;
627
			}
628
		}
629
		final Object alignmentForExpressionsInArrayInitializerOption = settings.get(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER);
630
		if (alignmentForExpressionsInArrayInitializerOption != null) {
631
			try {
632
				this.alignment_for_expressions_in_array_initializer = Integer.parseInt((String) alignmentForExpressionsInArrayInitializerOption);
633
			} catch (NumberFormatException e) {
634
				this.alignment_for_expressions_in_array_initializer = Alignment.M_COMPACT_SPLIT;
635
			} catch (ClassCastException e) {
636
				this.alignment_for_expressions_in_array_initializer = Alignment.M_COMPACT_SPLIT;
637
			}
638
		}
639
		final Object alignmentForMultipleFieldsOption = settings.get(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_MULTIPLE_FIELDS);
640
		if (alignmentForMultipleFieldsOption != null) {
641
			try {
642
				this.alignment_for_multiple_fields = Integer.parseInt((String) alignmentForMultipleFieldsOption);
643
			} catch (NumberFormatException e) {
644
				this.alignment_for_multiple_fields = Alignment.M_COMPACT_SPLIT;
645
			} catch (ClassCastException e) {
646
				this.alignment_for_multiple_fields = Alignment.M_COMPACT_SPLIT;
647
			}
648
		}
649
		final Object alignmentForParametersInConstructorDeclarationOption = settings.get(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_CONSTRUCTOR_DECLARATION);
650
		if (alignmentForParametersInConstructorDeclarationOption != null) {
651
			try {
652
				this.alignment_for_parameters_in_constructor_declaration = Integer.parseInt((String) alignmentForParametersInConstructorDeclarationOption);
653
			} catch (NumberFormatException e) {
654
				this.alignment_for_parameters_in_constructor_declaration = Alignment.M_COMPACT_SPLIT;
655
			} catch (ClassCastException e) {
656
				this.alignment_for_parameters_in_constructor_declaration = Alignment.M_COMPACT_SPLIT;
657
			}
658
		}
659
		final Object alignmentForParametersInMethodDeclarationOption = settings.get(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_METHOD_DECLARATION);
660
		if (alignmentForParametersInMethodDeclarationOption != null) {
661
			try {
662
				this.alignment_for_parameters_in_method_declaration = Integer.parseInt((String) alignmentForParametersInMethodDeclarationOption);
663
			} catch (NumberFormatException e) {
664
				this.alignment_for_parameters_in_method_declaration = Alignment.M_COMPACT_SPLIT;
665
			} catch(ClassCastException e) {
666
				this.alignment_for_parameters_in_method_declaration = Alignment.M_COMPACT_SPLIT;
667
			}
668
		}
669
		final Object alignmentForSelectorInMethodInvocationOption = settings.get(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_SELECTOR_IN_METHOD_INVOCATION);
670
		if (alignmentForSelectorInMethodInvocationOption != null) {
671
			try {
672
				this.alignment_for_selector_in_method_invocation = Integer.parseInt((String) alignmentForSelectorInMethodInvocationOption);
673
			} catch (NumberFormatException e) {
674
				this.alignment_for_selector_in_method_invocation = Alignment.M_COMPACT_SPLIT;
675
			} catch(ClassCastException e) {
676
				this.alignment_for_selector_in_method_invocation = Alignment.M_COMPACT_SPLIT;
677
			}
678
		}
679
		final Object alignmentForSuperclassInTypeDeclarationOption = settings.get(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_SUPERCLASS_IN_TYPE_DECLARATION);
680
		if (alignmentForSuperclassInTypeDeclarationOption != null) {
681
			try {
682
				this.alignment_for_superclass_in_type_declaration = Integer.parseInt((String) alignmentForSuperclassInTypeDeclarationOption);
683
			} catch (NumberFormatException e) {
684
				this.alignment_for_superclass_in_type_declaration = Alignment.M_NEXT_SHIFTED_SPLIT;
685
			} catch(ClassCastException e) {
686
				this.alignment_for_superclass_in_type_declaration = Alignment.M_NEXT_SHIFTED_SPLIT;
687
			}
688
		}
689
		final Object alignmentForSuperinterfacesInEnumDeclarationOption = settings.get(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_SUPERINTERFACES_IN_ENUM_DECLARATION);
690
		if (alignmentForSuperinterfacesInEnumDeclarationOption != null) {
691
			try {
692
				this.alignment_for_superinterfaces_in_enum_declaration = Integer.parseInt((String) alignmentForSuperinterfacesInEnumDeclarationOption);
693
			} catch (NumberFormatException e) {
694
				this.alignment_for_superinterfaces_in_enum_declaration = Alignment.M_NEXT_SHIFTED_SPLIT;
695
			} catch(ClassCastException e) {
696
				this.alignment_for_superinterfaces_in_enum_declaration = Alignment.M_NEXT_SHIFTED_SPLIT;
697
			}
698
		}
699
		final Object alignmentForSuperinterfacesInTypeDeclarationOption = settings.get(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_SUPERINTERFACES_IN_TYPE_DECLARATION);
700
		if (alignmentForSuperinterfacesInTypeDeclarationOption != null) {
701
			try {
702
				this.alignment_for_superinterfaces_in_type_declaration = Integer.parseInt((String) alignmentForSuperinterfacesInTypeDeclarationOption);
703
			} catch (NumberFormatException e) {
704
				this.alignment_for_superinterfaces_in_type_declaration = Alignment.M_NEXT_SHIFTED_SPLIT;
705
			} catch(ClassCastException e) {
706
				this.alignment_for_superinterfaces_in_type_declaration = Alignment.M_NEXT_SHIFTED_SPLIT;
707
			}
708
		}
709
		final Object alignmentForThrowsClauseInConstructorDeclarationOption = settings.get(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_THROWS_CLAUSE_IN_CONSTRUCTOR_DECLARATION);
710
		if (alignmentForThrowsClauseInConstructorDeclarationOption != null) {
711
			try {
712
				this.alignment_for_throws_clause_in_constructor_declaration = Integer.parseInt((String) alignmentForThrowsClauseInConstructorDeclarationOption);
713
			} catch (NumberFormatException e) {
714
				this.alignment_for_throws_clause_in_constructor_declaration = Alignment.M_COMPACT_SPLIT;
715
			} catch(ClassCastException e) {
716
				this.alignment_for_throws_clause_in_constructor_declaration = Alignment.M_COMPACT_SPLIT;
717
			}
718
		}
719
		final Object alignmentForThrowsClauseInMethodDeclarationOption = settings.get(CodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_THROWS_CLAUSE_IN_METHOD_DECLARATION);
720
		if (alignmentForThrowsClauseInMethodDeclarationOption != null) {
721
			try {
722
				this.alignment_for_throws_clause_in_method_declaration = Integer.parseInt((String) alignmentForThrowsClauseInMethodDeclarationOption);
723
			} catch (NumberFormatException e) {
724
				this.alignment_for_throws_clause_in_method_declaration = Alignment.M_COMPACT_SPLIT;
725
			} catch(ClassCastException e) {
726
				this.alignment_for_throws_clause_in_method_declaration = Alignment.M_COMPACT_SPLIT;
727
			}
728
		}
729
		final Object alignTypeMembersOnColumnsOption = settings.get(CodeFormatterConstants.FORMATTER_ALIGN_TYPE_MEMBERS_ON_COLUMNS);
730
		if (alignTypeMembersOnColumnsOption != null) {
731
			this.align_type_members_on_columns = CodeFormatterConstants.TRUE.equals(alignTypeMembersOnColumnsOption);
732
		}
733
		final Object bracePositionForArrayInitializerOption = settings.get(CodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ARRAY_INITIALIZER);
734
		if (bracePositionForArrayInitializerOption != null) {
735
			try {
736
				this.brace_position_for_array_initializer = (String) bracePositionForArrayInitializerOption;
737
			} catch(ClassCastException e) {
738
				this.brace_position_for_array_initializer = CodeFormatterConstants.END_OF_LINE;
739
			}
740
		}
741
		final Object bracePositionForBlockOption = settings.get(CodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK);
742
		if (bracePositionForBlockOption != null) {
743
			try {
744
				this.brace_position_for_block = (String) bracePositionForBlockOption;
745
			} catch(ClassCastException e) {
746
				this.brace_position_for_block = CodeFormatterConstants.END_OF_LINE;
747
			}
748
		}
749
		final Object bracePositionForBlockInCaseOption = settings.get(CodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK_IN_CASE);
750
		if (bracePositionForBlockInCaseOption != null) {
751
			try {
752
				this.brace_position_for_block_in_case = (String) bracePositionForBlockInCaseOption;
753
			} catch(ClassCastException e) {
754
				this.brace_position_for_block_in_case = CodeFormatterConstants.END_OF_LINE;
755
			}
756
		}
757
		final Object bracePositionForConstructorDeclarationOption = settings.get(CodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION);
758
		if (bracePositionForConstructorDeclarationOption != null) {
759
			try {
760
				this.brace_position_for_constructor_declaration = (String) bracePositionForConstructorDeclarationOption;
761
			} catch(ClassCastException e) {
762
				this.brace_position_for_constructor_declaration = CodeFormatterConstants.END_OF_LINE;
763
			}
764
		}
765
		final Object bracePositionForEnumConstantOption = settings.get(CodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ENUM_CONSTANT);
766
		if (bracePositionForEnumConstantOption != null) {
767
			try {
768
				this.brace_position_for_enum_constant = (String) bracePositionForEnumConstantOption;
769
			} catch(ClassCastException e) {
770
				this.brace_position_for_enum_constant = CodeFormatterConstants.END_OF_LINE;
771
			}
772
		}
773
		final Object bracePositionForEnumDeclarationOption = settings.get(CodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ENUM_DECLARATION);
774
		if (bracePositionForEnumDeclarationOption != null) {
775
			try {
776
				this.brace_position_for_enum_declaration = (String) bracePositionForEnumDeclarationOption;
777
			} catch(ClassCastException e) {
778
				this.brace_position_for_enum_declaration = CodeFormatterConstants.END_OF_LINE;
779
			}
780
		}
781
		final Object bracePositionForMethodDeclarationOption = settings.get(CodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION);
782
		if (bracePositionForMethodDeclarationOption != null) {
783
			try {
784
				this.brace_position_for_method_declaration = (String) bracePositionForMethodDeclarationOption;
785
			} catch(ClassCastException e) {
786
				this.brace_position_for_method_declaration = CodeFormatterConstants.END_OF_LINE;
787
			}
788
		}
789
		final Object bracePositionForSwitchOption = settings.get(CodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_SWITCH);
790
		if (bracePositionForSwitchOption != null) {
791
			try {
792
				this.brace_position_for_switch = (String) bracePositionForSwitchOption;
793
			} catch(ClassCastException e) {
794
				this.brace_position_for_switch = CodeFormatterConstants.END_OF_LINE;
795
			}
796
		}
797
		final Object bracePositionForTypeDeclarationOption = settings.get(CodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION);
798
		if (bracePositionForTypeDeclarationOption != null) {
799
			try {
800
				this.brace_position_for_type_declaration = (String) bracePositionForTypeDeclarationOption;
801
			} catch(ClassCastException e) {
802
				this.brace_position_for_type_declaration = CodeFormatterConstants.END_OF_LINE;
803
			}
804
		}
805
		final Object continuationIndentationOption = settings.get(CodeFormatterConstants.FORMATTER_CONTINUATION_INDENTATION);
806
		if (continuationIndentationOption != null) {
807
			try {
808
				this.continuation_indentation = Integer.parseInt((String) continuationIndentationOption);
809
			} catch (NumberFormatException e) {
810
				this.continuation_indentation = 2;
811
			} catch(ClassCastException e) {
812
				this.continuation_indentation = 2;
813
			}
814
		}
815
		final Object continuationIndentationForArrayInitializerOption = settings.get(CodeFormatterConstants.FORMATTER_CONTINUATION_INDENTATION_FOR_ARRAY_INITIALIZER);
816
		if (continuationIndentationForArrayInitializerOption != null) {
817
			try {
818
				this.continuation_indentation_for_array_initializer = Integer.parseInt((String) continuationIndentationForArrayInitializerOption);
819
			} catch (NumberFormatException e) {
820
				this.continuation_indentation_for_array_initializer = 2;
821
			} catch(ClassCastException e) {
822
				this.continuation_indentation_for_array_initializer = 2;
823
			}
824
		}
825
//		final Object blankLinesAfterImportsOption = settings.get(CodeFormatterConstants.FORMATTER_BLANK_LINES_AFTER_IMPORTS);
826
//		if (blankLinesAfterImportsOption != null) {
827
//			try {
828
//				this.blank_lines_after_imports = Integer.parseInt((String) blankLinesAfterImportsOption);
829
//			} catch (NumberFormatException e) {
830
//				this.blank_lines_after_imports = 0;
831
//			} catch(ClassCastException e) {
832
//				this.blank_lines_after_imports = 0;
833
//			}
834
//		}
835
//		final Object blankLinesAfterPackageOption = settings.get(CodeFormatterConstants.FORMATTER_BLANK_LINES_AFTER_PACKAGE);
836
//		if (blankLinesAfterPackageOption != null) {
837
//			try {
838
//				this.blank_lines_after_package = Integer.parseInt((String) blankLinesAfterPackageOption);
839
//			} catch (NumberFormatException e) {
840
//				this.blank_lines_after_package = 0;
841
//			} catch(ClassCastException e) {
842
//				this.blank_lines_after_package = 0;
843
//			}
844
//		}
845
//		final Object blankLinesBeforeFieldOption = settings.get(CodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_FIELD);
846
//		if (blankLinesBeforeFieldOption != null) {
847
//			try {
848
//				this.blank_lines_before_field = Integer.parseInt((String) blankLinesBeforeFieldOption);
849
//			} catch (NumberFormatException e) {
850
//				this.blank_lines_before_field = 0;
851
//			} catch(ClassCastException e) {
852
//				this.blank_lines_before_field = 0;
853
//			}
854
//		}
855
//		final Object blankLinesBeforeFirstClassBodyDeclarationOption = settings.get(CodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_FIRST_CLASS_BODY_DECLARATION);
856
//		if (blankLinesBeforeFirstClassBodyDeclarationOption != null) {
857
//			try {
858
//				this.blank_lines_before_first_class_body_declaration = Integer.parseInt((String) blankLinesBeforeFirstClassBodyDeclarationOption);
859
//			} catch (NumberFormatException e) {
860
//				this.blank_lines_before_first_class_body_declaration = 0;
861
//			} catch(ClassCastException e) {
862
//				this.blank_lines_before_first_class_body_declaration = 0;
863
//			}
864
//		}
865
//		final Object blankLinesBeforeImportsOption = settings.get(CodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_IMPORTS);
866
//		if (blankLinesBeforeImportsOption != null) {
867
//			try {
868
//				this.blank_lines_before_imports = Integer.parseInt((String) blankLinesBeforeImportsOption);
869
//			} catch (NumberFormatException e) {
870
//				this.blank_lines_before_imports = 0;
871
//			} catch(ClassCastException e) {
872
//				this.blank_lines_before_imports = 0;
873
//			}
874
//		}
875
//		final Object blankLinesBeforeMemberTypeOption = settings.get(CodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_MEMBER_TYPE);
876
//		if (blankLinesBeforeMemberTypeOption != null) {
877
//			try {
878
//				this.blank_lines_before_member_type = Integer.parseInt((String) blankLinesBeforeMemberTypeOption);
879
//			} catch (NumberFormatException e) {
880
//				this.blank_lines_before_member_type = 0;
881
//			} catch(ClassCastException e) {
882
//				this.blank_lines_before_member_type = 0;
883
//			}
884
//		}
885
//		final Object blankLinesBeforeMethodOption = settings.get(CodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_METHOD);
886
//		if (blankLinesBeforeMethodOption != null) {
887
//			try {
888
//				this.blank_lines_before_method = Integer.parseInt((String) blankLinesBeforeMethodOption);
889
//			} catch (NumberFormatException e) {
890
//				this.blank_lines_before_method = 0;
891
//			} catch(ClassCastException e) {
892
//				this.blank_lines_before_method = 0;
893
//			}
894
//		}
895
//		final Object blankLinesBeforeNewChunkOption = settings.get(CodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_NEW_CHUNK);
896
//		if (blankLinesBeforeNewChunkOption != null) {
897
//			try {
898
//				this.blank_lines_before_new_chunk = Integer.parseInt((String) blankLinesBeforeNewChunkOption);
899
//			} catch (NumberFormatException e) {
900
//				this.blank_lines_before_new_chunk = 0;
901
//			} catch(ClassCastException e) {
902
//				this.blank_lines_before_new_chunk = 0;
903
//			}
904
//		}
905
//		final Object blankLinesBeforePackageOption = settings.get(CodeFormatterConstants.FORMATTER_BLANK_LINES_BEFORE_PACKAGE);
906
//		if (blankLinesBeforePackageOption != null) {
907
//			try {
908
//				this.blank_lines_before_package = Integer.parseInt((String) blankLinesBeforePackageOption);
909
//			} catch (NumberFormatException e) {
910
//				this.blank_lines_before_package = 0;
911
//			} catch(ClassCastException e) {
912
//				this.blank_lines_before_package = 0;
913
//			}
914
//		}
915
//		final Object blankLinesBetweenTypeDeclarationsOption = settings.get(CodeFormatterConstants.FORMATTER_BLANK_LINES_BETWEEN_TYPE_DECLARATIONS);
916
//		if (blankLinesBetweenTypeDeclarationsOption != null) {
917
//			try {
918
//				this.blank_lines_between_type_declarations = Integer.parseInt((String) blankLinesBetweenTypeDeclarationsOption);
919
//			} catch (NumberFormatException e) {
920
//				this.blank_lines_between_type_declarations = 0;
921
//			} catch(ClassCastException e) {
922
//				this.blank_lines_between_type_declarations = 0;
923
//			}
924
//		}
925
//		final Object blankLinesAtBeginningOfMethodBodyOption = settings.get(CodeFormatterConstants.FORMATTER_BLANK_LINES_AT_BEGINNING_OF_METHOD_BODY);
926
//		if (blankLinesAtBeginningOfMethodBodyOption != null) {
927
//			try {
928
//				this.blank_lines_at_beginning_of_method_body = Integer.parseInt((String) blankLinesAtBeginningOfMethodBodyOption);
929
//			} catch (NumberFormatException e) {
930
//				this.blank_lines_at_beginning_of_method_body = 0;
931
//			} catch(ClassCastException e) {
932
//				this.blank_lines_at_beginning_of_method_body = 0;
933
//			}
934
//		}
935
//		final Object commentClearBlankLinesOption = settings.get(CodeFormatterConstants.FORMATTER_COMMENT_CLEAR_BLANK_LINES);
936
//		if (commentClearBlankLinesOption != null) {
937
//			this.comment_clear_blank_lines = CodeFormatterConstants.TRUE.equals(commentClearBlankLinesOption);
938
//		}
939
//		final Object commentFormatOption = settings.get(CodeFormatterConstants.FORMATTER_COMMENT_FORMAT);
940
//		if (commentFormatOption != null) {
941
//			this.comment_format = CodeFormatterConstants.TRUE.equals(commentFormatOption);
942
//		}
943
//		final Object commentFormatHeaderOption = settings.get(CodeFormatterConstants.FORMATTER_COMMENT_FORMAT_HEADER);
944
//		if (commentFormatHeaderOption != null) {
945
//			this.comment_format_header = CodeFormatterConstants.TRUE.equals(commentFormatHeaderOption);
946
//		}
947
//		final Object commentFormatHtmlOption = settings.get(CodeFormatterConstants.FORMATTER_COMMENT_FORMAT_HTML);
948
//		if (commentFormatHtmlOption != null) {
949
//			this.comment_format_html = CodeFormatterConstants.TRUE.equals(commentFormatHtmlOption);
950
//		}
951
//		final Object commentFormatSourceOption = settings.get(CodeFormatterConstants.FORMATTER_COMMENT_FORMAT_SOURCE);
952
//		if (commentFormatSourceOption != null) {
953
//			this.comment_format_source = CodeFormatterConstants.TRUE.equals(commentFormatSourceOption);
954
//		}
955
//		final Object commentLineLengthOption = settings.get(CodeFormatterConstants.FORMATTER_COMMENT_LINE_LENGTH);
956
//		if (commentLineLengthOption != null) {
957
//			try {
958
//				this.comment_line_length = Integer.parseInt((String) commentLineLengthOption);
959
//			} catch (NumberFormatException e) {
960
//				this.comment_line_length = 80;
961
//			} catch(ClassCastException e) {
962
//				this.comment_line_length = 80;
963
//			}
964
//		}
965
		final Object indentStatementsCompareToBlockOption = settings.get(CodeFormatterConstants.FORMATTER_INDENT_STATEMENTS_COMPARE_TO_BLOCK);
966
		if (indentStatementsCompareToBlockOption != null) {
967
			this.indent_statements_compare_to_block = CodeFormatterConstants.TRUE.equals(indentStatementsCompareToBlockOption);
968
		}
969
		final Object indentStatementsCompareToBodyOption = settings.get(CodeFormatterConstants.FORMATTER_INDENT_STATEMENTS_COMPARE_TO_BODY);
970
		if (indentStatementsCompareToBodyOption != null) {
971
			this.indent_statements_compare_to_body = CodeFormatterConstants.TRUE.equals(indentStatementsCompareToBodyOption);
972
		}
973
		final Object indentBodyDeclarationsCompareToEnumConstantHeaderOption = settings.get(CodeFormatterConstants.FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_ENUM_CONSTANT_HEADER);
974
		if (indentBodyDeclarationsCompareToEnumConstantHeaderOption != null) {
975
			this.indent_body_declarations_compare_to_enum_constant_header = CodeFormatterConstants.TRUE.equals(indentBodyDeclarationsCompareToEnumConstantHeaderOption);
976
		}
977
		final Object indentBodyDeclarationsCompareToEnumDeclarationHeaderOption = settings.get(CodeFormatterConstants.FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_ENUM_DECLARATION_HEADER);
978
		if (indentBodyDeclarationsCompareToEnumDeclarationHeaderOption != null) {
979
			this.indent_body_declarations_compare_to_enum_declaration_header = CodeFormatterConstants.TRUE.equals(indentBodyDeclarationsCompareToEnumDeclarationHeaderOption);
980
		}
981
		final Object indentBodyDeclarationsCompareToTypeHeaderOption = settings.get(CodeFormatterConstants.FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_TYPE_HEADER);
982
		if (indentBodyDeclarationsCompareToTypeHeaderOption != null) {
983
			this.indent_body_declarations_compare_to_type_header = CodeFormatterConstants.TRUE.equals(indentBodyDeclarationsCompareToTypeHeaderOption);
984
		}
985
		final Object indentBreaksCompareToCasesOption = settings.get(CodeFormatterConstants.FORMATTER_INDENT_BREAKS_COMPARE_TO_CASES);
986
		if (indentBreaksCompareToCasesOption != null) {
987
			this.indent_breaks_compare_to_cases = CodeFormatterConstants.TRUE.equals(indentBreaksCompareToCasesOption);
988
		}
989
		final Object indentEmptyLinesOption = settings.get(CodeFormatterConstants.FORMATTER_INDENT_EMPTY_LINES);
990
		if (indentEmptyLinesOption != null) {
991
			this.indent_empty_lines = CodeFormatterConstants.TRUE.equals(indentEmptyLinesOption);
992
		}
993
		final Object indentSwitchstatementsCompareToCasesOption = settings.get(CodeFormatterConstants.FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_CASES);
994
		if (indentSwitchstatementsCompareToCasesOption != null) {
995
			this.indent_switchstatements_compare_to_cases = CodeFormatterConstants.TRUE.equals(indentSwitchstatementsCompareToCasesOption);
996
		}
997
		final Object indentSwitchstatementsCompareToSwitchOption = settings.get(CodeFormatterConstants.FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_SWITCH);
998
		if (indentSwitchstatementsCompareToSwitchOption != null) {
999
			this.indent_switchstatements_compare_to_switch = CodeFormatterConstants.TRUE.equals(indentSwitchstatementsCompareToSwitchOption);
1000
		}
1001
		final Object indentationSizeOption = settings.get(CodeFormatterConstants.FORMATTER_INDENTATION_SIZE);
1002
		if (indentationSizeOption != null) {
1003
			try {
1004
				this.indentation_size = Integer.parseInt((String) indentationSizeOption);
1005
			} catch (NumberFormatException e) {
1006
				this.indentation_size = 4;
1007
			} catch(ClassCastException e) {
1008
				this.indentation_size = 4;
1009
			}
1010
		}
1011
//		final Object insertNewLineAfterOpeningBraceInArrayInitializerOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_OPENING_BRACE_IN_ARRAY_INITIALIZER);
1012
//		if (insertNewLineAfterOpeningBraceInArrayInitializerOption != null) {
1013
//			this.insert_new_line_after_opening_brace_in_array_initializer = CCorePlugin.INSERT.equals(insertNewLineAfterOpeningBraceInArrayInitializerOption);
1014
//		}
1015
//		final Object insertNewLineAtEndOfFileIfMissingOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AT_END_OF_FILE_IF_MISSING);
1016
//		if (insertNewLineAtEndOfFileIfMissingOption != null) {
1017
//			this.insert_new_line_at_end_of_file_if_missing = CCorePlugin.INSERT.equals(insertNewLineAtEndOfFileIfMissingOption);
1018
//		}
1019
//		final Object insertNewLineBeforeCatchInTryStatementOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT);
1020
//		if (insertNewLineBeforeCatchInTryStatementOption != null) {
1021
//			this.insert_new_line_before_catch_in_try_statement = CCorePlugin.INSERT.equals(insertNewLineBeforeCatchInTryStatementOption);
1022
//		}
1023
//		final Object insertNewLineBeforeClosingBraceInArrayInitializerOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_CLOSING_BRACE_IN_ARRAY_INITIALIZER);
1024
//		if (insertNewLineBeforeClosingBraceInArrayInitializerOption != null) {
1025
//			this.insert_new_line_before_closing_brace_in_array_initializer = CCorePlugin.INSERT.equals(insertNewLineBeforeClosingBraceInArrayInitializerOption);
1026
//		}
1027
//		final Object insertNewLineBeforeElseInIfStatementOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT);
1028
//		if (insertNewLineBeforeElseInIfStatementOption != null) {
1029
//			this.insert_new_line_before_else_in_if_statement = CCorePlugin.INSERT.equals(insertNewLineBeforeElseInIfStatementOption);
1030
//		}
1031
//		final Object insertNewLineBeforeFinallyInTryStatementOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT);
1032
//		if (insertNewLineBeforeFinallyInTryStatementOption != null) {
1033
//			this.insert_new_line_before_finally_in_try_statement = CCorePlugin.INSERT.equals(insertNewLineBeforeFinallyInTryStatementOption);
1034
//		}
1035
//		final Object insertNewLineBeforeWhileInDoStatementOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT);
1036
//		if (insertNewLineBeforeWhileInDoStatementOption != null) {
1037
//			this.insert_new_line_before_while_in_do_statement = CCorePlugin.INSERT.equals(insertNewLineBeforeWhileInDoStatementOption);
1038
//		}
1039
//		final Object insertNewLineInEmptyBlockOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_IN_EMPTY_BLOCK);
1040
//		if (insertNewLineInEmptyBlockOption != null) {
1041
//			this.insert_new_line_in_empty_block = CCorePlugin.INSERT.equals(insertNewLineInEmptyBlockOption);
1042
//		}
1043
//		final Object insertNewLineInEmptyEnumConstantOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_IN_EMPTY_ENUM_CONSTANT);
1044
//		if (insertNewLineInEmptyEnumConstantOption != null) {
1045
//			this.insert_new_line_in_empty_enum_constant = CCorePlugin.INSERT.equals(insertNewLineInEmptyEnumConstantOption);
1046
//		}
1047
//		final Object insertNewLineInEmptyEnumDeclarationOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_IN_EMPTY_ENUM_DECLARATION);
1048
//		if (insertNewLineInEmptyEnumDeclarationOption != null) {
1049
//			this.insert_new_line_in_empty_enum_declaration = CCorePlugin.INSERT.equals(insertNewLineInEmptyEnumDeclarationOption);
1050
//		}
1051
//		final Object insertNewLineInEmptyMethodBodyOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_IN_EMPTY_METHOD_BODY);
1052
//		if (insertNewLineInEmptyMethodBodyOption != null) {
1053
//			this.insert_new_line_in_empty_method_body = CCorePlugin.INSERT.equals(insertNewLineInEmptyMethodBodyOption);
1054
//		}
1055
//		final Object insertNewLineInEmptyTypeDeclarationOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_IN_EMPTY_TYPE_DECLARATION);
1056
//		if (insertNewLineInEmptyTypeDeclarationOption != null) {
1057
//			this.insert_new_line_in_empty_type_declaration = CCorePlugin.INSERT.equals(insertNewLineInEmptyTypeDeclarationOption);
1058
//		}
1059
//		final Object insertSpaceAfterAndInWildcardOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_AND_IN_TYPE_PARAMETER);
1060
//		if (insertSpaceAfterAndInWildcardOption != null) {
1061
//			this.insert_space_after_and_in_type_parameter = CCorePlugin.INSERT.equals(insertSpaceAfterAndInWildcardOption);
1062
//		}
1063
//		final Object insertSpaceAfterAssignmentOperatorOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_ASSIGNMENT_OPERATOR);
1064
//		if (insertSpaceAfterAssignmentOperatorOption != null) {
1065
//			this.insert_space_after_assignment_operator = CCorePlugin.INSERT.equals(insertSpaceAfterAssignmentOperatorOption);
1066
//		}
1067
//		final Object insertSpaceAfterBinaryOperatorOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_BINARY_OPERATOR);
1068
//		if (insertSpaceAfterBinaryOperatorOption != null) {
1069
//			this.insert_space_after_binary_operator = CCorePlugin.INSERT.equals(insertSpaceAfterBinaryOperatorOption);
1070
//		}
1071
//		final Object insertSpaceAfterClosingAngleBracketInTypeArgumentsOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_CLOSING_ANGLE_BRACKET_IN_TYPE_ARGUMENTS);
1072
//		if (insertSpaceAfterClosingAngleBracketInTypeArgumentsOption != null) {
1073
//			this.insert_space_after_closing_angle_bracket_in_type_arguments = CCorePlugin.INSERT.equals(insertSpaceAfterClosingAngleBracketInTypeArgumentsOption);
1074
//		}
1075
//		final Object insertSpaceAfterClosingAngleBracketInTypeParametersOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_CLOSING_ANGLE_BRACKET_IN_TYPE_PARAMETERS);
1076
//		if (insertSpaceAfterClosingAngleBracketInTypeParametersOption != null) {
1077
//			this.insert_space_after_closing_angle_bracket_in_type_parameters = CCorePlugin.INSERT.equals(insertSpaceAfterClosingAngleBracketInTypeParametersOption);
1078
//		}
1079
//		final Object insertSpaceAfterClosingParenInCastOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_CLOSING_PAREN_IN_CAST);
1080
//		if (insertSpaceAfterClosingParenInCastOption != null) {
1081
//			this.insert_space_after_closing_paren_in_cast = CCorePlugin.INSERT.equals(insertSpaceAfterClosingParenInCastOption);
1082
//		}
1083
//		final Object insertSpaceAfterClosingBraceInBlockOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_CLOSING_BRACE_IN_BLOCK);
1084
//		if (insertSpaceAfterClosingBraceInBlockOption != null) {
1085
//			this.insert_space_after_closing_brace_in_block = CCorePlugin.INSERT.equals(insertSpaceAfterClosingBraceInBlockOption);
1086
//		}
1087
//		final Object insertSpaceAfterColonInAssertOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COLON_IN_ASSERT);
1088
//		if (insertSpaceAfterColonInAssertOption != null) {
1089
//			this.insert_space_after_colon_in_assert = CCorePlugin.INSERT.equals(insertSpaceAfterColonInAssertOption);
1090
//		}
1091
//		final Object insertSpaceAfterColonInCaseOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COLON_IN_CASE);
1092
//		if (insertSpaceAfterColonInCaseOption != null) {
1093
//			this.insert_space_after_colon_in_case = CCorePlugin.INSERT.equals(insertSpaceAfterColonInCaseOption);
1094
//		}
1095
//		final Object insertSpaceAfterColonInConditionalOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COLON_IN_CONDITIONAL);
1096
//		if (insertSpaceAfterColonInConditionalOption != null) {
1097
//			this.insert_space_after_colon_in_conditional = CCorePlugin.INSERT.equals(insertSpaceAfterColonInConditionalOption);
1098
//		}
1099
//		final Object insertSpaceAfterColonInForOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COLON_IN_FOR);
1100
//		if (insertSpaceAfterColonInForOption != null) {
1101
//			this.insert_space_after_colon_in_for = CCorePlugin.INSERT.equals(insertSpaceAfterColonInForOption);
1102
//		}
1103
//		final Object insertSpaceAfterColonInLabeledStatementOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COLON_IN_LABELED_STATEMENT);
1104
//		if (insertSpaceAfterColonInLabeledStatementOption != null) {
1105
//			this.insert_space_after_colon_in_labeled_statement = CCorePlugin.INSERT.equals(insertSpaceAfterColonInLabeledStatementOption);
1106
//		}
1107
//		final Object insertSpaceAfterCommaInAllocationExpressionOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ALLOCATION_EXPRESSION);
1108
//		if (insertSpaceAfterCommaInAllocationExpressionOption != null) {
1109
//			this.insert_space_after_comma_in_allocation_expression = CCorePlugin.INSERT.equals(insertSpaceAfterCommaInAllocationExpressionOption);
1110
//		}
1111
//		final Object insertSpaceAfterCommaInArrayInitializerOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ARRAY_INITIALIZER);
1112
//		if (insertSpaceAfterCommaInArrayInitializerOption != null) {
1113
//			this.insert_space_after_comma_in_array_initializer = CCorePlugin.INSERT.equals(insertSpaceAfterCommaInArrayInitializerOption);
1114
//		}
1115
//		final Object insertSpaceAfterCommaInConstructorDeclarationParametersOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_CONSTRUCTOR_DECLARATION_PARAMETERS);
1116
//		if (insertSpaceAfterCommaInConstructorDeclarationParametersOption != null) {
1117
//			this.insert_space_after_comma_in_constructor_declaration_parameters = CCorePlugin.INSERT.equals(insertSpaceAfterCommaInConstructorDeclarationParametersOption);
1118
//		}
1119
//		final Object insertSpaceAfterCommaInConstructorDeclarationThrowsOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_CONSTRUCTOR_DECLARATION_THROWS);
1120
//		if (insertSpaceAfterCommaInConstructorDeclarationThrowsOption != null) {
1121
//			this.insert_space_after_comma_in_constructor_declaration_throws = CCorePlugin.INSERT.equals(insertSpaceAfterCommaInConstructorDeclarationThrowsOption);
1122
//		}
1123
//		final Object insertSpaceAfterCommaInEnumConstantArgumentsOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ENUM_CONSTANT_ARGUMENTS);
1124
//		if (insertSpaceAfterCommaInEnumConstantArgumentsOption != null) {
1125
//			this.insert_space_after_comma_in_enum_constant_arguments = CCorePlugin.INSERT.equals(insertSpaceAfterCommaInEnumConstantArgumentsOption);
1126
//		}
1127
//		final Object insertSpaceAfterCommaInEnumDeclarationsOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ENUM_DECLARATIONS);
1128
//		if (insertSpaceAfterCommaInEnumDeclarationsOption != null) {
1129
//			this.insert_space_after_comma_in_enum_declarations = CCorePlugin.INSERT.equals(insertSpaceAfterCommaInEnumDeclarationsOption);
1130
//		}
1131
//		final Object insertSpaceAfterCommaInExplicitConstructorCallArgumentsOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_EXPLICIT_CONSTRUCTOR_CALL_ARGUMENTS);
1132
//		if (insertSpaceAfterCommaInExplicitConstructorCallArgumentsOption != null) {
1133
//			this.insert_space_after_comma_in_explicit_constructor_call_arguments = CCorePlugin.INSERT.equals(insertSpaceAfterCommaInExplicitConstructorCallArgumentsOption);
1134
//		}
1135
//		final Object insertSpaceAfterCommaInForIncrementsOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_FOR_INCREMENTS);
1136
//		if (insertSpaceAfterCommaInForIncrementsOption != null) {
1137
//			this.insert_space_after_comma_in_for_increments = CCorePlugin.INSERT.equals(insertSpaceAfterCommaInForIncrementsOption);
1138
//		}
1139
//		final Object insertSpaceAfterCommaInForInitsOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_FOR_INITS);
1140
//		if (insertSpaceAfterCommaInForInitsOption != null) {
1141
//			this.insert_space_after_comma_in_for_inits = CCorePlugin.INSERT.equals(insertSpaceAfterCommaInForInitsOption);
1142
//		}
1143
//		final Object insertSpaceAfterCommaInMethodInvocationArgumentsOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_METHOD_INVOCATION_ARGUMENTS);
1144
//		if (insertSpaceAfterCommaInMethodInvocationArgumentsOption != null) {
1145
//			this.insert_space_after_comma_in_method_invocation_arguments = CCorePlugin.INSERT.equals(insertSpaceAfterCommaInMethodInvocationArgumentsOption);
1146
//		}
1147
//		final Object insertSpaceAfterCommaInMethodDeclarationParametersOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_METHOD_DECLARATION_PARAMETERS);
1148
//		if (insertSpaceAfterCommaInMethodDeclarationParametersOption != null) {
1149
//			this.insert_space_after_comma_in_method_declaration_parameters = CCorePlugin.INSERT.equals(insertSpaceAfterCommaInMethodDeclarationParametersOption);
1150
//		}
1151
//		final Object insertSpaceAfterCommaInMethodDeclarationThrowsOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_METHOD_DECLARATION_THROWS);
1152
//		if (insertSpaceAfterCommaInMethodDeclarationThrowsOption != null) {
1153
//			this.insert_space_after_comma_in_method_declaration_throws = CCorePlugin.INSERT.equals(insertSpaceAfterCommaInMethodDeclarationThrowsOption);
1154
//		}
1155
//		final Object insertSpaceAfterCommaInMultipleFieldDeclarationsOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_MULTIPLE_FIELD_DECLARATIONS);
1156
//		if (insertSpaceAfterCommaInMultipleFieldDeclarationsOption != null) {
1157
//			this.insert_space_after_comma_in_multiple_field_declarations = CCorePlugin.INSERT.equals(insertSpaceAfterCommaInMultipleFieldDeclarationsOption);
1158
//		}
1159
//		final Object insertSpaceAfterCommaInMultipleLocalDeclarationsOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_MULTIPLE_LOCAL_DECLARATIONS);
1160
//		if (insertSpaceAfterCommaInMultipleLocalDeclarationsOption != null) {
1161
//			this.insert_space_after_comma_in_multiple_local_declarations = CCorePlugin.INSERT.equals(insertSpaceAfterCommaInMultipleLocalDeclarationsOption);
1162
//		}
1163
//		final Object insertSpaceAfterCommaInParameterizedTypeReferenceOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_PARAMETERIZED_TYPE_REFERENCE);
1164
//		if (insertSpaceAfterCommaInParameterizedTypeReferenceOption != null) {
1165
//			this.insert_space_after_comma_in_parameterized_type_reference = CCorePlugin.INSERT.equals(insertSpaceAfterCommaInParameterizedTypeReferenceOption);
1166
//		}
1167
//		final Object insertSpaceAfterCommaInSuperinterfacesOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_SUPERINTERFACES);
1168
//		if (insertSpaceAfterCommaInSuperinterfacesOption != null) {
1169
//			this.insert_space_after_comma_in_superinterfaces = CCorePlugin.INSERT.equals(insertSpaceAfterCommaInSuperinterfacesOption);
1170
//		}
1171
//		final Object insertSpaceAfterCommaInTypeArgumentsOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_TYPE_ARGUMENTS);
1172
//		if (insertSpaceAfterCommaInTypeArgumentsOption != null) {
1173
//			this.insert_space_after_comma_in_type_arguments = CCorePlugin.INSERT.equals(insertSpaceAfterCommaInTypeArgumentsOption);
1174
//		}
1175
//		final Object insertSpaceAfterCommaInTypeParametersOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_TYPE_PARAMETERS);
1176
//		if (insertSpaceAfterCommaInTypeParametersOption != null) {
1177
//			this.insert_space_after_comma_in_type_parameters = CCorePlugin.INSERT.equals(insertSpaceAfterCommaInTypeParametersOption);
1178
//		}
1179
//		final Object insertSpaceAfterEllipsisOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_ELLIPSIS);
1180
//		if (insertSpaceAfterEllipsisOption != null) {
1181
//			this.insert_space_after_ellipsis = CCorePlugin.INSERT.equals(insertSpaceAfterEllipsisOption);
1182
//		}
1183
//		final Object insertSpaceAfterOpeningAngleBracketInParameterizedTypeReferenceOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_ANGLE_BRACKET_IN_PARAMETERIZED_TYPE_REFERENCE);
1184
//		if (insertSpaceAfterOpeningAngleBracketInParameterizedTypeReferenceOption != null) {
1185
//			this.insert_space_after_opening_angle_bracket_in_parameterized_type_reference = CCorePlugin.INSERT.equals(insertSpaceAfterOpeningAngleBracketInParameterizedTypeReferenceOption);
1186
//		}
1187
//		final Object insertSpaceAfterOpeningAngleBracketInTypeArgumentsOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_ANGLE_BRACKET_IN_TYPE_ARGUMENTS);
1188
//		if (insertSpaceAfterOpeningAngleBracketInTypeArgumentsOption != null) {
1189
//			this.insert_space_after_opening_angle_bracket_in_type_arguments = CCorePlugin.INSERT.equals(insertSpaceAfterOpeningAngleBracketInTypeArgumentsOption);
1190
//		}
1191
//		final Object insertSpaceAfterOpeningAngleBracketInTypeParametersOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_ANGLE_BRACKET_IN_TYPE_PARAMETERS);
1192
//		if (insertSpaceAfterOpeningAngleBracketInTypeParametersOption != null) {
1193
//			this.insert_space_after_opening_angle_bracket_in_type_parameters = CCorePlugin.INSERT.equals(insertSpaceAfterOpeningAngleBracketInTypeParametersOption);
1194
//		}
1195
//		final Object insertSpaceAfterOpeningBracketInArrayAllocationExpressionOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACKET_IN_ARRAY_ALLOCATION_EXPRESSION);
1196
//		if (insertSpaceAfterOpeningBracketInArrayAllocationExpressionOption != null) {
1197
//			this.insert_space_after_opening_bracket_in_array_allocation_expression = CCorePlugin.INSERT.equals(insertSpaceAfterOpeningBracketInArrayAllocationExpressionOption);
1198
//		}
1199
//		final Object insertSpaceAfterOpeningBracketInArrayReferenceOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACKET_IN_ARRAY_REFERENCE);
1200
//		if (insertSpaceAfterOpeningBracketInArrayReferenceOption != null) {
1201
//			this.insert_space_after_opening_bracket_in_array_reference = CCorePlugin.INSERT.equals(insertSpaceAfterOpeningBracketInArrayReferenceOption);
1202
//		}
1203
//		final Object insertSpaceAfterOpeningBraceInArrayInitializerOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACE_IN_ARRAY_INITIALIZER);
1204
//		if (insertSpaceAfterOpeningBraceInArrayInitializerOption != null) {
1205
//			this.insert_space_after_opening_brace_in_array_initializer = CCorePlugin.INSERT.equals(insertSpaceAfterOpeningBraceInArrayInitializerOption);
1206
//		}
1207
//		final Object insertSpaceAfterOpeningParenInCastOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_CAST);
1208
//		if (insertSpaceAfterOpeningParenInCastOption != null) {
1209
//			this.insert_space_after_opening_paren_in_cast = CCorePlugin.INSERT.equals(insertSpaceAfterOpeningParenInCastOption);
1210
//		}
1211
//		final Object insertSpaceAfterOpeningParenInCatchOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_CATCH);
1212
//		if (insertSpaceAfterOpeningParenInCatchOption != null) {
1213
//			this.insert_space_after_opening_paren_in_catch = CCorePlugin.INSERT.equals(insertSpaceAfterOpeningParenInCatchOption);
1214
//		}
1215
//		final Object insertSpaceAfterOpeningParenInConstructorDeclarationOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_CONSTRUCTOR_DECLARATION);
1216
//		if (insertSpaceAfterOpeningParenInConstructorDeclarationOption != null) {
1217
//			this.insert_space_after_opening_paren_in_constructor_declaration = CCorePlugin.INSERT.equals(insertSpaceAfterOpeningParenInConstructorDeclarationOption);
1218
//		}
1219
//		final Object insertSpaceAfterOpeningParenInEnumConstantOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_ENUM_CONSTANT);
1220
//		if (insertSpaceAfterOpeningParenInEnumConstantOption != null) {
1221
//			this.insert_space_after_opening_paren_in_enum_constant = CCorePlugin.INSERT.equals(insertSpaceAfterOpeningParenInEnumConstantOption);
1222
//		}
1223
//		final Object insertSpaceAfterOpeningParenInForOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_FOR);
1224
//		if (insertSpaceAfterOpeningParenInForOption != null) {
1225
//			this.insert_space_after_opening_paren_in_for = CCorePlugin.INSERT.equals(insertSpaceAfterOpeningParenInForOption);
1226
//		}
1227
//		final Object insertSpaceAfterOpeningParenInIfOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_IF);
1228
//		if (insertSpaceAfterOpeningParenInIfOption != null) {
1229
//			this.insert_space_after_opening_paren_in_if = CCorePlugin.INSERT.equals(insertSpaceAfterOpeningParenInIfOption);
1230
//		}
1231
//		final Object insertSpaceAfterOpeningParenInMethodDeclarationOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_METHOD_DECLARATION);
1232
//		if (insertSpaceAfterOpeningParenInMethodDeclarationOption != null) {
1233
//			this.insert_space_after_opening_paren_in_method_declaration = CCorePlugin.INSERT.equals(insertSpaceAfterOpeningParenInMethodDeclarationOption);
1234
//		}
1235
//		final Object insertSpaceAfterOpeningParenInMethodInvocationOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_METHOD_INVOCATION);
1236
//		if (insertSpaceAfterOpeningParenInMethodInvocationOption != null) {
1237
//			this.insert_space_after_opening_paren_in_method_invocation = CCorePlugin.INSERT.equals(insertSpaceAfterOpeningParenInMethodInvocationOption);
1238
//		}
1239
//		final Object insertSpaceAfterOpeningParenInParenthesizedExpressionOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_PARENTHESIZED_EXPRESSION);
1240
//		if (insertSpaceAfterOpeningParenInParenthesizedExpressionOption != null) {
1241
//			this.insert_space_after_opening_paren_in_parenthesized_expression = CCorePlugin.INSERT.equals(insertSpaceAfterOpeningParenInParenthesizedExpressionOption);
1242
//		}
1243
//		final Object insertSpaceAfterOpeningParenInSwitchOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_SWITCH);
1244
//		if (insertSpaceAfterOpeningParenInSwitchOption != null) {
1245
//			this.insert_space_after_opening_paren_in_switch = CCorePlugin.INSERT.equals(insertSpaceAfterOpeningParenInSwitchOption);
1246
//		}
1247
//		final Object insertSpaceAfterOpeningParenInSynchronizedOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_SYNCHRONIZED);
1248
//		if (insertSpaceAfterOpeningParenInSynchronizedOption != null) {
1249
//			this.insert_space_after_opening_paren_in_synchronized = CCorePlugin.INSERT.equals(insertSpaceAfterOpeningParenInSynchronizedOption);
1250
//		}
1251
//		final Object insertSpaceAfterOpeningParenInWhileOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_WHILE);
1252
//		if (insertSpaceAfterOpeningParenInWhileOption != null) {
1253
//			this.insert_space_after_opening_paren_in_while = CCorePlugin.INSERT.equals(insertSpaceAfterOpeningParenInWhileOption);
1254
//		}
1255
//		final Object insertSpaceAfterPostfixOperatorOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_POSTFIX_OPERATOR);
1256
//		if (insertSpaceAfterPostfixOperatorOption != null) {
1257
//			this.insert_space_after_postfix_operator = CCorePlugin.INSERT.equals(insertSpaceAfterPostfixOperatorOption);
1258
//		}
1259
//		final Object insertSpaceAfterPrefixOperatorOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_PREFIX_OPERATOR);
1260
//		if (insertSpaceAfterPrefixOperatorOption != null) {
1261
//			this.insert_space_after_prefix_operator = CCorePlugin.INSERT.equals(insertSpaceAfterPrefixOperatorOption);
1262
//		}
1263
//		final Object insertSpaceAfterQuestionInConditionalOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_QUESTION_IN_CONDITIONAL);
1264
//		if (insertSpaceAfterQuestionInConditionalOption != null) {
1265
//			this.insert_space_after_question_in_conditional = CCorePlugin.INSERT.equals(insertSpaceAfterQuestionInConditionalOption);
1266
//		}
1267
//		final Object insertSpaceAfterQuestionInWildcardOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_QUESTION_IN_WILDCARD);
1268
//		if (insertSpaceAfterQuestionInWildcardOption != null) {
1269
//			this.insert_space_after_question_in_wilcard = CCorePlugin.INSERT.equals(insertSpaceAfterQuestionInWildcardOption);
1270
//		}
1271
//		final Object insertSpaceAfterSemicolonInForOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_SEMICOLON_IN_FOR);
1272
//		if (insertSpaceAfterSemicolonInForOption != null) {
1273
//			this.insert_space_after_semicolon_in_for = CCorePlugin.INSERT.equals(insertSpaceAfterSemicolonInForOption);
1274
//		}
1275
//		final Object insertSpaceAfterUnaryOperatorOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_UNARY_OPERATOR);
1276
//		if (insertSpaceAfterUnaryOperatorOption != null) {
1277
//			this.insert_space_after_unary_operator = CCorePlugin.INSERT.equals(insertSpaceAfterUnaryOperatorOption);
1278
//		}
1279
//		final Object insertSpaceBeforeAndInWildcardOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_AND_IN_TYPE_PARAMETER);
1280
//		if (insertSpaceBeforeAndInWildcardOption != null) {
1281
//			this.insert_space_before_and_in_type_parameter = CCorePlugin.INSERT.equals(insertSpaceBeforeAndInWildcardOption);
1282
//		}
1283
//		final Object insertSpaceBeforeAssignmentOperatorOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_ASSIGNMENT_OPERATOR);
1284
//		if (insertSpaceBeforeAssignmentOperatorOption != null) {
1285
//			this.insert_space_before_assignment_operator = CCorePlugin.INSERT.equals(insertSpaceBeforeAssignmentOperatorOption);
1286
//		}
1287
//		final Object insertSpaceBeforeBinaryOperatorOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_BINARY_OPERATOR);
1288
//		if (insertSpaceBeforeBinaryOperatorOption != null) {
1289
//			this.insert_space_before_binary_operator = CCorePlugin.INSERT.equals(insertSpaceBeforeBinaryOperatorOption);
1290
//		}
1291
//		final Object insertSpaceBeforeClosingAngleBracketInParameterizedTypeReferenceOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_ANGLE_BRACKET_IN_PARAMETERIZED_TYPE_REFERENCE);
1292
//		if (insertSpaceBeforeClosingAngleBracketInParameterizedTypeReferenceOption != null) {
1293
//			this.insert_space_before_closing_angle_bracket_in_parameterized_type_reference = CCorePlugin.INSERT.equals(insertSpaceBeforeClosingAngleBracketInParameterizedTypeReferenceOption);
1294
//		}
1295
//		final Object insertSpaceBeforeClosingAngleBracketInTypeArgumentsOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_ANGLE_BRACKET_IN_TYPE_ARGUMENTS);
1296
//		if (insertSpaceBeforeClosingAngleBracketInTypeArgumentsOption != null) {
1297
//			this.insert_space_before_closing_angle_bracket_in_type_arguments = CCorePlugin.INSERT.equals(insertSpaceBeforeClosingAngleBracketInTypeArgumentsOption);
1298
//		}
1299
//		final Object insertSpaceBeforeClosingAngleBracketInTypeParametersOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_ANGLE_BRACKET_IN_TYPE_PARAMETERS);
1300
//		if (insertSpaceBeforeClosingAngleBracketInTypeParametersOption != null) {
1301
//			this.insert_space_before_closing_angle_bracket_in_type_parameters = CCorePlugin.INSERT.equals(insertSpaceBeforeClosingAngleBracketInTypeParametersOption);
1302
//		}
1303
//		final Object insertSpaceBeforeClosingBraceInArrayInitializerOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_BRACE_IN_ARRAY_INITIALIZER);
1304
//		if (insertSpaceBeforeClosingBraceInArrayInitializerOption != null) {
1305
//			this.insert_space_before_closing_brace_in_array_initializer = CCorePlugin.INSERT.equals(insertSpaceBeforeClosingBraceInArrayInitializerOption);
1306
//		}
1307
//		final Object insertSpaceBeforeClosingBracketInArrayAllocationExpressionOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_BRACKET_IN_ARRAY_ALLOCATION_EXPRESSION);
1308
//		if (insertSpaceBeforeClosingBracketInArrayAllocationExpressionOption != null) {
1309
//			this.insert_space_before_closing_bracket_in_array_allocation_expression = CCorePlugin.INSERT.equals(insertSpaceBeforeClosingBracketInArrayAllocationExpressionOption);
1310
//		}
1311
//		final Object insertSpaceBeforeClosingBracketInArrayReferenceOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_BRACKET_IN_ARRAY_REFERENCE);
1312
//		if (insertSpaceBeforeClosingBracketInArrayReferenceOption != null) {
1313
//			this.insert_space_before_closing_bracket_in_array_reference = CCorePlugin.INSERT.equals(insertSpaceBeforeClosingBracketInArrayReferenceOption);
1314
//		}
1315
//		final Object insertSpaceBeforeClosingParenInCastOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_CAST);
1316
//		if (insertSpaceBeforeClosingParenInCastOption != null) {
1317
//			this.insert_space_before_closing_paren_in_cast = CCorePlugin.INSERT.equals(insertSpaceBeforeClosingParenInCastOption);
1318
//		}
1319
//		final Object insertSpaceBeforeClosingParenInCatchOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_CATCH);
1320
//		if (insertSpaceBeforeClosingParenInCatchOption != null) {
1321
//			this.insert_space_before_closing_paren_in_catch = CCorePlugin.INSERT.equals(insertSpaceBeforeClosingParenInCatchOption);
1322
//		}
1323
//		final Object insertSpaceBeforeClosingParenInConstructorDeclarationOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_CONSTRUCTOR_DECLARATION);
1324
//		if (insertSpaceBeforeClosingParenInConstructorDeclarationOption != null) {
1325
//			this.insert_space_before_closing_paren_in_constructor_declaration = CCorePlugin.INSERT.equals(insertSpaceBeforeClosingParenInConstructorDeclarationOption);
1326
//		}
1327
//		final Object insertSpaceBeforeClosingParenInEnumConstantOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_ENUM_CONSTANT);
1328
//		if (insertSpaceBeforeClosingParenInEnumConstantOption != null) {
1329
//			this.insert_space_before_closing_paren_in_enum_constant = CCorePlugin.INSERT.equals(insertSpaceBeforeClosingParenInEnumConstantOption);
1330
//		}
1331
//		final Object insertSpaceBeforeClosingParenInForOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_FOR);
1332
//		if (insertSpaceBeforeClosingParenInForOption != null) {
1333
//			this.insert_space_before_closing_paren_in_for = CCorePlugin.INSERT.equals(insertSpaceBeforeClosingParenInForOption);
1334
//		}
1335
//		final Object insertSpaceBeforeClosingParenInIfOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_IF);
1336
//		if (insertSpaceBeforeClosingParenInIfOption != null) {
1337
//			this.insert_space_before_closing_paren_in_if = CCorePlugin.INSERT.equals(insertSpaceBeforeClosingParenInIfOption);
1338
//		}
1339
//		final Object insertSpaceBeforeClosingParenInMethodDeclarationOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_METHOD_DECLARATION);
1340
//		if (insertSpaceBeforeClosingParenInMethodDeclarationOption != null) {
1341
//			this.insert_space_before_closing_paren_in_method_declaration = CCorePlugin.INSERT.equals(insertSpaceBeforeClosingParenInMethodDeclarationOption);
1342
//		}
1343
//		final Object insertSpaceBeforeClosingParenInMethodInvocationOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_METHOD_INVOCATION);
1344
//		if (insertSpaceBeforeClosingParenInMethodInvocationOption != null) {
1345
//			this.insert_space_before_closing_paren_in_method_invocation = CCorePlugin.INSERT.equals(insertSpaceBeforeClosingParenInMethodInvocationOption);
1346
//		}
1347
//		final Object insertSpaceBeforeClosingParenInParenthesizedExpressionOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_PARENTHESIZED_EXPRESSION);
1348
//		if (insertSpaceBeforeClosingParenInParenthesizedExpressionOption != null) {
1349
//			this.insert_space_before_closing_paren_in_parenthesized_expression = CCorePlugin.INSERT.equals(insertSpaceBeforeClosingParenInParenthesizedExpressionOption);
1350
//		}
1351
//		final Object insertSpaceBeforeClosingParenInSwitchOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_SWITCH);
1352
//		if (insertSpaceBeforeClosingParenInSwitchOption != null) {
1353
//			this.insert_space_before_closing_paren_in_switch = CCorePlugin.INSERT.equals(insertSpaceBeforeClosingParenInSwitchOption);
1354
//		}
1355
//		final Object insertSpaceBeforeClosingParenInSynchronizedOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_SYNCHRONIZED);
1356
//		if (insertSpaceBeforeClosingParenInSynchronizedOption != null) {
1357
//			this.insert_space_before_closing_paren_in_synchronized = CCorePlugin.INSERT.equals(insertSpaceBeforeClosingParenInSynchronizedOption);
1358
//		}
1359
//		final Object insertSpaceBeforeClosingParenInWhileOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_WHILE);
1360
//		if (insertSpaceBeforeClosingParenInWhileOption != null) {
1361
//			this.insert_space_before_closing_paren_in_while = CCorePlugin.INSERT.equals(insertSpaceBeforeClosingParenInWhileOption);
1362
//		}
1363
//		final Object insertSpaceBeforeColonInAssertOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_ASSERT);
1364
//		if (insertSpaceBeforeColonInAssertOption != null) {
1365
//			this.insert_space_before_colon_in_assert = CCorePlugin.INSERT.equals(insertSpaceBeforeColonInAssertOption);
1366
//		}
1367
//		final Object insertSpaceBeforeColonInCaseOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_CASE);
1368
//		if (insertSpaceBeforeColonInCaseOption != null) {
1369
//			this.insert_space_before_colon_in_case = CCorePlugin.INSERT.equals(insertSpaceBeforeColonInCaseOption);
1370
//		}
1371
//		final Object insertSpaceBeforeColonInConditionalOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_CONDITIONAL);
1372
//		if (insertSpaceBeforeColonInConditionalOption != null) {
1373
//			this.insert_space_before_colon_in_conditional = CCorePlugin.INSERT.equals(insertSpaceBeforeColonInConditionalOption);
1374
//		}
1375
//		final Object insertSpaceBeforeColonInDefaultOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_DEFAULT);
1376
//		if (insertSpaceBeforeColonInDefaultOption != null) {
1377
//			this.insert_space_before_colon_in_default = CCorePlugin.INSERT.equals(insertSpaceBeforeColonInDefaultOption);
1378
//		}
1379
//		final Object insertSpaceBeforeColonInForOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_FOR);
1380
//		if (insertSpaceBeforeColonInForOption != null) {
1381
//			this.insert_space_before_colon_in_for = CCorePlugin.INSERT.equals(insertSpaceBeforeColonInForOption);
1382
//		}
1383
//		final Object insertSpaceBeforeColonInLabeledStatementOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_LABELED_STATEMENT);
1384
//		if (insertSpaceBeforeColonInLabeledStatementOption != null) {
1385
//			this.insert_space_before_colon_in_labeled_statement = CCorePlugin.INSERT.equals(insertSpaceBeforeColonInLabeledStatementOption);
1386
//		}
1387
//		final Object insertSpaceBeforeCommaInAllocationExpressionOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ALLOCATION_EXPRESSION);
1388
//		if (insertSpaceBeforeCommaInAllocationExpressionOption != null) {
1389
//			this.insert_space_before_comma_in_allocation_expression = CCorePlugin.INSERT.equals(insertSpaceBeforeCommaInAllocationExpressionOption);
1390
//		}
1391
//		final Object insertSpaceBeforeCommaInArrayInitializerOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ARRAY_INITIALIZER);
1392
//		if (insertSpaceBeforeCommaInArrayInitializerOption != null) {
1393
//			this.insert_space_before_comma_in_array_initializer = CCorePlugin.INSERT.equals(insertSpaceBeforeCommaInArrayInitializerOption);
1394
//		}
1395
//		final Object insertSpaceBeforeCommaInConstructorDeclarationParametersOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_CONSTRUCTOR_DECLARATION_PARAMETERS);
1396
//		if (insertSpaceBeforeCommaInConstructorDeclarationParametersOption != null) {
1397
//			this.insert_space_before_comma_in_constructor_declaration_parameters = CCorePlugin.INSERT.equals(insertSpaceBeforeCommaInConstructorDeclarationParametersOption);
1398
//		}
1399
//		final Object insertSpaceBeforeCommaInConstructorDeclarationThrowsOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_CONSTRUCTOR_DECLARATION_THROWS);
1400
//		if (insertSpaceBeforeCommaInConstructorDeclarationThrowsOption != null) {
1401
//			this.insert_space_before_comma_in_constructor_declaration_throws = CCorePlugin.INSERT.equals(insertSpaceBeforeCommaInConstructorDeclarationThrowsOption);
1402
//		}
1403
//		final Object insertSpaceBeforeCommaInEnumConstantArgumentsOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ENUM_CONSTANT_ARGUMENTS);
1404
//		if (insertSpaceBeforeCommaInEnumConstantArgumentsOption != null) {
1405
//			this.insert_space_before_comma_in_enum_constant_arguments = CCorePlugin.INSERT.equals(insertSpaceBeforeCommaInEnumConstantArgumentsOption);
1406
//		}
1407
//		final Object insertSpaceBeforeCommaInEnumDeclarationsOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ENUM_DECLARATIONS);
1408
//		if (insertSpaceBeforeCommaInEnumDeclarationsOption != null) {
1409
//			this.insert_space_before_comma_in_enum_declarations = CCorePlugin.INSERT.equals(insertSpaceBeforeCommaInEnumDeclarationsOption);
1410
//		}
1411
//		final Object insertSpaceBeforeCommaInExplicitConstructorCallArgumentsOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_EXPLICIT_CONSTRUCTOR_CALL_ARGUMENTS);
1412
//		if (insertSpaceBeforeCommaInExplicitConstructorCallArgumentsOption != null) {
1413
//			this.insert_space_before_comma_in_explicit_constructor_call_arguments = CCorePlugin.INSERT.equals(insertSpaceBeforeCommaInExplicitConstructorCallArgumentsOption);
1414
//		}
1415
//		final Object insertSpaceBeforeCommaInForIncrementsOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_FOR_INCREMENTS);
1416
//		if (insertSpaceBeforeCommaInForIncrementsOption != null) {
1417
//			this.insert_space_before_comma_in_for_increments = CCorePlugin.INSERT.equals(insertSpaceBeforeCommaInForIncrementsOption);
1418
//		}
1419
//		final Object insertSpaceBeforeCommaInForInitsOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_FOR_INITS);
1420
//		if (insertSpaceBeforeCommaInForInitsOption != null) {
1421
//			this.insert_space_before_comma_in_for_inits = CCorePlugin.INSERT.equals(insertSpaceBeforeCommaInForInitsOption);
1422
//		}
1423
//		final Object insertSpaceBeforeCommaInMethodInvocationArgumentsOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_METHOD_INVOCATION_ARGUMENTS);
1424
//		if (insertSpaceBeforeCommaInMethodInvocationArgumentsOption != null) {
1425
//			this.insert_space_before_comma_in_method_invocation_arguments = CCorePlugin.INSERT.equals(insertSpaceBeforeCommaInMethodInvocationArgumentsOption);
1426
//		}
1427
//		final Object insertSpaceBeforeCommaInMethodDeclarationParametersOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_METHOD_DECLARATION_PARAMETERS);
1428
//		if (insertSpaceBeforeCommaInMethodDeclarationParametersOption != null) {
1429
//			this.insert_space_before_comma_in_method_declaration_parameters = CCorePlugin.INSERT.equals(insertSpaceBeforeCommaInMethodDeclarationParametersOption);
1430
//		}
1431
//		final Object insertSpaceBeforeCommaInMethodDeclarationThrowsOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_METHOD_DECLARATION_THROWS);
1432
//		if (insertSpaceBeforeCommaInMethodDeclarationThrowsOption != null) {
1433
//			this.insert_space_before_comma_in_method_declaration_throws = CCorePlugin.INSERT.equals(insertSpaceBeforeCommaInMethodDeclarationThrowsOption);
1434
//		}
1435
//		final Object insertSpaceBeforeCommaInMultipleFieldDeclarationsOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_MULTIPLE_FIELD_DECLARATIONS);
1436
//		if (insertSpaceBeforeCommaInMultipleFieldDeclarationsOption != null) {
1437
//			this.insert_space_before_comma_in_multiple_field_declarations = CCorePlugin.INSERT.equals(insertSpaceBeforeCommaInMultipleFieldDeclarationsOption);
1438
//		}
1439
//		final Object insertSpaceBeforeCommaInMultipleLocalDeclarationsOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_MULTIPLE_LOCAL_DECLARATIONS);
1440
//		if (insertSpaceBeforeCommaInMultipleLocalDeclarationsOption != null) {
1441
//			this.insert_space_before_comma_in_multiple_local_declarations = CCorePlugin.INSERT.equals(insertSpaceBeforeCommaInMultipleLocalDeclarationsOption);
1442
//		}
1443
//		final Object insertSpaceBeforeCommaInParameterizedTypeReferenceOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_PARAMETERIZED_TYPE_REFERENCE);
1444
//		if (insertSpaceBeforeCommaInParameterizedTypeReferenceOption != null) {
1445
//			this.insert_space_before_comma_in_parameterized_type_reference = CCorePlugin.INSERT.equals(insertSpaceBeforeCommaInParameterizedTypeReferenceOption);
1446
//		}
1447
//		final Object insertSpaceBeforeCommaInSuperinterfacesOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_SUPERINTERFACES);
1448
//		if (insertSpaceBeforeCommaInSuperinterfacesOption != null) {
1449
//			this.insert_space_before_comma_in_superinterfaces = CCorePlugin.INSERT.equals(insertSpaceBeforeCommaInSuperinterfacesOption);
1450
//		}
1451
//		final Object insertSpaceBeforeCommaInTypeArgumentsOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_TYPE_ARGUMENTS);
1452
//		if (insertSpaceBeforeCommaInTypeArgumentsOption != null) {
1453
//			this.insert_space_before_comma_in_type_arguments = CCorePlugin.INSERT.equals(insertSpaceBeforeCommaInTypeArgumentsOption);
1454
//		}
1455
//		final Object insertSpaceBeforeCommaInTypeParametersOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_TYPE_PARAMETERS);
1456
//		if (insertSpaceBeforeCommaInTypeParametersOption != null) {
1457
//			this.insert_space_before_comma_in_type_parameters = CCorePlugin.INSERT.equals(insertSpaceBeforeCommaInTypeParametersOption);
1458
//		}
1459
//		final Object insertSpaceBeforeEllipsisOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_ELLIPSIS);
1460
//		if (insertSpaceBeforeEllipsisOption != null) {
1461
//			this.insert_space_before_ellipsis = CCorePlugin.INSERT.equals(insertSpaceBeforeEllipsisOption);
1462
//		}
1463
//		final Object insertSpaceBeforeOpeningAngleBrackerInParameterizedTypeReferenceOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_ANGLE_BRACKET_IN_PARAMETERIZED_TYPE_REFERENCE);
1464
//		if (insertSpaceBeforeOpeningAngleBrackerInParameterizedTypeReferenceOption != null) {
1465
//			this.insert_space_before_opening_angle_bracket_in_parameterized_type_reference = CCorePlugin.INSERT.equals(insertSpaceBeforeOpeningAngleBrackerInParameterizedTypeReferenceOption);
1466
//		}
1467
//		final Object insertSpaceBeforeOpeningAngleBrackerInTypeArgumentsOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_ANGLE_BRACKET_IN_TYPE_ARGUMENTS);
1468
//		if (insertSpaceBeforeOpeningAngleBrackerInTypeArgumentsOption != null) {
1469
//			this.insert_space_before_opening_angle_bracket_in_type_arguments = CCorePlugin.INSERT.equals(insertSpaceBeforeOpeningAngleBrackerInTypeArgumentsOption);
1470
//		}
1471
//		final Object insertSpaceBeforeOpeningAngleBrackerInTypeParametersOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_ANGLE_BRACKET_IN_TYPE_PARAMETERS);
1472
//		if (insertSpaceBeforeOpeningAngleBrackerInTypeParametersOption != null) {
1473
//			this.insert_space_before_opening_angle_bracket_in_type_parameters = CCorePlugin.INSERT.equals(insertSpaceBeforeOpeningAngleBrackerInTypeParametersOption);
1474
//		}
1475
//		final Object insertSpaceBeforeOpeningBraceInArrayInitializerOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ARRAY_INITIALIZER);
1476
//		if (insertSpaceBeforeOpeningBraceInArrayInitializerOption != null) {
1477
//			this.insert_space_before_opening_brace_in_array_initializer = CCorePlugin.INSERT.equals(insertSpaceBeforeOpeningBraceInArrayInitializerOption);
1478
//		}
1479
//		final Object insertSpaceBeforeOpeningBraceInBlockOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_BLOCK);
1480
//		if (insertSpaceBeforeOpeningBraceInBlockOption != null) {
1481
//			this.insert_space_before_opening_brace_in_block = CCorePlugin.INSERT.equals(insertSpaceBeforeOpeningBraceInBlockOption);
1482
//		}
1483
//		final Object insertSpaceBeforeOpeningBraceInConstructorDeclarationOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_CONSTRUCTOR_DECLARATION);
1484
//		if (insertSpaceBeforeOpeningBraceInConstructorDeclarationOption != null) {
1485
//			this.insert_space_before_opening_brace_in_constructor_declaration = CCorePlugin.INSERT.equals(insertSpaceBeforeOpeningBraceInConstructorDeclarationOption);
1486
//		}
1487
//		final Object insertSpaceBeforeOpeningBraceInEnumDeclarationOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ENUM_DECLARATION);
1488
//		if (insertSpaceBeforeOpeningBraceInEnumDeclarationOption != null) {
1489
//			this.insert_space_before_opening_brace_in_enum_declaration = CCorePlugin.INSERT.equals(insertSpaceBeforeOpeningBraceInEnumDeclarationOption);
1490
//		}
1491
//		final Object insertSpaceBeforeOpeningBraceInEnumConstantOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ENUM_CONSTANT);
1492
//		if (insertSpaceBeforeOpeningBraceInEnumConstantOption != null) {
1493
//			this.insert_space_before_opening_brace_in_enum_constant = CCorePlugin.INSERT.equals(insertSpaceBeforeOpeningBraceInEnumConstantOption);
1494
//		}
1495
//		final Object insertSpaceBeforeOpeningBraceInMethodDeclarationOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_METHOD_DECLARATION);
1496
//		if (insertSpaceBeforeOpeningBraceInMethodDeclarationOption != null) {
1497
//			this.insert_space_before_opening_brace_in_method_declaration = CCorePlugin.INSERT.equals(insertSpaceBeforeOpeningBraceInMethodDeclarationOption);
1498
//		}
1499
//		final Object insertSpaceBeforeOpeningBraceInTypeDeclarationOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_TYPE_DECLARATION);
1500
//		if (insertSpaceBeforeOpeningBraceInTypeDeclarationOption != null) {
1501
//			this.insert_space_before_opening_brace_in_type_declaration = CCorePlugin.INSERT.equals(insertSpaceBeforeOpeningBraceInTypeDeclarationOption);
1502
//		}
1503
//		final Object insertSpaceBeforeOpeningBracketInArrayAllocationExpressionOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACKET_IN_ARRAY_ALLOCATION_EXPRESSION);
1504
//		if (insertSpaceBeforeOpeningBracketInArrayAllocationExpressionOption != null) {
1505
//			this.insert_space_before_opening_bracket_in_array_allocation_expression = CCorePlugin.INSERT.equals(insertSpaceBeforeOpeningBracketInArrayAllocationExpressionOption);
1506
//		}
1507
//		final Object insertSpaceBeforeOpeningBracketInArrayReferenceOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACKET_IN_ARRAY_REFERENCE);
1508
//		if (insertSpaceBeforeOpeningBracketInArrayReferenceOption != null) {
1509
//			this.insert_space_before_opening_bracket_in_array_reference = CCorePlugin.INSERT.equals(insertSpaceBeforeOpeningBracketInArrayReferenceOption);
1510
//		}
1511
//		final Object insertSpaceBeforeOpeningBracketInArrayTypeReferenceOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACKET_IN_ARRAY_TYPE_REFERENCE);
1512
//		if (insertSpaceBeforeOpeningBracketInArrayTypeReferenceOption != null) {
1513
//			this.insert_space_before_opening_bracket_in_array_type_reference = CCorePlugin.INSERT.equals(insertSpaceBeforeOpeningBracketInArrayTypeReferenceOption);
1514
//		}
1515
//		final Object insertSpaceBeforeOpeningParenInCatchOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_CATCH);
1516
//		if (insertSpaceBeforeOpeningParenInCatchOption != null) {
1517
//			this.insert_space_before_opening_paren_in_catch = CCorePlugin.INSERT.equals(insertSpaceBeforeOpeningParenInCatchOption);
1518
//		}
1519
//		final Object insertSpaceBeforeOpeningParenInConstructorDeclarationOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_CONSTRUCTOR_DECLARATION);
1520
//		if (insertSpaceBeforeOpeningParenInConstructorDeclarationOption != null) {
1521
//			this.insert_space_before_opening_paren_in_constructor_declaration = CCorePlugin.INSERT.equals(insertSpaceBeforeOpeningParenInConstructorDeclarationOption);
1522
//		}
1523
//		final Object insertSpaceBeforeOpeningParenInEnumConstantOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_ENUM_CONSTANT);
1524
//		if (insertSpaceBeforeOpeningParenInEnumConstantOption != null) {
1525
//			this.insert_space_before_opening_paren_in_enum_constant = CCorePlugin.INSERT.equals(insertSpaceBeforeOpeningParenInEnumConstantOption);
1526
//		}
1527
//		final Object insertSpaceBeforeOpeningParenInForOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_FOR);
1528
//		if (insertSpaceBeforeOpeningParenInForOption != null) {
1529
//			this.insert_space_before_opening_paren_in_for = CCorePlugin.INSERT.equals(insertSpaceBeforeOpeningParenInForOption);
1530
//		}
1531
//		final Object insertSpaceBeforeOpeningParenInIfOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_IF);
1532
//		if (insertSpaceBeforeOpeningParenInIfOption != null) {
1533
//			this.insert_space_before_opening_paren_in_if = CCorePlugin.INSERT.equals(insertSpaceBeforeOpeningParenInIfOption);
1534
//		}
1535
//		final Object insertSpaceBeforeOpeningParenInMethodInvocationOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_METHOD_INVOCATION);
1536
//		if (insertSpaceBeforeOpeningParenInMethodInvocationOption != null) {
1537
//			this.insert_space_before_opening_paren_in_method_invocation = CCorePlugin.INSERT.equals(insertSpaceBeforeOpeningParenInMethodInvocationOption);
1538
//		}
1539
//		final Object insertSpaceBeforeOpeningParenInMethodDeclarationOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_METHOD_DECLARATION);
1540
//		if (insertSpaceBeforeOpeningParenInMethodDeclarationOption != null) {
1541
//			this.insert_space_before_opening_paren_in_method_declaration = CCorePlugin.INSERT.equals(insertSpaceBeforeOpeningParenInMethodDeclarationOption);
1542
//		}
1543
//		final Object insertSpaceBeforeOpeningParenInSwitchOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_SWITCH);
1544
//		if (insertSpaceBeforeOpeningParenInSwitchOption != null) {
1545
//			this.insert_space_before_opening_paren_in_switch = CCorePlugin.INSERT.equals(insertSpaceBeforeOpeningParenInSwitchOption);
1546
//		}
1547
//		final Object insertSpaceBeforeOpeningBraceInSwitchOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_SWITCH);
1548
//		if (insertSpaceBeforeOpeningBraceInSwitchOption != null) {
1549
//			this.insert_space_before_opening_brace_in_switch = CCorePlugin.INSERT.equals(insertSpaceBeforeOpeningBraceInSwitchOption);
1550
//		}
1551
//		final Object insertSpaceBeforeOpeningParenInSynchronizedOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_SYNCHRONIZED);
1552
//		if (insertSpaceBeforeOpeningParenInSynchronizedOption != null) {
1553
//			this.insert_space_before_opening_paren_in_synchronized = CCorePlugin.INSERT.equals(insertSpaceBeforeOpeningParenInSynchronizedOption);
1554
//		}
1555
//		final Object insertSpaceBeforeOpeningParenInParenthesizedExpressionOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_PARENTHESIZED_EXPRESSION);
1556
//		if (insertSpaceBeforeOpeningParenInParenthesizedExpressionOption != null) {
1557
//			this.insert_space_before_opening_paren_in_parenthesized_expression = CCorePlugin.INSERT.equals(insertSpaceBeforeOpeningParenInParenthesizedExpressionOption);
1558
//		}
1559
//		final Object insertSpaceBeforeOpeningParenInWhileOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_WHILE);
1560
//		if (insertSpaceBeforeOpeningParenInWhileOption != null) {
1561
//			this.insert_space_before_opening_paren_in_while = CCorePlugin.INSERT.equals(insertSpaceBeforeOpeningParenInWhileOption);
1562
//		}
1563
//		final Object insertSpaceBeforeParenthesizedExpressionInReturnOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_PARENTHESIZED_EXPRESSION_IN_RETURN);
1564
//		if (insertSpaceBeforeParenthesizedExpressionInReturnOption != null) {
1565
//			this.insert_space_before_parenthesized_expression_in_return = CCorePlugin.INSERT.equals(insertSpaceBeforeParenthesizedExpressionInReturnOption);
1566
//		}
1567
//		final Object insertSpaceBeforePostfixOperatorOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_POSTFIX_OPERATOR);
1568
//		if (insertSpaceBeforePostfixOperatorOption != null) {
1569
//			this.insert_space_before_postfix_operator = CCorePlugin.INSERT.equals(insertSpaceBeforePostfixOperatorOption);
1570
//		}
1571
//		final Object insertSpaceBeforePrefixOperatorOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_PREFIX_OPERATOR);
1572
//		if (insertSpaceBeforePrefixOperatorOption != null) {
1573
//			this.insert_space_before_prefix_operator = CCorePlugin.INSERT.equals(insertSpaceBeforePrefixOperatorOption);
1574
//		}
1575
//		final Object insertSpaceBeforeQuestionInConditionalOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_QUESTION_IN_CONDITIONAL);
1576
//		if (insertSpaceBeforeQuestionInConditionalOption != null) {
1577
//			this.insert_space_before_question_in_conditional = CCorePlugin.INSERT.equals(insertSpaceBeforeQuestionInConditionalOption);
1578
//		}
1579
//		final Object insertSpaceBeforeQuestionInWildcardOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_QUESTION_IN_WILDCARD);
1580
//		if (insertSpaceBeforeQuestionInWildcardOption != null) {
1581
//			this.insert_space_before_question_in_wilcard = CCorePlugin.INSERT.equals(insertSpaceBeforeQuestionInWildcardOption);
1582
//		}
1583
//		final Object insertSpaceBeforeSemicolonOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_SEMICOLON);
1584
//		if (insertSpaceBeforeSemicolonOption != null) {
1585
//			this.insert_space_before_semicolon = CCorePlugin.INSERT.equals(insertSpaceBeforeSemicolonOption);
1586
//		}
1587
//		final Object insertSpaceBeforeSemicolonInForOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_SEMICOLON_IN_FOR);
1588
//		if (insertSpaceBeforeSemicolonInForOption != null) {
1589
//			this.insert_space_before_semicolon_in_for = CCorePlugin.INSERT.equals(insertSpaceBeforeSemicolonInForOption);
1590
//		}
1591
//		final Object insertSpaceBeforeUnaryOperatorOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_UNARY_OPERATOR);
1592
//		if (insertSpaceBeforeUnaryOperatorOption != null) {
1593
//			this.insert_space_before_unary_operator = CCorePlugin.INSERT.equals(insertSpaceBeforeUnaryOperatorOption);
1594
//		}
1595
//		final Object insertSpaceBetweenBracketsInArrayTypeReferenceOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_BRACKETS_IN_ARRAY_TYPE_REFERENCE);
1596
//		if (insertSpaceBetweenBracketsInArrayTypeReferenceOption != null) {
1597
//			this.insert_space_between_brackets_in_array_type_reference = CCorePlugin.INSERT.equals(insertSpaceBetweenBracketsInArrayTypeReferenceOption);
1598
//		}
1599
//		final Object insertSpaceBetweenEmptyBracesInArrayInitializerOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_BRACES_IN_ARRAY_INITIALIZER);
1600
//		if (insertSpaceBetweenEmptyBracesInArrayInitializerOption != null) {
1601
//			this.insert_space_between_empty_braces_in_array_initializer = CCorePlugin.INSERT.equals(insertSpaceBetweenEmptyBracesInArrayInitializerOption);
1602
//		}
1603
//		final Object insertSpaceBetweenEmptyBracketsInArrayAllocationExpressionOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_BRACKETS_IN_ARRAY_ALLOCATION_EXPRESSION);
1604
//		if (insertSpaceBetweenEmptyBracketsInArrayAllocationExpressionOption != null) {
1605
//			this.insert_space_between_empty_brackets_in_array_allocation_expression = CCorePlugin.INSERT.equals(insertSpaceBetweenEmptyBracketsInArrayAllocationExpressionOption);
1606
//		}
1607
//		final Object insertSpaceBetweenEmptyParensInConstructorDeclarationOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_CONSTRUCTOR_DECLARATION);
1608
//		if (insertSpaceBetweenEmptyParensInConstructorDeclarationOption != null) {
1609
//			this.insert_space_between_empty_parens_in_constructor_declaration = CCorePlugin.INSERT.equals(insertSpaceBetweenEmptyParensInConstructorDeclarationOption);
1610
//		}
1611
//		final Object insertSpaceBetweenEmptyParensInEnumConstantOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_ENUM_CONSTANT);
1612
//		if (insertSpaceBetweenEmptyParensInEnumConstantOption != null) {
1613
//			this.insert_space_between_empty_parens_in_enum_constant = CCorePlugin.INSERT.equals(insertSpaceBetweenEmptyParensInEnumConstantOption);
1614
//		}
1615
//		final Object insertSpaceBetweenEmptyParensInMethodDeclarationOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_METHOD_DECLARATION);
1616
//		if (insertSpaceBetweenEmptyParensInMethodDeclarationOption != null) {
1617
//			this.insert_space_between_empty_parens_in_method_declaration = CCorePlugin.INSERT.equals(insertSpaceBetweenEmptyParensInMethodDeclarationOption);
1618
//		}
1619
//		final Object insertSpaceBetweenEmptyParensInMethodInvocationOption = settings.get(CodeFormatterConstants.FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_METHOD_INVOCATION);
1620
//		if (insertSpaceBetweenEmptyParensInMethodInvocationOption != null) {
1621
//			this.insert_space_between_empty_parens_in_method_invocation = CCorePlugin.INSERT.equals(insertSpaceBetweenEmptyParensInMethodInvocationOption);
1622
//		}
1623
//		final Object compactElseIfOption = settings.get(CodeFormatterConstants.FORMATTER_COMPACT_ELSE_IF);
1624
//		if (compactElseIfOption != null) {
1625
//			this.compact_else_if = CodeFormatterConstants.TRUE.equals(compactElseIfOption);
1626
//		}
1627
//		final Object keepGuardianClauseOnOneLineOption = settings.get(CodeFormatterConstants.FORMATTER_KEEP_GUARDIAN_CLAUSE_ON_ONE_LINE);
1628
//		if (keepGuardianClauseOnOneLineOption != null) {
1629
//			this.keep_guardian_clause_on_one_line = CodeFormatterConstants.TRUE.equals(keepGuardianClauseOnOneLineOption);
1630
//		}
1631
//		final Object keepElseStatementOnSameLineOption = settings.get(CodeFormatterConstants.FORMATTER_KEEP_ELSE_STATEMENT_ON_SAME_LINE);
1632
//		if (keepElseStatementOnSameLineOption != null) {
1633
//			this.keep_else_statement_on_same_line = CodeFormatterConstants.TRUE.equals(keepElseStatementOnSameLineOption);
1634
//		}
1635
//		final Object keepEmptyArrayInitializerOnOneLineOption = settings.get(CodeFormatterConstants.FORMATTER_KEEP_EMPTY_ARRAY_INITIALIZER_ON_ONE_LINE);
1636
//		if (keepEmptyArrayInitializerOnOneLineOption != null) {
1637
//			this.keep_empty_array_initializer_on_one_line = CodeFormatterConstants.TRUE.equals(keepEmptyArrayInitializerOnOneLineOption);
1638
//		}
1639
//		final Object keepSimpleIfOnOneLineOption = settings.get(CodeFormatterConstants.FORMATTER_KEEP_SIMPLE_IF_ON_ONE_LINE);
1640
//		if (keepSimpleIfOnOneLineOption != null) {
1641
//			this.keep_simple_if_on_one_line = CodeFormatterConstants.TRUE.equals(keepSimpleIfOnOneLineOption);
1642
//		}
1643
//		final Object keepThenStatementOnSameLineOption = settings.get(CodeFormatterConstants.FORMATTER_KEEP_THEN_STATEMENT_ON_SAME_LINE);
1644
//		if (keepThenStatementOnSameLineOption != null) {
1645
//			this.keep_then_statement_on_same_line = CodeFormatterConstants.TRUE.equals(keepThenStatementOnSameLineOption);
1646
//		}
1647
//		final Object numberOfEmptyLinesToPreserveOption = settings.get(CodeFormatterConstants.FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE);
1648
//		if (numberOfEmptyLinesToPreserveOption != null) {
1649
//			try {
1650
//				this.number_of_empty_lines_to_preserve = Integer.parseInt((String) numberOfEmptyLinesToPreserveOption);
1651
//			} catch (NumberFormatException e) {
1652
//				this.number_of_empty_lines_to_preserve = 0;
1653
//			} catch(ClassCastException e) {
1654
//				this.number_of_empty_lines_to_preserve = 0;
1655
//			}
1656
//		}
1657
//		final Object putEmptyStatementOnNewLineOption = settings.get(CodeFormatterConstants.FORMATTER_PUT_EMPTY_STATEMENT_ON_NEW_LINE);
1658
//		if (putEmptyStatementOnNewLineOption != null) {
1659
//			this.put_empty_statement_on_new_line = CodeFormatterConstants.TRUE.equals(putEmptyStatementOnNewLineOption);
1660
//		}
1661
		final Object tabSizeOption = settings.get(CodeFormatterConstants.FORMATTER_TAB_SIZE);
1662
		if (tabSizeOption != null) {
1663
			try {
1664
				this.tab_size = Integer.parseInt((String) tabSizeOption);
1665
			} catch (NumberFormatException e) {
1666
				this.tab_size = 4;
1667
			} catch(ClassCastException e) {
1668
				this.tab_size = 4;
1669
			}
1670
		}
1671
		final Object useTabsOnlyForLeadingIndentationsOption = settings.get(CodeFormatterConstants.FORMATTER_USE_TABS_ONLY_FOR_LEADING_INDENTATIONS);
1672
		if (useTabsOnlyForLeadingIndentationsOption != null) {
1673
			this.use_tabs_only_for_leading_indentations = CodeFormatterConstants.TRUE.equals(useTabsOnlyForLeadingIndentationsOption);
1674
		}
1675
		final Object pageWidthOption = settings.get(CodeFormatterConstants.FORMATTER_LINE_SPLIT);
1676
		if (pageWidthOption != null) {
1677
			try {
1678
				this.page_width = Integer.parseInt((String) pageWidthOption);
1679
			} catch (NumberFormatException e) {
1680
				this.page_width = 80;
1681
			} catch(ClassCastException e) {
1682
				this.page_width = 80;
1683
			}
1684
		}
1685
		final Object useTabOption = settings.get(CodeFormatterConstants.FORMATTER_TAB_CHAR);
1686
		if (useTabOption != null) {
1687
			if (CCorePlugin.TAB.equals(useTabOption)) {
1688
				this.tab_char = TAB;
1689
			} else if (CCorePlugin.SPACE.equals(useTabOption)) {
1690
				this.tab_char = SPACE;
1691
			} else {
1692
				this.tab_char = MIXED;
1693
			}
1694
		}
1695
	}
1696
1697
	public void setDefaultSettings() {
1698
		this.alignment_for_arguments_in_allocation_expression = Alignment.M_COMPACT_SPLIT;
1699
		this.alignment_for_arguments_in_enum_constant = Alignment.M_COMPACT_SPLIT;
1700
		this.alignment_for_arguments_in_explicit_constructor_call = Alignment.M_COMPACT_SPLIT;
1701
		this.alignment_for_arguments_in_method_invocation = Alignment.M_COMPACT_SPLIT;
1702
		this.alignment_for_arguments_in_qualified_allocation_expression = Alignment.M_COMPACT_SPLIT;
1703
		this.alignment_for_assignment = Alignment.M_NO_ALIGNMENT;
1704
		this.alignment_for_binary_expression = Alignment.M_COMPACT_SPLIT;
1705
		this.alignment_for_compact_if = Alignment.M_ONE_PER_LINE_SPLIT | Alignment.M_INDENT_BY_ONE;
1706
		this.alignment_for_conditional_expression = Alignment.M_ONE_PER_LINE_SPLIT;
1707
		this.alignment_for_enum_constants = Alignment.NONE;
1708
		this.alignment_for_expressions_in_array_initializer = Alignment.M_COMPACT_SPLIT;
1709
		this.alignment_for_multiple_fields = Alignment.M_COMPACT_SPLIT;
1710
		this.alignment_for_parameters_in_constructor_declaration = Alignment.M_COMPACT_SPLIT;
1711
		this.alignment_for_parameters_in_method_declaration = Alignment.M_COMPACT_SPLIT;
1712
		this.alignment_for_selector_in_method_invocation = Alignment.M_COMPACT_SPLIT;
1713
		this.alignment_for_superclass_in_type_declaration = Alignment.M_NEXT_SHIFTED_SPLIT;
1714
		this.alignment_for_superinterfaces_in_enum_declaration = Alignment.M_NEXT_SHIFTED_SPLIT;
1715
		this.alignment_for_superinterfaces_in_type_declaration = Alignment.M_NEXT_SHIFTED_SPLIT;
1716
		this.alignment_for_throws_clause_in_constructor_declaration = Alignment.M_COMPACT_SPLIT;
1717
		this.alignment_for_throws_clause_in_method_declaration = Alignment.M_COMPACT_SPLIT;
1718
		this.align_type_members_on_columns = false;
1719
		this.brace_position_for_array_initializer = CodeFormatterConstants.END_OF_LINE;
1720
		this.brace_position_for_block = CodeFormatterConstants.END_OF_LINE;
1721
		this.brace_position_for_block_in_case = CodeFormatterConstants.END_OF_LINE;
1722
		this.brace_position_for_constructor_declaration = CodeFormatterConstants.END_OF_LINE;
1723
		this.brace_position_for_enum_constant = CodeFormatterConstants.END_OF_LINE;
1724
		this.brace_position_for_enum_declaration = CodeFormatterConstants.END_OF_LINE;
1725
		this.brace_position_for_method_declaration = CodeFormatterConstants.END_OF_LINE;
1726
		this.brace_position_for_type_declaration = CodeFormatterConstants.END_OF_LINE;
1727
		this.brace_position_for_switch = CodeFormatterConstants.END_OF_LINE;
1728
//		this.comment_clear_blank_lines = false;
1729
//		this.comment_format = true;
1730
//		this.comment_format_header = false;
1731
//		this.comment_format_html = true;
1732
//		this.comment_format_source = true;
1733
//		this.comment_indent_parameter_description = true;
1734
//		this.comment_indent_root_tags = true;
1735
//		this.comment_insert_empty_line_before_root_tags = true;
1736
//		this.comment_insert_new_line_for_parameter = true;
1737
//		this.comment_line_length = 80;
1738
		this.continuation_indentation = 2;
1739
		this.continuation_indentation_for_array_initializer = 2;
1740
//		this.blank_lines_after_imports = 0;
1741
//		this.blank_lines_after_package = 0;
1742
//		this.blank_lines_before_field = 0;
1743
//		this.blank_lines_before_first_class_body_declaration = 0;
1744
//		this.blank_lines_before_imports = 0;
1745
//		this.blank_lines_before_member_type = 0;
1746
//		this.blank_lines_before_method = 0;
1747
//		this.blank_lines_before_new_chunk = 0;
1748
//		this.blank_lines_before_package = 0;
1749
//		this.blank_lines_between_type_declarations = 0;
1750
//		this.blank_lines_at_beginning_of_method_body = 0;
1751
		this.indent_statements_compare_to_block = true;
1752
		this.indent_statements_compare_to_body = true;
1753
		this.indent_body_declarations_compare_to_enum_constant_header = true;
1754
		this.indent_body_declarations_compare_to_enum_declaration_header = true;
1755
		this.indent_body_declarations_compare_to_type_header = true;
1756
		this.indent_breaks_compare_to_cases = true;
1757
		this.indent_empty_lines = false;
1758
		this.indent_switchstatements_compare_to_cases = true;
1759
		this.indent_switchstatements_compare_to_switch = true;
1760
		this.indentation_size = 4;
1761
//		this.insert_new_line_after_opening_brace_in_array_initializer = false;
1762
//		this.insert_new_line_at_end_of_file_if_missing = false;
1763
//		this.insert_new_line_before_catch_in_try_statement = false;
1764
//		this.insert_new_line_before_closing_brace_in_array_initializer = false;
1765
//		this.insert_new_line_before_else_in_if_statement = false;
1766
//		this.insert_new_line_before_finally_in_try_statement = false;
1767
//		this.insert_new_line_before_while_in_do_statement = false;
1768
//		this.insert_new_line_in_empty_block = true;
1769
//		this.insert_new_line_in_empty_enum_constant = true;
1770
//		this.insert_new_line_in_empty_enum_declaration = true;
1771
//		this.insert_new_line_in_empty_method_body = true;
1772
//		this.insert_new_line_in_empty_type_declaration = true;
1773
//		this.insert_space_after_and_in_type_parameter = true;
1774
//		this.insert_space_after_assignment_operator = true;
1775
//		this.insert_space_after_binary_operator = true;
1776
//		this.insert_space_after_closing_angle_bracket_in_type_arguments = true;
1777
//		this.insert_space_after_closing_angle_bracket_in_type_parameters = true;
1778
//		this.insert_space_after_closing_paren_in_cast = true;
1779
//		this.insert_space_after_closing_brace_in_block = true;
1780
//		this.insert_space_after_colon_in_assert = true;
1781
//		this.insert_space_after_colon_in_case = true;
1782
//		this.insert_space_after_colon_in_conditional = true;
1783
//		this.insert_space_after_colon_in_for = true;
1784
//		this.insert_space_after_colon_in_labeled_statement = true;
1785
//		this.insert_space_after_comma_in_allocation_expression = true;
1786
//		this.insert_space_after_comma_in_array_initializer = true;
1787
//		this.insert_space_after_comma_in_constructor_declaration_parameters = true;
1788
//		this.insert_space_after_comma_in_constructor_declaration_throws = true;
1789
//		this.insert_space_after_comma_in_enum_constant_arguments = true;
1790
//		this.insert_space_after_comma_in_enum_declarations = true;
1791
//		this.insert_space_after_comma_in_explicit_constructor_call_arguments = true;
1792
//		this.insert_space_after_comma_in_for_increments = true;
1793
//		this.insert_space_after_comma_in_for_inits = true;
1794
//		this.insert_space_after_comma_in_method_invocation_arguments = true;
1795
//		this.insert_space_after_comma_in_method_declaration_parameters = true;
1796
//		this.insert_space_after_comma_in_method_declaration_throws = true;
1797
//		this.insert_space_after_comma_in_multiple_field_declarations = true;
1798
//		this.insert_space_after_comma_in_multiple_local_declarations = true;
1799
//		this.insert_space_after_comma_in_parameterized_type_reference = true;
1800
//		this.insert_space_after_comma_in_superinterfaces = true;
1801
//		this.insert_space_after_comma_in_type_arguments = true;
1802
//		this.insert_space_after_comma_in_type_parameters = true;
1803
//		this.insert_space_after_ellipsis = true;
1804
//		this.insert_space_after_opening_angle_bracket_in_parameterized_type_reference = false;
1805
//		this.insert_space_after_opening_angle_bracket_in_type_arguments = false;
1806
//		this.insert_space_after_opening_angle_bracket_in_type_parameters = false;
1807
//		this.insert_space_after_opening_bracket_in_array_allocation_expression = false;
1808
//		this.insert_space_after_opening_bracket_in_array_reference = false;
1809
//		this.insert_space_after_opening_brace_in_array_initializer = false;
1810
//		this.insert_space_after_opening_paren_in_cast = false;
1811
//		this.insert_space_after_opening_paren_in_catch = false;
1812
//		this.insert_space_after_opening_paren_in_constructor_declaration = false;
1813
//		this.insert_space_after_opening_paren_in_enum_constant = false;
1814
//		this.insert_space_after_opening_paren_in_for = false;
1815
//		this.insert_space_after_opening_paren_in_if = false;
1816
//		this.insert_space_after_opening_paren_in_method_declaration = false;
1817
//		this.insert_space_after_opening_paren_in_method_invocation = false;
1818
//		this.insert_space_after_opening_paren_in_parenthesized_expression = false;
1819
//		this.insert_space_after_opening_paren_in_switch = false;
1820
//		this.insert_space_after_opening_paren_in_synchronized = false;
1821
//		this.insert_space_after_opening_paren_in_while = false;
1822
//		this.insert_space_after_postfix_operator = false;
1823
//		this.insert_space_after_prefix_operator = false;
1824
//		this.insert_space_after_question_in_conditional = true;
1825
//		this.insert_space_after_question_in_wilcard = false;
1826
//		this.insert_space_after_semicolon_in_for = true;
1827
//		this.insert_space_after_unary_operator = false;
1828
//		this.insert_space_before_and_in_type_parameter = true;
1829
//		this.insert_space_before_assignment_operator = true;
1830
//		this.insert_space_before_binary_operator = true;
1831
//		this.insert_space_before_closing_angle_bracket_in_parameterized_type_reference = false;
1832
//		this.insert_space_before_closing_angle_bracket_in_type_arguments = false;
1833
//		this.insert_space_before_closing_angle_bracket_in_type_parameters = false;
1834
//		this.insert_space_before_closing_brace_in_array_initializer = false;
1835
//		this.insert_space_before_closing_bracket_in_array_allocation_expression = false;
1836
//		this.insert_space_before_closing_bracket_in_array_reference = false;
1837
//		this.insert_space_before_closing_paren_in_cast = false;
1838
//		this.insert_space_before_closing_paren_in_catch = false;
1839
//		this.insert_space_before_closing_paren_in_constructor_declaration = false;
1840
//		this.insert_space_before_closing_paren_in_enum_constant = false;
1841
//		this.insert_space_before_closing_paren_in_for = false;
1842
//		this.insert_space_before_closing_paren_in_if = false;
1843
//		this.insert_space_before_closing_paren_in_method_declaration = false;
1844
//		this.insert_space_before_closing_paren_in_method_invocation = false;
1845
//		this.insert_space_before_closing_paren_in_parenthesized_expression = false;
1846
//		this.insert_space_before_closing_paren_in_switch = false;
1847
//		this.insert_space_before_closing_paren_in_synchronized = false;
1848
//		this.insert_space_before_closing_paren_in_while = false;
1849
//		this.insert_space_before_colon_in_assert = true;
1850
//		this.insert_space_before_colon_in_case = true;
1851
//		this.insert_space_before_colon_in_conditional = true;
1852
//		this.insert_space_before_colon_in_default = true;
1853
//		this.insert_space_before_colon_in_for = true;
1854
//		this.insert_space_before_colon_in_labeled_statement = true;
1855
//		this.insert_space_before_comma_in_allocation_expression = false;
1856
//		this.insert_space_before_comma_in_array_initializer = false;
1857
//		this.insert_space_before_comma_in_constructor_declaration_parameters = false;
1858
//		this.insert_space_before_comma_in_constructor_declaration_throws = false;
1859
//		this.insert_space_before_comma_in_enum_constant_arguments = false;
1860
//		this.insert_space_before_comma_in_enum_declarations = false;
1861
//		this.insert_space_before_comma_in_explicit_constructor_call_arguments = false;
1862
//		this.insert_space_before_comma_in_for_increments = false;
1863
//		this.insert_space_before_comma_in_for_inits = false;
1864
//		this.insert_space_before_comma_in_method_invocation_arguments = false;
1865
//		this.insert_space_before_comma_in_method_declaration_parameters = false;
1866
//		this.insert_space_before_comma_in_method_declaration_throws = false;
1867
//		this.insert_space_before_comma_in_multiple_field_declarations = false;
1868
//		this.insert_space_before_comma_in_multiple_local_declarations = false;
1869
//		this.insert_space_before_comma_in_parameterized_type_reference = false;
1870
//		this.insert_space_before_comma_in_superinterfaces = false;
1871
//		this.insert_space_before_comma_in_type_arguments = false;
1872
//		this.insert_space_before_comma_in_type_parameters = false;
1873
//		this.insert_space_before_ellipsis = false;
1874
//		this.insert_space_before_parenthesized_expression_in_return = true;
1875
//		this.insert_space_before_opening_angle_bracket_in_parameterized_type_reference = false;
1876
//		this.insert_space_before_opening_angle_bracket_in_type_arguments = false;
1877
//		this.insert_space_before_opening_angle_bracket_in_type_parameters = false;
1878
//		this.insert_space_before_opening_brace_in_array_initializer = false;
1879
//		this.insert_space_before_opening_brace_in_block = true;
1880
//		this.insert_space_before_opening_brace_in_constructor_declaration = true;
1881
//		this.insert_space_before_opening_brace_in_enum_constant = true;
1882
//		this.insert_space_before_opening_brace_in_enum_declaration = true;
1883
//		this.insert_space_before_opening_brace_in_method_declaration = true;
1884
//		this.insert_space_before_opening_brace_in_switch = true;
1885
//		this.insert_space_before_opening_brace_in_type_declaration = true;
1886
//		this.insert_space_before_opening_bracket_in_array_allocation_expression = false;
1887
//		this.insert_space_before_opening_bracket_in_array_reference = false;
1888
//		this.insert_space_before_opening_bracket_in_array_type_reference = false;
1889
//		this.insert_space_before_opening_paren_in_catch = true;
1890
//		this.insert_space_before_opening_paren_in_constructor_declaration = false;
1891
//		this.insert_space_before_opening_paren_in_enum_constant = false;
1892
//		this.insert_space_before_opening_paren_in_for = true;
1893
//		this.insert_space_before_opening_paren_in_if = true;
1894
//		this.insert_space_before_opening_paren_in_method_invocation = false;
1895
//		this.insert_space_before_opening_paren_in_method_declaration = false;
1896
//		this.insert_space_before_opening_paren_in_switch = true;
1897
//		this.insert_space_before_opening_paren_in_synchronized = true;
1898
//		this.insert_space_before_opening_paren_in_parenthesized_expression = false;
1899
//		this.insert_space_before_opening_paren_in_while = true;
1900
//		this.insert_space_before_postfix_operator = false;
1901
//		this.insert_space_before_prefix_operator = false;
1902
//		this.insert_space_before_question_in_conditional = true;
1903
//		this.insert_space_before_question_in_wilcard = false;
1904
//		this.insert_space_before_semicolon = false;
1905
//		this.insert_space_before_semicolon_in_for = false;
1906
//		this.insert_space_before_unary_operator = false;
1907
//		this.insert_space_between_brackets_in_array_type_reference = false;
1908
//		this.insert_space_between_empty_braces_in_array_initializer = false;
1909
//		this.insert_space_between_empty_brackets_in_array_allocation_expression = false;
1910
//		this.insert_space_between_empty_parens_in_constructor_declaration = false;
1911
//		this.insert_space_between_empty_parens_in_enum_constant = false;
1912
//		this.insert_space_between_empty_parens_in_method_declaration = false;
1913
//		this.insert_space_between_empty_parens_in_method_invocation = false;
1914
//		this.compact_else_if = true;
1915
//		this.keep_guardian_clause_on_one_line = false;
1916
//		this.keep_else_statement_on_same_line = false;
1917
//		this.keep_empty_array_initializer_on_one_line = false;
1918
//		this.keep_simple_if_on_one_line = false;
1919
//		this.keep_then_statement_on_same_line = false;
1920
//		this.number_of_empty_lines_to_preserve = 1;
1921
//		this.put_empty_statement_on_new_line = false;
1922
		this.tab_size = 4;
1923
		this.page_width = 80;
1924
		this.tab_char = TAB; // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=49081
1925
		this.use_tabs_only_for_leading_indentations = false;
1926
	}
1927
	
1928
	public void setEclipseDefaultSettings() {
1929
		this.alignment_for_arguments_in_allocation_expression = Alignment.M_COMPACT_SPLIT;
1930
		this.alignment_for_arguments_in_enum_constant = Alignment.M_COMPACT_SPLIT;
1931
		this.alignment_for_arguments_in_explicit_constructor_call = Alignment.M_COMPACT_SPLIT;
1932
		this.alignment_for_arguments_in_method_invocation = Alignment.M_COMPACT_SPLIT;
1933
		this.alignment_for_arguments_in_qualified_allocation_expression = Alignment.M_COMPACT_SPLIT;
1934
		this.alignment_for_assignment = Alignment.M_NO_ALIGNMENT;
1935
		this.alignment_for_binary_expression = Alignment.M_COMPACT_SPLIT;
1936
		this.alignment_for_compact_if = Alignment.M_COMPACT_SPLIT;
1937
		this.alignment_for_conditional_expression = Alignment.M_NEXT_PER_LINE_SPLIT;
1938
		this.alignment_for_enum_constants = Alignment.NONE;
1939
		this.alignment_for_expressions_in_array_initializer = Alignment.M_COMPACT_SPLIT;
1940
		this.alignment_for_multiple_fields = Alignment.M_COMPACT_SPLIT;
1941
		this.alignment_for_parameters_in_constructor_declaration = Alignment.M_COMPACT_SPLIT;
1942
		this.alignment_for_parameters_in_method_declaration = Alignment.M_COMPACT_SPLIT;
1943
		this.alignment_for_selector_in_method_invocation = Alignment.M_COMPACT_SPLIT;
1944
		this.alignment_for_superclass_in_type_declaration = Alignment.M_COMPACT_SPLIT;
1945
		this.alignment_for_superinterfaces_in_enum_declaration = Alignment.M_COMPACT_SPLIT;
1946
		this.alignment_for_superinterfaces_in_type_declaration = Alignment.M_COMPACT_SPLIT;
1947
		this.alignment_for_throws_clause_in_constructor_declaration = Alignment.M_COMPACT_SPLIT;
1948
		this.alignment_for_throws_clause_in_method_declaration = Alignment.M_COMPACT_SPLIT;
1949
		this.align_type_members_on_columns = false;
1950
		this.brace_position_for_array_initializer = CodeFormatterConstants.END_OF_LINE;
1951
		this.brace_position_for_block = CodeFormatterConstants.END_OF_LINE;
1952
		this.brace_position_for_block_in_case = CodeFormatterConstants.END_OF_LINE;
1953
		this.brace_position_for_constructor_declaration = CodeFormatterConstants.END_OF_LINE;
1954
		this.brace_position_for_enum_constant = CodeFormatterConstants.END_OF_LINE;
1955
		this.brace_position_for_enum_declaration = CodeFormatterConstants.END_OF_LINE;
1956
		this.brace_position_for_method_declaration = CodeFormatterConstants.END_OF_LINE;
1957
		this.brace_position_for_type_declaration = CodeFormatterConstants.END_OF_LINE;
1958
		this.brace_position_for_switch = CodeFormatterConstants.END_OF_LINE;
1959
//		this.comment_clear_blank_lines = false;
1960
//		this.comment_format = true;
1961
//		this.comment_format_header = false;
1962
//		this.comment_format_html = true;
1963
//		this.comment_format_source = true;
1964
//		this.comment_indent_parameter_description = true;
1965
//		this.comment_indent_root_tags = true;
1966
//		this.comment_insert_empty_line_before_root_tags = true;
1967
//		this.comment_insert_new_line_for_parameter = true;
1968
//		this.comment_line_length = 80;
1969
		this.continuation_indentation = 2;
1970
		this.continuation_indentation_for_array_initializer = 2;
1971
//		this.blank_lines_after_imports = 1;
1972
//		this.blank_lines_after_package = 1;
1973
//		this.blank_lines_before_field = 1;
1974
//		this.blank_lines_before_first_class_body_declaration = 0;
1975
//		this.blank_lines_before_imports = 1;
1976
//		this.blank_lines_before_member_type = 1;
1977
//		this.blank_lines_before_method = 1;
1978
//		this.blank_lines_before_new_chunk = 1;
1979
//		this.blank_lines_before_package = 0;
1980
//		this.blank_lines_between_type_declarations = 1;
1981
//		this.blank_lines_at_beginning_of_method_body = 0;
1982
		this.indent_statements_compare_to_block = true;
1983
		this.indent_statements_compare_to_body = true;
1984
		this.indent_body_declarations_compare_to_enum_constant_header = true;
1985
		this.indent_body_declarations_compare_to_enum_declaration_header = true;
1986
		this.indent_body_declarations_compare_to_type_header = true;
1987
		this.indent_breaks_compare_to_cases = true;
1988
		this.indent_empty_lines = false;
1989
		this.indent_switchstatements_compare_to_cases = true;
1990
		this.indent_switchstatements_compare_to_switch = false;
1991
		this.indentation_size = 4;
1992
//		this.insert_new_line_after_opening_brace_in_array_initializer = false;
1993
//		this.insert_new_line_at_end_of_file_if_missing = false;
1994
//		this.insert_new_line_before_catch_in_try_statement = false;
1995
//		this.insert_new_line_before_closing_brace_in_array_initializer = false;
1996
//		this.insert_new_line_before_else_in_if_statement = false;
1997
//		this.insert_new_line_before_finally_in_try_statement = false;
1998
//		this.insert_new_line_before_while_in_do_statement = false;
1999
//		this.insert_new_line_in_empty_block = true;
2000
//		this.insert_new_line_in_empty_enum_constant = true;
2001
//		this.insert_new_line_in_empty_enum_declaration = true;
2002
//		this.insert_new_line_in_empty_method_body = true;
2003
//		this.insert_new_line_in_empty_type_declaration = true;
2004
//		this.insert_space_after_and_in_type_parameter = true;
2005
//		this.insert_space_after_assignment_operator = true;
2006
//		this.insert_space_after_binary_operator = true;
2007
//		this.insert_space_after_closing_angle_bracket_in_type_arguments = true;
2008
//		this.insert_space_after_closing_angle_bracket_in_type_parameters = true;
2009
//		this.insert_space_after_closing_paren_in_cast = true;
2010
//		this.insert_space_after_closing_brace_in_block = true;
2011
//		this.insert_space_after_colon_in_assert = true;
2012
//		this.insert_space_after_colon_in_case = true;
2013
//		this.insert_space_after_colon_in_conditional = true;
2014
//		this.insert_space_after_colon_in_for = true;
2015
//		this.insert_space_after_colon_in_labeled_statement = true;
2016
//		this.insert_space_after_comma_in_allocation_expression = true;
2017
//		this.insert_space_after_comma_in_array_initializer = true;
2018
//		this.insert_space_after_comma_in_constructor_declaration_parameters = true;
2019
//		this.insert_space_after_comma_in_constructor_declaration_throws = true;
2020
//		this.insert_space_after_comma_in_enum_constant_arguments = true;
2021
//		this.insert_space_after_comma_in_enum_declarations = true;
2022
//		this.insert_space_after_comma_in_explicit_constructor_call_arguments = true;
2023
//		this.insert_space_after_comma_in_for_increments = true;
2024
//		this.insert_space_after_comma_in_for_inits = true;
2025
//		this.insert_space_after_comma_in_method_invocation_arguments = true;
2026
//		this.insert_space_after_comma_in_method_declaration_parameters = true;
2027
//		this.insert_space_after_comma_in_method_declaration_throws = true;
2028
//		this.insert_space_after_comma_in_multiple_field_declarations = true;
2029
//		this.insert_space_after_comma_in_multiple_local_declarations = true;
2030
//		this.insert_space_after_comma_in_parameterized_type_reference = true;
2031
//		this.insert_space_after_comma_in_superinterfaces = true;
2032
//		this.insert_space_after_comma_in_type_arguments = true;
2033
//		this.insert_space_after_comma_in_type_parameters = true;
2034
//		this.insert_space_after_ellipsis = true;
2035
//		this.insert_space_after_opening_angle_bracket_in_parameterized_type_reference = false;
2036
//		this.insert_space_after_opening_angle_bracket_in_type_arguments = false;
2037
//		this.insert_space_after_opening_angle_bracket_in_type_parameters = false;
2038
//		this.insert_space_after_opening_bracket_in_array_allocation_expression = false;
2039
//		this.insert_space_after_opening_bracket_in_array_reference = false;
2040
//		this.insert_space_after_opening_brace_in_array_initializer = true;
2041
//		this.insert_space_after_opening_paren_in_cast = false;
2042
//		this.insert_space_after_opening_paren_in_catch = false;
2043
//		this.insert_space_after_opening_paren_in_constructor_declaration = false;
2044
//		this.insert_space_after_opening_paren_in_enum_constant = false;
2045
//		this.insert_space_after_opening_paren_in_for = false;
2046
//		this.insert_space_after_opening_paren_in_if = false;
2047
//		this.insert_space_after_opening_paren_in_method_declaration = false;
2048
//		this.insert_space_after_opening_paren_in_method_invocation = false;
2049
//		this.insert_space_after_opening_paren_in_parenthesized_expression = false;
2050
//		this.insert_space_after_opening_paren_in_switch = false;
2051
//		this.insert_space_after_opening_paren_in_synchronized = false;
2052
//		this.insert_space_after_opening_paren_in_while = false;
2053
//		this.insert_space_after_postfix_operator = false;
2054
//		this.insert_space_after_prefix_operator = false;
2055
//		this.insert_space_after_question_in_conditional = true;
2056
//		this.insert_space_after_question_in_wilcard = false;
2057
//		this.insert_space_after_semicolon_in_for = true;
2058
//		this.insert_space_after_unary_operator = false;
2059
//		this.insert_space_before_and_in_type_parameter = true;
2060
//		this.insert_space_before_assignment_operator = true;
2061
//		this.insert_space_before_binary_operator = true;
2062
//		this.insert_space_before_closing_angle_bracket_in_parameterized_type_reference = false;
2063
//		this.insert_space_before_closing_angle_bracket_in_type_arguments = false;
2064
//		this.insert_space_before_closing_angle_bracket_in_type_parameters = false;
2065
//		this.insert_space_before_closing_brace_in_array_initializer = true;
2066
//		this.insert_space_before_closing_bracket_in_array_allocation_expression = false;
2067
//		this.insert_space_before_closing_bracket_in_array_reference = false;
2068
//		this.insert_space_before_closing_paren_in_cast = false;
2069
//		this.insert_space_before_closing_paren_in_catch = false;
2070
//		this.insert_space_before_closing_paren_in_constructor_declaration = false;
2071
//		this.insert_space_before_closing_paren_in_enum_constant = false;
2072
//		this.insert_space_before_closing_paren_in_for = false;
2073
//		this.insert_space_before_closing_paren_in_if = false;
2074
//		this.insert_space_before_closing_paren_in_method_declaration = false;
2075
//		this.insert_space_before_closing_paren_in_method_invocation = false;
2076
//		this.insert_space_before_closing_paren_in_parenthesized_expression = false;
2077
//		this.insert_space_before_closing_paren_in_switch = false;
2078
//		this.insert_space_before_closing_paren_in_synchronized = false;
2079
//		this.insert_space_before_closing_paren_in_while = false;
2080
//		this.insert_space_before_colon_in_assert = true;
2081
//		this.insert_space_before_colon_in_case = false;
2082
//		this.insert_space_before_colon_in_conditional = true;
2083
//		this.insert_space_before_colon_in_default = false;
2084
//		this.insert_space_before_colon_in_for = true;
2085
//		this.insert_space_before_colon_in_labeled_statement = false;
2086
//		this.insert_space_before_comma_in_allocation_expression = false;
2087
//		this.insert_space_before_comma_in_array_initializer = false;
2088
//		this.insert_space_before_comma_in_constructor_declaration_parameters = false;
2089
//		this.insert_space_before_comma_in_constructor_declaration_throws = false;
2090
//		this.insert_space_before_comma_in_enum_constant_arguments = false;
2091
//		this.insert_space_before_comma_in_enum_declarations = false;
2092
//		this.insert_space_before_comma_in_explicit_constructor_call_arguments = false;
2093
//		this.insert_space_before_comma_in_for_increments = false;
2094
//		this.insert_space_before_comma_in_for_inits = false;
2095
//		this.insert_space_before_comma_in_method_invocation_arguments = false;
2096
//		this.insert_space_before_comma_in_method_declaration_parameters = false;
2097
//		this.insert_space_before_comma_in_method_declaration_throws = false;
2098
//		this.insert_space_before_comma_in_multiple_field_declarations = false;
2099
//		this.insert_space_before_comma_in_multiple_local_declarations = false;
2100
//		this.insert_space_before_comma_in_parameterized_type_reference = false;
2101
//		this.insert_space_before_comma_in_superinterfaces = false;
2102
//		this.insert_space_before_comma_in_type_arguments = false;
2103
//		this.insert_space_before_comma_in_type_parameters = false;
2104
//		this.insert_space_before_ellipsis = false;
2105
//		this.insert_space_before_parenthesized_expression_in_return = true;
2106
//		this.insert_space_before_opening_angle_bracket_in_parameterized_type_reference = false;
2107
//		this.insert_space_before_opening_angle_bracket_in_type_arguments = false;
2108
//		this.insert_space_before_opening_angle_bracket_in_type_parameters = false;
2109
//		this.insert_space_before_opening_brace_in_array_initializer = true;
2110
//		this.insert_space_before_opening_brace_in_block = true;
2111
//		this.insert_space_before_opening_brace_in_constructor_declaration = true;
2112
//		this.insert_space_before_opening_brace_in_enum_constant = true;
2113
//		this.insert_space_before_opening_brace_in_enum_declaration = true;
2114
//		this.insert_space_before_opening_brace_in_method_declaration = true;
2115
//		this.insert_space_before_opening_brace_in_switch = true;
2116
//		this.insert_space_before_opening_brace_in_type_declaration = true;
2117
//		this.insert_space_before_opening_bracket_in_array_allocation_expression = false;
2118
//		this.insert_space_before_opening_bracket_in_array_reference = false;
2119
//		this.insert_space_before_opening_bracket_in_array_type_reference = false;
2120
//		this.insert_space_before_opening_paren_in_catch = true;
2121
//		this.insert_space_before_opening_paren_in_constructor_declaration = false;
2122
//		this.insert_space_before_opening_paren_in_enum_constant = false;
2123
//		this.insert_space_before_opening_paren_in_for = true;
2124
//		this.insert_space_before_opening_paren_in_if = true;
2125
//		this.insert_space_before_opening_paren_in_method_invocation = false;
2126
//		this.insert_space_before_opening_paren_in_method_declaration = false;
2127
//		this.insert_space_before_opening_paren_in_switch = true;
2128
//		this.insert_space_before_opening_paren_in_synchronized = true;
2129
//		this.insert_space_before_opening_paren_in_parenthesized_expression = false;
2130
//		this.insert_space_before_opening_paren_in_while = true;
2131
//		this.insert_space_before_postfix_operator = false;
2132
//		this.insert_space_before_prefix_operator = false;
2133
//		this.insert_space_before_question_in_conditional = true;
2134
//		this.insert_space_before_question_in_wilcard = false;
2135
//		this.insert_space_before_semicolon = false;
2136
//		this.insert_space_before_semicolon_in_for = false;
2137
//		this.insert_space_before_unary_operator = false;
2138
//		this.insert_space_between_brackets_in_array_type_reference = false;
2139
//		this.insert_space_between_empty_braces_in_array_initializer = false;
2140
//		this.insert_space_between_empty_brackets_in_array_allocation_expression = false;
2141
//		this.insert_space_between_empty_parens_in_constructor_declaration = false;
2142
//		this.insert_space_between_empty_parens_in_enum_constant = false;
2143
//		this.insert_space_between_empty_parens_in_method_declaration = false;
2144
//		this.insert_space_between_empty_parens_in_method_invocation = false;
2145
//		this.compact_else_if = true;
2146
//		this.keep_guardian_clause_on_one_line = false;
2147
//		this.keep_else_statement_on_same_line = false;
2148
//		this.keep_empty_array_initializer_on_one_line = false;
2149
//		this.keep_simple_if_on_one_line = false;
2150
//		this.keep_then_statement_on_same_line = false;
2151
//		this.number_of_empty_lines_to_preserve = 1;
2152
//		this.put_empty_statement_on_new_line = true;
2153
		this.tab_size = 4;
2154
		this.page_width = 80;
2155
		this.tab_char = TAB;
2156
		this.use_tabs_only_for_leading_indentations = false;
2157
	}
2158
}

Return to bug 148582