1 11 12 package org.eclipse.jdt.internal.ui.text.comment; 13 14 import org.eclipse.jface.text.formatter.FormattingContext; 15 16 import org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants; 17 18 23 public class CommentFormattingContext extends FormattingContext { 24 25 28 public String [] getPreferenceKeys() { 29 return new String [] { 30 DefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT_BLOCK_COMMENT, 31 DefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT_JAVADOC_COMMENT, 32 DefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT_LINE_COMMENT, 33 DefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT_HEADER, 34 DefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT_SOURCE, 35 DefaultCodeFormatterConstants.FORMATTER_COMMENT_INDENT_PARAMETER_DESCRIPTION, 36 DefaultCodeFormatterConstants.FORMATTER_COMMENT_INDENT_ROOT_TAGS, 37 DefaultCodeFormatterConstants.FORMATTER_COMMENT_INSERT_NEW_LINE_FOR_PARAMETER, 38 DefaultCodeFormatterConstants.FORMATTER_COMMENT_INSERT_EMPTY_LINE_BEFORE_ROOT_TAGS, 39 DefaultCodeFormatterConstants.FORMATTER_COMMENT_LINE_LENGTH, 40 DefaultCodeFormatterConstants.FORMATTER_COMMENT_CLEAR_BLANK_LINES_IN_BLOCK_COMMENT, 41 DefaultCodeFormatterConstants.FORMATTER_COMMENT_CLEAR_BLANK_LINES_IN_JAVADOC_COMMENT, 42 DefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT_HTML }; } 43 44 45 48 public boolean isBooleanPreference(String key) { 49 return !key.equals(DefaultCodeFormatterConstants.FORMATTER_COMMENT_LINE_LENGTH); 50 } 51 52 55 public boolean isIntegerPreference(String key) { 56 return key.equals(DefaultCodeFormatterConstants.FORMATTER_COMMENT_LINE_LENGTH); 57 } 58 } 59 | Popular Tags |