当前位置: 首页>>代码示例>>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;未经允许,请勿转载。