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


Java LinewrapLocator类代码示例

本文整理汇总了Java中org.eclipse.xtext.formatting.impl.FormattingConfig.LinewrapLocator的典型用法代码示例。如果您正苦于以下问题:Java LinewrapLocator类的具体用法?Java LinewrapLocator怎么用?Java LinewrapLocator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: isBreak

import org.eclipse.xtext.formatting.impl.FormattingConfig.LinewrapLocator; //导入依赖的package包/类
protected boolean isBreak() {
	if (!isBreakable())
		return false;
	for (ElementLocator e : leadingLocators) {
		if (e instanceof LinewrapLocator) {
			if (((LinewrapLocator) e).getMinWrap() > 0)
				return true;
			if (countExistingLeadingNewlines() > 0)
				return true;
		}
	}
	return false;
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:14,代码来源:FormattingConfigBasedStream.java

示例2: isBreakable

import org.eclipse.xtext.formatting.impl.FormattingConfig.LinewrapLocator; //导入依赖的package包/类
protected boolean isBreakable() {
	if (leadingLocators == null)
		return false;
	for (ElementLocator e : leadingLocators) {
		if (e instanceof LinewrapLocator && ((LinewrapLocator) e).getMaxWrap() == 0)
			return false;
		if (e instanceof SpaceLocator)
			return false;
	}
	return hiddenTokenHelper.getWhitespaceRuleFor(hiddenTokenDefinition, getLineSeparator()) != null;
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:12,代码来源:FormattingConfigBasedStream.java

示例3: configureFormatting

import org.eclipse.xtext.formatting.impl.FormattingConfig.LinewrapLocator; //导入依赖的package包/类
protected void configureFormatting(final FormattingConfig c) {
  LinewrapLocator _setLinewrap = c.setLinewrap(0, 1, 2);
  TerminalRule _sL_COMMENTRule = this._lilGrammarAccess.getSL_COMMENTRule();
  _setLinewrap.before(_sL_COMMENTRule);
  LinewrapLocator _setLinewrap_1 = c.setLinewrap(0, 1, 2);
  TerminalRule _mL_COMMENTRule = this._lilGrammarAccess.getML_COMMENTRule();
  _setLinewrap_1.before(_mL_COMMENTRule);
  LinewrapLocator _setLinewrap_2 = c.setLinewrap(0, 1, 1);
  TerminalRule _mL_COMMENTRule_1 = this._lilGrammarAccess.getML_COMMENTRule();
  _setLinewrap_2.after(_mL_COMMENTRule_1);
}
 
开发者ID:crubier,项目名称:lil,代码行数:12,代码来源:LilFormatter.java

示例4: createConditionalLinewrapLocator

import org.eclipse.xtext.formatting.impl.FormattingConfig.LinewrapLocator; //导入依赖的package包/类
/**
 * Creates a conditional {@link LinewrapLocator} that is activated depending on given locator activator.
 *
 * @param config
 *          a formatting config, which newly created locators should be added to
 * @param lines
 *          size of linewrap in lines
 * @param locatorActivator
 *          activator indicating when the conditional locator is active
 * @return new conditional linewrap locator
 */
public static LinewrapLocator createConditionalLinewrapLocator(final ExtendedFormattingConfig config, final int lines, final LocatorActivator<?> locatorActivator) {
  return new ConditionalLinewrapLocator(config, lines, locatorActivator);
}
 
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:15,代码来源:ConditionalLocatorFactory.java


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