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


Java FormattingConfig类代码示例

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


FormattingConfig类属于org.eclipse.xtext.formatting.impl包,在下文中一共展示了FormattingConfig类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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(FormattingConfig c) {
	org.eclipse.cmf.occi.core.xtext.services.OCCIGrammarAccess f = (org.eclipse.cmf.occi.core.xtext.services.OCCIGrammarAccess) getGrammarAccess();
	for(Pair<Keyword, Keyword> pair: f.findKeywordPairs("{", "}")) {
		c.setIndentation(pair.getFirst(), pair.getSecond());
		c.setLinewrap(1).after(pair.getFirst());
		c.setLinewrap(1).before(pair.getSecond());
		c.setLinewrap(1).after(pair.getSecond());
	}
	for(Keyword comma: f.findKeywords(",")) {
		c.setNoLinewrap().before(comma);
		c.setNoSpace().before(comma);
		c.setLinewrap().after(comma);
	}
	c.setLinewrap(0, 1, 2).before(f.getSL_COMMENTRule());
	c.setLinewrap(0, 1, 2).before(f.getML_COMMENTRule());
	c.setLinewrap(0, 1, 1).after(f.getML_COMMENTRule());
}
 
开发者ID:occiware,项目名称:OCCI-Studio,代码行数:19,代码来源:OCCIFormatter.java

示例3: configure

import org.eclipse.xtext.formatting.impl.FormattingConfig; //导入依赖的package包/类
public void configure(FormattingConfig c, XbaseGrammarAccess ga) {
	xtypeFormatter.configure(c, ga.getXtypeGrammarAccess());
	configureXUnaryOperation(c, ga.getXUnaryOperationAccess());
	configureXPostfixOperation(c, ga.getXPostfixOperationAccess());
	configureXMemberFeatureCall(c, ga.getXMemberFeatureCallAccess());
	configureXClosure(c, ga.getXClosureAccess());
	configureXShortClosure(c, ga.getXShortClosureAccess());
	configureXParenthesizedExpression(c, ga.getXParenthesizedExpressionAccess());
	configureXIfExpression(c, ga.getXIfExpressionAccess());
	configureXSynchronizedExpression(c, ga.getXSynchronizedExpressionAccess());
	configureXSwitchExpression(c, ga.getXSwitchExpressionAccess());
	configureXCasePart(c, ga.getXCasePartAccess());
	configureXForLoopExpression(c, ga.getXForLoopExpressionAccess());
	configureXBasicForLoopExpression(c, ga.getXBasicForLoopExpressionAccess());
	configureXWhileExpression(c, ga.getXWhileExpressionAccess());
	configureXDoWhileExpression(c, ga.getXDoWhileExpressionAccess());
	configureXBlockExpression(c, ga.getXBlockExpressionAccess());
	configureXFeatureCall(c, ga.getXFeatureCallAccess());
	configureXConstructorCall(c, ga.getXConstructorCallAccess());
	configureXTypeLiteral(c, ga.getXTypeLiteralAccess());
	configureXTryCatchFinallyExpression(c, ga.getXTryCatchFinallyExpressionAccess());
	configureXCatchClause(c, ga.getXCatchClauseAccess());
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:24,代码来源:XbaseFormatter.java

示例4: configureFormatting

import org.eclipse.xtext.formatting.impl.FormattingConfig; //导入依赖的package包/类
@Override
protected void configureFormatting(FormattingConfig c) {
	c.setLinewrap(2, 2, 2).before(getGrammarAccess().getSL_COMMENTRule());
	c.setLinewrap(0, 1, 2).before(getGrammarAccess().getML_COMMENTRule());
	c.setLinewrap(0, 1, 1).after(getGrammarAccess().getML_COMMENTRule());
	c.setSpace("\n\n").before(getGrammarAccess().getSL_COMMENTRule());
	c.setIndentation(getGrammarAccess().getParenthesizedAccess().getOPENTerminalRuleCall_0(), getGrammarAccess().getParenthesizedAccess().getRightParenthesisKeyword_2());
	c.setIndentation(getGrammarAccess().getRuleAccess().getColonKeyword_3(), getGrammarAccess().getRuleAccess().getSemicolonKeyword_5());
	c.setLinewrap().after(getGrammarAccess().getAlternativesAccess().getVerticalLineKeyword_1_1_0());
	c.setNoSpace().before(getGrammarAccess().getAtomAccess().getCardinalityAssignment_0_1_1());
	c.setLinewrap().around(getGrammarAccess().getAlternativesRule());
	c.setLinewrap().after(getGrammarAccess().getRuleAccess().getColonKeyword_3());
	c.setLinewrap().before(getGrammarAccess().getRuleAccess().getSemicolonKeyword_5());
	c.setLinewrap(2).after(getGrammarAccess().getRuleAccess().getSemicolonKeyword_5());
	c.setLinewrap().between(getGrammarAccess().getML_COMMENTRule(),	getGrammarAccess().getAntlrGrammarAccess().getGrammarKeyword_0());
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:17,代码来源:SimpleAntlrFormatter.java

示例5: configureFormatting

import org.eclipse.xtext.formatting.impl.FormattingConfig; //导入依赖的package包/类
@Override
protected void configureFormatting(FormattingConfig c) {
	es.um.nosql.schemainference.dslparameter.services.ODMParameterGrammarAccess f = (es.um.nosql.schemainference.dslparameter.services.ODMParameterGrammarAccess) getGrammarAccess();
	for(Pair<Keyword, Keyword> pair: f.findKeywordPairs("{", "}")) {
		c.setIndentation(pair.getFirst(), pair.getSecond());
		c.setLinewrap(1).after(pair.getFirst());
		c.setLinewrap(1).before(pair.getSecond());
		c.setLinewrap(1).after(pair.getSecond());
	}
	for(Keyword comma: f.findKeywords(",")) {
		c.setNoLinewrap().before(comma);
		c.setNoSpace().before(comma);
		c.setLinewrap().after(comma);
	}
	c.setLinewrap(0, 1, 2).before(f.getSL_COMMENTRule());
	c.setLinewrap(0, 1, 2).before(f.getML_COMMENTRule());
	c.setLinewrap(0, 1, 1).after(f.getML_COMMENTRule());
}
 
开发者ID:catedrasaes-umu,项目名称:NoSQLDataEngineering,代码行数:19,代码来源:ODMParameterFormatter.java

示例6: configureXIssueExpression

import org.eclipse.xtext.formatting.impl.FormattingConfig; //导入依赖的package包/类
/**
 * Configure XIssueExpressions formatting.
 *
 * @param c
 *          the formatting configuration
 * @param elements
 *          the accessible formattable parser elements
 */
public void configureXIssueExpression(final FormattingConfig c, final XIssueExpressionElements elements) {
  c.setSpace(" ").after(elements.getOnKeyword_3_0());

  c.setNoSpace().around(elements.getNumberSignKeyword_3_1_0_0());
  c.setNoSpace().around(elements.getNumberSignKeyword_3_1_1_1_0());

  c.setNoSpace().around(elements.getLeftSquareBracketKeyword_3_2_0());
  c.setNoSpace().before(elements.getRightSquareBracketKeyword_3_2_2());

  c.setNoSpace().after(elements.getLeftParenthesisKeyword_5_1());
  c.setNoSpace().before(elements.getCommaKeyword_5_3_0());
  c.setNoSpace().before(elements.getRightParenthesisKeyword_5_4());

  c.setNoSpace().after(elements.getLeftParenthesisKeyword_6_2());
  c.setNoSpace().before(elements.getCommaKeyword_6_4_0());
  c.setNoSpace().before(elements.getRightParenthesisKeyword_6_5());
}
 
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:26,代码来源:CheckFormatter.java

示例7: configureFormatting

import org.eclipse.xtext.formatting.impl.FormattingConfig; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
protected void configureFormatting(final FormattingConfig config) {
  final ValidGrammarAccess grammarAccess = (ValidGrammarAccess) getGrammarAccess();
  config.setAutoLinewrap(MAX_LINE_LENGTH);

  // Comments
  config.setLinewrap(0, 1, 2).before(grammarAccess.getSL_COMMENTRule());
  config.setLinewrap(0, 1, 2).before(grammarAccess.getML_COMMENTRule());
  config.setLinewrap(0, 1, 1).after(grammarAccess.getML_COMMENTRule());

  configureCategoryFormatting(config, grammarAccess.getCategoryAccess());
  configureNativeRuleFormatting(config, grammarAccess.getNativeRuleAccess());
  configureNativeContextFormatting(config, grammarAccess.getNativeContextAccess());
  configureQuickFixFormatting(config, grammarAccess.getQuickFixAccess());
  configureImportFormatting(config, grammarAccess.getImportAccess());
}
 
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:18,代码来源:ValidFormatter.java

示例8: configure

import org.eclipse.xtext.formatting.impl.FormattingConfig; //导入依赖的package包/类
/**
 * Entry point for Check Configuration formatting.
 *
 * @param c
 *          the formatting configuration
 * @param g
 *          the grammar access
 */
private void configure(final FormattingConfig c, final CheckCfgGrammarAccess g) {
  super.configure(c, g.getXbaseGrammarAccess());

  // Comments
  c.setLinewrap(0, 1, 2).before(g.getSL_COMMENTRule());
  c.setLinewrap(0, 1, 2).before(g.getML_COMMENTRule());
  c.setLinewrap(0, 1, 1).after(g.getML_COMMENTRule());

  // AutoLineWrap
  c.setAutoLinewrap(LINE_WRAP_LENGTH);

  configureCheckConfiguration(c, g.getCheckConfigurationAccess());
  configureLanguageValidatorConfiguration(c, g.getConfiguredLanguageValidatorAccess());
  configureConfiguredCatalog(c, g.getConfiguredCatalogAccess());
  configureConfiguredCheck(c, g.getConfiguredCheckAccess());
  // configureConfiguredParameter(c, g.getConfiguredParameterAccess());
}
 
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:26,代码来源:CheckCfgFormatter.java

示例9: configureFormatting

import org.eclipse.xtext.formatting.impl.FormattingConfig; //导入依赖的package包/类
@Override
	protected void configureFormatting(FormattingConfig c) {
// It's usually a good idea to activate the following three statements.
// They will add and preserve newlines around comments
		
		//c.setLinewrap(0, 1, 2).before(((PlanGrammarAccess) getGrammarAccess()).getML_COMMENTRule());
		//c.setLinewrap(0, 1, 1).after(((PlanGrammarAccess) getGrammarAccess()).getML_COMMENTRule());
		//c.setLinewrap(0, 1, 1).after(((PlanGrammarAccess) getGrammarAccess()).getOPENCURLYRule());
		c.setLinewrap().after( (EObject) ((PlanGrammarAccess) getGrammarAccess()).getENDLINERule());
		c.setLinewrap().after( (EObject) ((PlanGrammarAccess) getGrammarAccess()).getOPENCURLYRule());
		c.setIndentationIncrement().after(((PlanGrammarAccess) getGrammarAccess()).getOPENCURLYRule());
		
		
		c.setLinewrap().before( (EObject) ((PlanGrammarAccess) getGrammarAccess()).getSL_COMMENTRule());
		//c.setLinewrap().around( (EObject) ((PlanGrammarAccess) getGrammarAccess()).getML_COMMENTRule());
		
		
		c.setIndentationDecrement().before(((PlanGrammarAccess) getGrammarAccess()).getCLOSEDCURLYRule());
		c.setLinewrap(2).after(((PlanGrammarAccess) getGrammarAccess()).getCLOSEDCURLYRule());
	}
 
开发者ID:lowcoupling,项目名称:plan,代码行数:21,代码来源:PlanFormatter.java

示例10: formatDesigns

import org.eclipse.xtext.formatting.impl.FormattingConfig; //导入依赖的package包/类
private void formatDesigns(FormattingConfig config, PhdlGrammarAccess access) {
	config.setLinewrap(1, 2, 2).around(access.getDesignRule());
	config.setLinewrap(1, 2, 2).around(access.getDesignElementRule());
	DesignElements elements = access.getDesignAccess();
	config.setLinewrap(1, 1, 2).after(elements.getLeftCurlyBracketKeyword_2());
	config.setLinewrap(1).before(elements.getRightCurlyBracketKeyword_4());
	config.setLinewrap(1, 2, 2).after(elements.getRightCurlyBracketKeyword_4());
	config.setIndentationIncrement().after(elements.getLeftCurlyBracketKeyword_2());
	config.setIndentationDecrement().before(elements.getRightCurlyBracketKeyword_4());
	formatInstances(config, access);
	formatConnections(config, access);
	formatConcatenations(config, access);
	formatIndices(config, access);
	formatSlices(config, access);
	formatQualifiers(config, access);
	formatArrays(config, access);
	formatConnectionAssigns(config, access);
}
 
开发者ID:timofonic,项目名称:PHDL,代码行数:19,代码来源:PhdlFormatter.java

示例11: formatInstances

import org.eclipse.xtext.formatting.impl.FormattingConfig; //导入依赖的package包/类
private void formatInstances(FormattingConfig config, PhdlGrammarAccess access) {
	InstanceElements elements = access.getInstanceAccess();
	config.setLinewrap(1, 1, 2).after(elements.getLeftCurlyBracketKeyword_0_5());
	config.setLinewrap(1, 1, 2).after(elements.getLeftCurlyBracketKeyword_1_6());
	config.setLinewrap(1).before(elements.getRightCurlyBracketKeyword_0_7());
	config.setLinewrap(1).before(elements.getRightCurlyBracketKeyword_1_8());
	config.setIndentationIncrement().after(elements.getLeftCurlyBracketKeyword_0_5());
	config.setIndentationIncrement().after(elements.getLeftCurlyBracketKeyword_1_6());
	config.setIndentationDecrement().before(elements.getRightCurlyBracketKeyword_0_7());
	config.setIndentationDecrement().before(elements.getRightCurlyBracketKeyword_1_8());
	config.setLinewrap(1, 1, 2).between(access.getInstanceElementRule(), access.getInstanceElementRule());
	formatRefAttrs(config, access);
	// formatNewAttrs(config, access);
	formatPinAssigns(config, access);
	formatSubAttrs(config, access);
	formatPortAssigns(config, access);
}
 
开发者ID:timofonic,项目名称:PHDL,代码行数:18,代码来源:PhdlFormatter.java

示例12: configureFormatting

import org.eclipse.xtext.formatting.impl.FormattingConfig; //导入依赖的package包/类
@Override
protected void configureFormatting(FormattingConfig c) {
	org.csu.idl.xtext.services.IDLGrammarAccess f = (org.csu.idl.xtext.services.IDLGrammarAccess) getGrammarAccess();
	for(Pair<Keyword, Keyword> pair: f.findKeywordPairs("{", "}")) {
		c.setIndentation(pair.getFirst(), pair.getSecond());
		c.setLinewrap(1).after(pair.getFirst());
		c.setLinewrap(1).before(pair.getSecond());
		c.setLinewrap(1).after(pair.getSecond());
	}
	for(Keyword comma: f.findKeywords(",")) {
		c.setNoLinewrap().before(comma);
		c.setNoSpace().before(comma);
		c.setLinewrap().after(comma);
	}
	c.setLinewrap(0, 1, 2).before(f.getSL_COMMENTRule());
	c.setLinewrap(0, 1, 2).before(f.getML_COMMENTRule());
	c.setLinewrap(0, 1, 1).after(f.getML_COMMENTRule());
}
 
开发者ID:catedrasaes-umu,项目名称:idl4emf,代码行数:19,代码来源:IDLFormatter.java

示例13: configureFormatting

import org.eclipse.xtext.formatting.impl.FormattingConfig; //导入依赖的package包/类
@Override
protected void configureFormatting(FormattingConfig c) {
	org.eclectic.services.ApiDescriptionLanguageGrammarAccess f = (org.eclectic.services.ApiDescriptionLanguageGrammarAccess) getGrammarAccess();
	for(Pair<Keyword, Keyword> pair: f.findKeywordPairs("{", "}")) {
		c.setIndentation(pair.getFirst(), pair.getSecond());
		c.setLinewrap(1).after(pair.getFirst());
		c.setLinewrap(1).before(pair.getSecond());
		c.setLinewrap(1).after(pair.getSecond());
	}
	for(Keyword comma: f.findKeywords(",")) {
		c.setNoLinewrap().before(comma);
		c.setNoSpace().before(comma);
		c.setLinewrap().after(comma);
	}
	c.setLinewrap(0, 1, 2).before(f.getSL_COMMENTRule());
	c.setLinewrap(0, 1, 2).before(f.getML_COMMENTRule());
	c.setLinewrap(0, 1, 1).after(f.getML_COMMENTRule());
}
 
开发者ID:jesusc,项目名称:eclectic,代码行数:19,代码来源:ApiDescriptionLanguageFormatter.java

示例14: configureFormatting

import org.eclipse.xtext.formatting.impl.FormattingConfig; //导入依赖的package包/类
@Override
protected void configureFormatting(FormattingConfig c) {
	org.eclectic.frontend.syntax.services.ExpressionsGrammarAccess f = (org.eclectic.frontend.syntax.services.ExpressionsGrammarAccess) getGrammarAccess();
	for(Pair<Keyword, Keyword> pair: f.findKeywordPairs("{", "}")) {
		c.setIndentation(pair.getFirst(), pair.getSecond());
		c.setLinewrap(1).after(pair.getFirst());
		c.setLinewrap(1).before(pair.getSecond());
		c.setLinewrap(1).after(pair.getSecond());
	}
	for(Keyword comma: f.findKeywords(",")) {
		c.setNoLinewrap().before(comma);
		c.setNoSpace().before(comma);
		c.setLinewrap().after(comma);
	}
	c.setLinewrap(0, 1, 2).before(f.getSL_COMMENTRule());
	c.setLinewrap(0, 1, 2).before(f.getML_COMMENTRule());
	c.setLinewrap(0, 1, 1).after(f.getML_COMMENTRule());
}
 
开发者ID:jesusc,项目名称:eclectic,代码行数:19,代码来源:ExpressionsFormatter.java

示例15: configureFormatting

import org.eclipse.xtext.formatting.impl.FormattingConfig; //导入依赖的package包/类
@Override
protected void configureFormatting(FormattingConfig c) {
	org.eclectic.frontend.services.TaoGrammarAccess f = (org.eclectic.frontend.services.TaoGrammarAccess) getGrammarAccess();
	for(Pair<Keyword, Keyword> pair: f.findKeywordPairs("{", "}")) {
		c.setIndentation(pair.getFirst(), pair.getSecond());
		c.setLinewrap(1).after(pair.getFirst());
		c.setLinewrap(1).before(pair.getSecond());
		c.setLinewrap(1).after(pair.getSecond());
	}
	for(Keyword comma: f.findKeywords(",")) {
		c.setNoLinewrap().before(comma);
		c.setNoSpace().before(comma);
		c.setLinewrap().after(comma);
	}
	c.setLinewrap(0, 1, 2).before(f.getSL_COMMENTRule());
	c.setLinewrap(0, 1, 2).before(f.getML_COMMENTRule());
	c.setLinewrap(0, 1, 1).after(f.getML_COMMENTRule());
}
 
开发者ID:jesusc,项目名称:eclectic,代码行数:19,代码来源:TaoFormatter.java


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