本文整理汇总了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;
}
示例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;
}
示例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);
}
示例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);
}