本文整理匯總了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);
}
}
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}
示例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);
}
示例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);
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}