blob: fa04d6ad247d79202bc4c5e460b36b3889ffea41 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2000, 2005 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.jdt.internal.ui.text.comment;
import org.eclipse.jface.text.formatter.FormattingContext;
import org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants;
/**
* Formatting context for the comment formatter.
*
* @since 3.0
*/
public class CommentFormattingContext extends FormattingContext {
/*
* @see org.eclipse.jface.text.formatter.IFormattingContext#getPreferenceKeys()
*/
public String[] getPreferenceKeys() {
return new String[] {
DefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT,
DefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT_HEADER,
DefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT_SOURCE,
DefaultCodeFormatterConstants.FORMATTER_COMMENT_INDENT_PARAMETER_DESCRIPTION,
DefaultCodeFormatterConstants.FORMATTER_COMMENT_INDENT_ROOT_TAGS,
DefaultCodeFormatterConstants.FORMATTER_COMMENT_INSERT_NEW_LINE_FOR_PARAMETER,
DefaultCodeFormatterConstants.FORMATTER_COMMENT_INSERT_EMPTY_LINE_BEFORE_ROOT_TAGS,
DefaultCodeFormatterConstants.FORMATTER_COMMENT_LINE_LENGTH,
DefaultCodeFormatterConstants.FORMATTER_COMMENT_CLEAR_BLANK_LINES,
DefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT_HTML }; }
/*
* @see org.eclipse.jface.text.formatter.IFormattingContext#isBooleanPreference(java.lang.String)
*/
public boolean isBooleanPreference(String key) {
return !key.equals(DefaultCodeFormatterConstants.FORMATTER_COMMENT_LINE_LENGTH);
}
/*
* @see org.eclipse.jface.text.formatter.IFormattingContext#isIntegerPreference(java.lang.String)
*/
public boolean isIntegerPreference(String key) {
return key.equals(DefaultCodeFormatterConstants.FORMATTER_COMMENT_LINE_LENGTH);
}
}