當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。