當前位置: 首頁>>代碼示例>>Java>>正文


Java FormattingConfig.setLinewrap方法代碼示例

本文整理匯總了Java中org.eclipse.xtext.formatting.impl.FormattingConfig.setLinewrap方法的典型用法代碼示例。如果您正苦於以下問題:Java FormattingConfig.setLinewrap方法的具體用法?Java FormattingConfig.setLinewrap怎麽用?Java FormattingConfig.setLinewrap使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.xtext.formatting.impl.FormattingConfig的用法示例。


在下文中一共展示了FormattingConfig.setLinewrap方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: configureFormatting

import org.eclipse.xtext.formatting.impl.FormattingConfig; //導入方法依賴的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

示例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

示例4: 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._characterScriptGrammarAccess.getSL_COMMENTRule();
  _setLinewrap.before(_sL_COMMENTRule);
  FormattingConfig.LinewrapLocator _setLinewrap_1 = c.setLinewrap(0, 1, 2);
  TerminalRule _mL_COMMENTRule = this._characterScriptGrammarAccess.getML_COMMENTRule();
  _setLinewrap_1.before(_mL_COMMENTRule);
  FormattingConfig.LinewrapLocator _setLinewrap_2 = c.setLinewrap(0, 1, 1);
  TerminalRule _mL_COMMENTRule_1 = this._characterScriptGrammarAccess.getML_COMMENTRule();
  _setLinewrap_2.after(_mL_COMMENTRule_1);
  FormattingConfig.LinewrapLocator _setLinewrap_3 = c.setLinewrap();
  CharacterScriptGrammarAccess.CharactersElements _charactersAccess = this._characterScriptGrammarAccess.getCharactersAccess();
  Assignment _importsAssignment_0 = _charactersAccess.getImportsAssignment_0();
  _setLinewrap_3.after(_importsAssignment_0);
  FormattingConfig.LinewrapLocator _setLinewrap_4 = c.setLinewrap();
  CharacterScriptGrammarAccess.CharactersElements _charactersAccess_1 = this._characterScriptGrammarAccess.getCharactersAccess();
  RuleCall _importsImportParserRuleCall_0_0 = _charactersAccess_1.getImportsImportParserRuleCall_0_0();
  _setLinewrap_4.after(_importsImportParserRuleCall_0_0);
  CharacterScriptGrammarAccess.TemplateElements _templateAccess = this._characterScriptGrammarAccess.getTemplateAccess();
  Keyword _templateKeyword_0 = _templateAccess.getTemplateKeyword_0();
  CharacterScriptGrammarAccess.TemplateElements _templateAccess_1 = this._characterScriptGrammarAccess.getTemplateAccess();
  Assignment _nameAssignment_1 = _templateAccess_1.getNameAssignment_1();
  CharacterScriptGrammarAccess.TemplateElements _templateAccess_2 = this._characterScriptGrammarAccess.getTemplateAccess();
  Keyword _endKeyword_5 = _templateAccess_2.getEndKeyword_5();
  CharacterScriptGrammarAccess.TemplateElements _templateAccess_3 = this._characterScriptGrammarAccess.getTemplateAccess();
  Keyword _endKeyword_5_1 = _templateAccess_3.getEndKeyword_5();
  CharacterScriptGrammarAccess.TemplateElements _templateAccess_4 = this._characterScriptGrammarAccess.getTemplateAccess();
  Assignment _defaultsAssignment_2 = _templateAccess_4.getDefaultsAssignment_2();
  CharacterScriptGrammarAccess.TemplateElements _templateAccess_5 = this._characterScriptGrammarAccess.getTemplateAccess();
  Assignment _customsAssignment_3 = _templateAccess_5.getCustomsAssignment_3();
  CharacterScriptGrammarAccess.TemplateElements _templateAccess_6 = this._characterScriptGrammarAccess.getTemplateAccess();
  Assignment _customsAssignment_4 = _templateAccess_6.getCustomsAssignment_4();
  this.setDefaultBlockLayout(c, _templateKeyword_0, _nameAssignment_1, _endKeyword_5, _endKeyword_5_1, _defaultsAssignment_2, _customsAssignment_3, _customsAssignment_4);
  CharacterScriptGrammarAccess.GlobalsElements _globalsAccess = this._characterScriptGrammarAccess.getGlobalsAccess();
  Keyword _globalKeyword_0 = _globalsAccess.getGlobalKeyword_0();
  CharacterScriptGrammarAccess.GlobalsElements _globalsAccess_1 = this._characterScriptGrammarAccess.getGlobalsAccess();
  Keyword _attributesKeyword_1 = _globalsAccess_1.getAttributesKeyword_1();
  CharacterScriptGrammarAccess.GlobalsElements _globalsAccess_2 = this._characterScriptGrammarAccess.getGlobalsAccess();
  Keyword _endKeyword_4 = _globalsAccess_2.getEndKeyword_4();
  CharacterScriptGrammarAccess.GlobalsElements _globalsAccess_3 = this._characterScriptGrammarAccess.getGlobalsAccess();
  Keyword _endKeyword_4_1 = _globalsAccess_3.getEndKeyword_4();
  CharacterScriptGrammarAccess.GlobalsElements _globalsAccess_4 = this._characterScriptGrammarAccess.getGlobalsAccess();
  Assignment _customsAssignment_2 = _globalsAccess_4.getCustomsAssignment_2();
  CharacterScriptGrammarAccess.GlobalsElements _globalsAccess_5 = this._characterScriptGrammarAccess.getGlobalsAccess();
  Assignment _customsAssignment_3_1 = _globalsAccess_5.getCustomsAssignment_3();
  this.setDefaultBlockLayout(c, _globalKeyword_0, _attributesKeyword_1, _endKeyword_4, _endKeyword_4_1, _customsAssignment_2, _customsAssignment_3_1);
  CharacterScriptGrammarAccess.CharacterElements _characterAccess = this._characterScriptGrammarAccess.getCharacterAccess();
  Keyword _characterKeyword_0 = _characterAccess.getCharacterKeyword_0();
  CharacterScriptGrammarAccess.CharacterElements _characterAccess_1 = this._characterScriptGrammarAccess.getCharacterAccess();
  Assignment _nameAssignment_1_1 = _characterAccess_1.getNameAssignment_1();
  CharacterScriptGrammarAccess.CharacterElements _characterAccess_2 = this._characterScriptGrammarAccess.getCharacterAccess();
  Keyword _endKeyword_4_2 = _characterAccess_2.getEndKeyword_4();
  CharacterScriptGrammarAccess.CharacterElements _characterAccess_3 = this._characterScriptGrammarAccess.getCharacterAccess();
  Keyword _endKeyword_4_3 = _characterAccess_3.getEndKeyword_4();
  CharacterScriptGrammarAccess.CharacterElements _characterAccess_4 = this._characterScriptGrammarAccess.getCharacterAccess();
  Assignment _propertiesAssignment_3 = _characterAccess_4.getPropertiesAssignment_3();
  this.setDefaultBlockLayout(c, _characterKeyword_0, _nameAssignment_1_1, _endKeyword_4_2, _endKeyword_4_3, _propertiesAssignment_3);
}
 
開發者ID:RobertWalter83,項目名稱:DialogScriptDSL,代碼行數:59,代碼來源:CharacterScriptFormatter.java


注:本文中的org.eclipse.xtext.formatting.impl.FormattingConfig.setLinewrap方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。