127f2856f70b0659f954b0d82af66011d621d386
[phpeclipse.git] /
1 /*******************************************************************************
2  * Copyright (c) 2000, 2004 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials 
4  * are made available under the terms of the Common Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/cpl-v10.html
7  * 
8  * Contributors:
9  *     IBM Corporation - initial API and implementation
10  *******************************************************************************/
11
12 package net.sourceforge.phpdt.internal.ui.text.comment;
13
14 import net.sourceforge.phpdt.ui.PreferenceConstants;
15
16 import org.eclipse.jface.text.formatter.FormattingContext;
17
18 /**
19  * Formatting context for the comment formatter.
20  * 
21  * @since 3.0
22  */
23 public class CommentFormattingContext extends FormattingContext {
24
25         /*
26          * @see org.eclipse.jface.text.formatter.IFormattingContext#getPreferenceKeys()
27          */
28         public String[] getPreferenceKeys() {
29                 return new String[] {
30                                 PreferenceConstants.FORMATTER_COMMENT_FORMAT,
31                                 PreferenceConstants.FORMATTER_COMMENT_FORMATHEADER,
32                                 PreferenceConstants.FORMATTER_COMMENT_FORMATSOURCE,
33                                 PreferenceConstants.FORMATTER_COMMENT_INDENTPARAMETERDESCRIPTION,
34                                 PreferenceConstants.FORMATTER_COMMENT_INDENTROOTTAGS,
35                                 PreferenceConstants.FORMATTER_COMMENT_NEWLINEFORPARAMETER,
36                                 PreferenceConstants.FORMATTER_COMMENT_SEPARATEROOTTAGS,
37                                 PreferenceConstants.FORMATTER_COMMENT_LINELENGTH,
38                                 PreferenceConstants.FORMATTER_COMMENT_CLEARBLANKLINES,
39                                 PreferenceConstants.FORMATTER_COMMENT_FORMATHTML };
40         }
41
42         /*
43          * @see org.eclipse.jface.text.formatter.IFormattingContext#isBooleanPreference(java.lang.String)
44          */
45         public boolean isBooleanPreference(String key) {
46                 return !key.equals(PreferenceConstants.FORMATTER_COMMENT_LINELENGTH);
47         }
48
49         /*
50          * @see org.eclipse.jface.text.formatter.IFormattingContext#isIntegerPreference(java.lang.String)
51          */
52         public boolean isIntegerPreference(String key) {
53                 return key.equals(PreferenceConstants.FORMATTER_COMMENT_LINELENGTH);
54         }
55 }