Examples of FXGraphGrammarAccess


Examples of at.bestsolution.efxclipse.tooling.fxgraph.services.FXGraphGrammarAccess

*/
public class FXGraphFormatter extends AbstractDeclarativeFormatter {
 
  @Override
  protected void configureFormatting(FormattingConfig c) {
    FXGraphGrammarAccess f = (FXGraphGrammarAccess) getGrammarAccess();

    for (Keyword comma : f.findKeywords("(")) {
      c.setNoSpace().around(comma);
    }
   
    for (Keyword comma : f.findKeywords(")")) {
      c.setNoSpace().before(comma);
    }
   
    for (Keyword comma : f.findKeywords(",")) {
      c.setNoSpace().before(comma);
    }
   
    for( Keyword hash : f.findKeywords("#") ) {
      c.setNoSpace().around(hash);
    }
   
    c.setAutoLinewrap(120);
   
    c.setLinewrap(1, 2, 3).around(f.getImportRule());
    c.setLinewrap(1, 2, 3).before(f.getPropertyRule());
    c.setLinewrap(1, 2, 3).before(f.getStaticCallValuePropertyRule());
   
    c.setLinewrap(1, 2, 3).after(f.getElementAccess().getLeftCurlyBracketKeyword_1_1_1());
    c.setLinewrap(1, 2, 3).after(f.getElementAccess().getLeftCurlyBracketKeyword_1_2_3());
    c.setLinewrap(1, 2, 3).before(f.getElementAccess().getRightCurlyBracketKeyword_1_1_3());
    c.setLinewrap(1, 2, 3).before(f.getElementAccess().getRightCurlyBracketKeyword_1_2_6());
    c.setLinewrap(1, 2, 3).after(f.getElementAccess().getCommaKeyword_1_2_5_0());
   
    c.setLinewrap(1, 2, 3).after(f.getListValuePropertyAccess().getLeftSquareBracketKeyword_0());
    c.setLinewrap(1, 2, 3).after(f.getListValuePropertyAccess().getCommaKeyword_2_0());
    c.setLinewrap(1, 2, 3).before(f.getListValuePropertyAccess().getRightSquareBracketKeyword_3());
   
    c.setLinewrap(1, 2, 3).after(f.getComponentDefinitionAccess().getLeftCurlyBracketKeyword_4());
    c.setLinewrap(1, 2, 3).before(f.getComponentDefinitionAccess().getRightCurlyBracketKeyword_8());
   
   
    c.setLinewrap(1, 2, 3).after(f.getMapValuePropertyAccess().getLeftCurlyBracketKeyword_0());
    c.setLinewrap(1, 2, 3).before(f.getMapValuePropertyAccess().getRightCurlyBracketKeyword_3());
   
    {
      List<Pair<Keyword,Keyword>> pairs = f.findKeywordPairs("{", "}");
      for (Pair<Keyword, Keyword> pair : pairs) {
        c.setIndentation(pair.getFirst(), pair.getSecond());
     
    }
   
    {
      List<Pair<Keyword,Keyword>> pairs = f.findKeywordPairs("[", "]");
      for (Pair<Keyword, Keyword> pair : pairs) {
        c.setIndentation(pair.getFirst(), pair.getSecond());
     
    }
   
    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());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.