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
9 * IBM Corporation - initial API and implementation
10 *******************************************************************************/
12 package net.sourceforge.phpdt.internal.ui.text.comment;
14 import net.sourceforge.phpdt.ui.PreferenceConstants;
16 import org.eclipse.jface.text.formatter.FormattingContext;
19 * Formatting context for the comment formatter.
23 public class CommentFormattingContext extends FormattingContext {
26 * @see org.eclipse.jface.text.formatter.IFormattingContext#getPreferenceKeys()
28 public String[] getPreferenceKeys() {
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 };
43 * @see org.eclipse.jface.text.formatter.IFormattingContext#isBooleanPreference(java.lang.String)
45 public boolean isBooleanPreference(String key) {
46 return !key.equals(PreferenceConstants.FORMATTER_COMMENT_LINELENGTH);
50 * @see org.eclipse.jface.text.formatter.IFormattingContext#isIntegerPreference(java.lang.String)
52 public boolean isIntegerPreference(String key) {
53 return key.equals(PreferenceConstants.FORMATTER_COMMENT_LINELENGTH);