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


Java FormattingConfig.NoSpaceLocator方法代码示例

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


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

示例1: formatBrackets

import org.eclipse.xtext.formatting.impl.FormattingConfig; //导入方法依赖的package包/类
protected void formatBrackets(final FormattingConfig c, final String left, final String right) {
  List<Pair<Keyword, Keyword>> _findKeywordPairs = this._kronusGrammarAccess.findKeywordPairs(left, right);
  for (final Pair<Keyword, Keyword> pair : _findKeywordPairs) {
    {
      FormattingConfig.NoSpaceLocator _setNoSpace = c.setNoSpace();
      Keyword _first = pair.getFirst();
      _setNoSpace.before(_first);
      FormattingConfig.NoSpaceLocator _setNoSpace_1 = c.setNoSpace();
      Keyword _first_1 = pair.getFirst();
      _setNoSpace_1.after(_first_1);
      FormattingConfig.NoSpaceLocator _setNoSpace_2 = c.setNoSpace();
      Keyword _second = pair.getSecond();
      _setNoSpace_2.before(_second);
    }
  }
}
 
开发者ID:Morgan-Stanley,项目名称:Saturn,代码行数:17,代码来源:KronusFormatter.java

示例2: configureFormatting

import org.eclipse.xtext.formatting.impl.FormattingConfig; //导入方法依赖的package包/类
@Override
protected void configureFormatting(final FormattingConfig c) {
  final EntitiesGrammarAccess.EntityElements e = this.g.getEntityAccess();
  Keyword _leftCurlyBracketKeyword_3 = e.getLeftCurlyBracketKeyword_3();
  Keyword _rightCurlyBracketKeyword_5 = e.getRightCurlyBracketKeyword_5();
  c.setIndentation(_leftCurlyBracketKeyword_3, _rightCurlyBracketKeyword_5);
  FormattingConfig.LinewrapLocator _setLinewrap = c.setLinewrap();
  Keyword _leftCurlyBracketKeyword_3_1 = e.getLeftCurlyBracketKeyword_3();
  _setLinewrap.after(_leftCurlyBracketKeyword_3_1);
  FormattingConfig.LinewrapLocator _setLinewrap_1 = c.setLinewrap(2);
  Keyword _rightCurlyBracketKeyword_5_1 = e.getRightCurlyBracketKeyword_5();
  _setLinewrap_1.after(_rightCurlyBracketKeyword_5_1);
  final EntitiesGrammarAccess.AttributeElements a = this.g.getAttributeAccess();
  FormattingConfig.LinewrapLocator _setLinewrap_2 = c.setLinewrap(1);
  Keyword _semicolonKeyword_2 = a.getSemicolonKeyword_2();
  _setLinewrap_2.after(_semicolonKeyword_2);
  FormattingConfig.NoSpaceLocator _setNoSpace = c.setNoSpace();
  Keyword _semicolonKeyword_2_1 = a.getSemicolonKeyword_2();
  _setNoSpace.before(_semicolonKeyword_2_1);
  FormattingConfig.LinewrapLocator _setLinewrap_3 = c.setLinewrap(0, 1, 2);
  TerminalRule _sL_COMMENTRule = this.g.getSL_COMMENTRule();
  _setLinewrap_3.before(_sL_COMMENTRule);
  FormattingConfig.LinewrapLocator _setLinewrap_4 = c.setLinewrap(0, 1, 2);
  TerminalRule _mL_COMMENTRule = this.g.getML_COMMENTRule();
  _setLinewrap_4.before(_mL_COMMENTRule);
  FormattingConfig.LinewrapLocator _setLinewrap_5 = c.setLinewrap(0, 1, 1);
  TerminalRule _mL_COMMENTRule_1 = this.g.getML_COMMENTRule();
  _setLinewrap_5.after(_mL_COMMENTRule_1);
}
 
开发者ID:LorenzoBettini,项目名称:packtpub-xtext-book-examples,代码行数:30,代码来源:EntitiesFormatter.java

示例3: configureFormatting

import org.eclipse.xtext.formatting.impl.FormattingConfig; //导入方法依赖的package包/类
protected void configureFormatting(final FormattingConfig c) {
  FormattingConfig.LinewrapLocator _setLinewrap = c.setLinewrap(0, 1, 2);
  TerminalRule _sL_COMMENTRule = this._kronusGrammarAccess.getSL_COMMENTRule();
  _setLinewrap.before(_sL_COMMENTRule);
  FormattingConfig.LinewrapLocator _setLinewrap_1 = c.setLinewrap(0, 1, 2);
  TerminalRule _mL_COMMENTRule = this._kronusGrammarAccess.getML_COMMENTRule();
  _setLinewrap_1.before(_mL_COMMENTRule);
  FormattingConfig.LinewrapLocator _setLinewrap_2 = c.setLinewrap(0, 1, 1);
  TerminalRule _mL_COMMENTRule_1 = this._kronusGrammarAccess.getML_COMMENTRule();
  _setLinewrap_2.after(_mL_COMMENTRule_1);
  FormattingConfig.LinewrapLocator _setLinewrap_3 = c.setLinewrap();
  ParserRule _iNCLUDERule = this._kronusGrammarAccess.getINCLUDERule();
  _setLinewrap_3.before(_iNCLUDERule);
  FormattingConfig.LinewrapLocator _setLinewrap_4 = c.setLinewrap();
  ParserRule _iMPORTRule = this._kronusGrammarAccess.getIMPORTRule();
  _setLinewrap_4.before(_iMPORTRule);
  FormattingConfig.LinewrapLocator _setLinewrap_5 = c.setLinewrap();
  ParserRule _tYPERule = this._kronusGrammarAccess.getTYPERule();
  _setLinewrap_5.before(_tYPERule);
  FormattingConfig.LinewrapLocator _setLinewrap_6 = c.setLinewrap();
  ParserRule _dEFRule = this._kronusGrammarAccess.getDEFRule();
  _setLinewrap_6.before(_dEFRule);
  FormattingConfig.LinewrapLocator _setLinewrap_7 = c.setLinewrap();
  ParserRule _vALRule = this._kronusGrammarAccess.getVALRule();
  _setLinewrap_7.before(_vALRule);
  FormattingConfig.LinewrapLocator _setLinewrap_8 = c.setLinewrap();
  ParserRule _hashtagCallRule = this._kronusGrammarAccess.getHashtagCallRule();
  _setLinewrap_8.before(_hashtagCallRule);
  FormattingConfig.LinewrapLocator _setLinewrap_9 = c.setLinewrap();
  ParserRule _rETURNRule = this._kronusGrammarAccess.getRETURNRule();
  _setLinewrap_9.before(_rETURNRule);
  c.setAutoLinewrap(120);
  c.setWrappedLineIndentation(2);
  List<Pair<Keyword, Keyword>> _findKeywordPairs = this._kronusGrammarAccess.findKeywordPairs("{", "}");
  for (final Pair<Keyword, Keyword> pair : _findKeywordPairs) {
    {
      FormattingConfig.SpaceLocator _setSpace = c.setSpace(" ");
      Keyword _first = pair.getFirst();
      _setSpace.before(_first);
      FormattingConfig.LinewrapLocator _setLinewrap_10 = c.setLinewrap();
      Keyword _first_1 = pair.getFirst();
      _setLinewrap_10.after(_first_1);
      Keyword _first_2 = pair.getFirst();
      Keyword _second = pair.getSecond();
      c.setIndentation(_first_2, _second);
      FormattingConfig.LinewrapLocator _setLinewrap_11 = c.setLinewrap();
      Keyword _second_1 = pair.getSecond();
      _setLinewrap_11.before(_second_1);
    }
  }
  this.formatBrackets(c, "(", ")");
  this.formatBrackets(c, "[", "]");
  List<Keyword> _findKeywords = this._kronusGrammarAccess.findKeywords("#");
  for (final Keyword k : _findKeywords) {
    FormattingConfig.NoSpaceLocator _setNoSpace = c.setNoSpace();
    _setNoSpace.after(k);
  }
  List<Keyword> _findKeywords_1 = this._kronusGrammarAccess.findKeywords(":", ",");
  for (final Keyword k_1 : _findKeywords_1) {
    FormattingConfig.NoSpaceLocator _setNoSpace_1 = c.setNoSpace();
    _setNoSpace_1.before(k_1);
  }
  List<Keyword> _findKeywords_2 = this._kronusGrammarAccess.findKeywords(".");
  for (final Keyword k_2 : _findKeywords_2) {
    {
      FormattingConfig.NoSpaceLocator _setNoSpace_2 = c.setNoSpace();
      _setNoSpace_2.before(k_2);
      FormattingConfig.NoSpaceLocator _setNoSpace_3 = c.setNoSpace();
      _setNoSpace_3.after(k_2);
    }
  }
}
 
开发者ID:Morgan-Stanley,项目名称:Saturn,代码行数:73,代码来源:KronusFormatter.java


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