当前位置: 首页>>代码示例>>Java>>正文


Java CodeFormatter.K_JAVA_DOC属性代码示例

本文整理汇总了Java中org.eclipse.jdt.core.formatter.CodeFormatter.K_JAVA_DOC属性的典型用法代码示例。如果您正苦于以下问题:Java CodeFormatter.K_JAVA_DOC属性的具体用法?Java CodeFormatter.K_JAVA_DOC怎么用?Java CodeFormatter.K_JAVA_DOC使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.eclipse.jdt.core.formatter.CodeFormatter的用法示例。


在下文中一共展示了CodeFormatter.K_JAVA_DOC属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: Scribe

Scribe(CodeFormatterVisitor formatter, long sourceLevel, IRegion[] regions, CodeSnippetParsingUtil codeSnippetParsingUtil, boolean includeComments) {
	initializeScanner(sourceLevel, formatter.preferences);
	this.formatter = formatter;
	this.pageWidth = formatter.preferences.page_width;
	this.tabLength = formatter.preferences.tab_size;
	this.indentationLevel= 0; // initialize properly
	this.numberOfIndentations = 0;
	this.useTabsOnlyForLeadingIndents = formatter.preferences.use_tabs_only_for_leading_indentations;
	this.indentEmptyLines = formatter.preferences.indent_empty_lines;
	this.tabChar = formatter.preferences.tab_char;
	if (this.tabChar == DefaultCodeFormatterOptions.MIXED) {
		this.indentationSize = formatter.preferences.indentation_size;
	} else {
		this.indentationSize = this.tabLength;
	}
	this.lineSeparator = formatter.preferences.line_separator;
	this.lineSeparatorAndSpace = this.lineSeparator+' ';
	this.firstLS = this.lineSeparator.charAt(0);
	this.lsLength = this.lineSeparator.length();
	this.indentationLevel = formatter.preferences.initial_indentation_level * this.indentationSize;
	this.regions= regions;
	if (codeSnippetParsingUtil != null) {
		final RecordedParsingInformation information = codeSnippetParsingUtil.recordedParsingInformation;
		if (information != null) {
			this.lineEnds = information.lineEnds;
			this.commentPositions = information.commentPositions;
		}
	}
	if (formatter.preferences.comment_format_line_comment) this.formatComments |= CodeFormatter.K_SINGLE_LINE_COMMENT;
	if (formatter.preferences.comment_format_block_comment) this.formatComments |= CodeFormatter.K_MULTI_LINE_COMMENT;
	if (formatter.preferences.comment_format_javadoc_comment) this.formatComments |= CodeFormatter.K_JAVA_DOC;
	if (includeComments) this.formatComments |= CodeFormatter.F_INCLUDE_COMMENTS;
	reset();
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:34,代码来源:Scribe.java

示例2: printComment

void printComment(int kind, String source, int start, int end, int level) {

		// Set scanner
		resetScanner(source.toCharArray());
		this.scanner.resetTo(start, end);
		// Put back 3.4RC2 code => comment following line  as it has an impact on Linux tests
		// see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=234336
		// TODO (frederic) Need more investigations and a better fix in
		// isAdaptableRegion(int) and adaptRegions()
		// this.scannerEndPosition = end;

		// Set indentation level
	    this.numberOfIndentations = level;
	    this.indentationLevel = level * this.indentationSize;
	    this.column = this.indentationLevel + 1;

	    // Print corresponding comment
	    switch (kind) {
	    	case CodeFormatter.K_SINGLE_LINE_COMMENT:
			    printComment(kind, NO_TRAILING_COMMENT);
	    		break;
	    	case CodeFormatter.K_MULTI_LINE_COMMENT:
			    printComment(kind, NO_TRAILING_COMMENT);
	    		break;
	    	case CodeFormatter.K_JAVA_DOC:
	    		printJavadocComment(start, end);
	    		break;
	    }
    }
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:29,代码来源:Scribe.java


注:本文中的org.eclipse.jdt.core.formatter.CodeFormatter.K_JAVA_DOC属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。