コード例 #1
0
 public List<String> initialHiddenTokens(final Grammar it) {
   List<String> _xblockexpression = null;
   {
     boolean _isDefinesHiddenTokens = it.isDefinesHiddenTokens();
     if (_isDefinesHiddenTokens) {
       EList<AbstractRule> _hiddenTokens = it.getHiddenTokens();
       final Function1<AbstractRule, String> _function =
           new Function1<AbstractRule, String>() {
             @Override
             public String apply(final AbstractRule it) {
               return GrammarAccessExtensions.this.ruleName(it);
             }
           };
       List<String> _map = ListExtensions.<AbstractRule, String>map(_hiddenTokens, _function);
       return IterableExtensions.<String>toList(_map);
     }
     EList<Grammar> _usedGrammars = it.getUsedGrammars();
     int _size = _usedGrammars.size();
     boolean _equals = (_size == 1);
     if (_equals) {
       EList<Grammar> _usedGrammars_1 = it.getUsedGrammars();
       Grammar _head = IterableExtensions.<Grammar>head(_usedGrammars_1);
       return this.initialHiddenTokens(_head);
     }
     _xblockexpression = CollectionLiterals.<String>emptyList();
   }
   return _xblockexpression;
 }
コード例 #2
0
 public Iterable<XtendMember> allVisibleMembers(final Step step) {
   final Scenario scenario = EcoreUtil2.<Scenario>getContainerOfType(step, Scenario.class);
   boolean _equals = Objects.equal(scenario, null);
   if (_equals) {
     return CollectionLiterals.<XtendMember>emptyList();
   }
   EList<XtendMember> members = scenario.getMembers();
   if ((scenario instanceof Background)) {
     return members;
   }
   final Feature feature = EcoreUtil2.<Feature>getContainerOfType(scenario, Feature.class);
   Background _background = feature.getBackground();
   boolean _equals_1 = Objects.equal(_background, null);
   if (_equals_1) {
     return members;
   }
   Background _background_1 = feature.getBackground();
   EList<XtendMember> _members = _background_1.getMembers();
   return Iterables.<XtendMember>concat(members, _members);
 }
コード例 #3
0
 @Override
 public Object[] getVariants() {
   ArrayList<LookupElementBuilder> _xblockexpression = null;
   {
     ProgressIndicatorProvider.checkCanceled();
     ICrossReferenceDescription crossReferenceDescription = this.getCrossReferenceDescription();
     boolean _equals = Objects.equal(crossReferenceDescription, null);
     if (_equals) {
       return ((Object[])
           Conversions.unwrapArray(CollectionLiterals.<Object>emptyList(), Object.class));
     }
     ArrayList<LookupElementBuilder> variants =
         CollectionLiterals.<LookupElementBuilder>newArrayList();
     Iterable<IEObjectDescription> _variants = crossReferenceDescription.getVariants();
     for (final IEObjectDescription objectDescription : _variants) {
       {
         ProgressIndicatorProvider.checkCanceled();
         QualifiedName _name = objectDescription.getName();
         String name = this.qualifiedNameConverter.toString(_name);
         BaseXtextFile _xtextFile = this.myElement.getXtextFile();
         XtextResource _resource = _xtextFile.getResource();
         PsiElement element =
             this.psiModelAssociations.getPsiElement(objectDescription, _resource);
         boolean _notEquals = (!Objects.equal(element, null));
         if (_notEquals) {
           LookupElementBuilder _create = LookupElementBuilder.create(name);
           PsiElement _navigationElement = element.getNavigationElement();
           PsiFile _containingFile = _navigationElement.getContainingFile();
           String _name_1 = _containingFile.getName();
           LookupElementBuilder _withTypeText = _create.withTypeText(_name_1);
           variants.add(_withTypeText);
         }
       }
     }
     _xblockexpression = variants;
   }
   return ((Object[]) Conversions.unwrapArray(_xblockexpression, Object.class));
 }
コード例 #4
0
 protected CharSequence generate(final ExampleTable table) {
   StringConcatenation _builder = new StringConcatenation();
   _builder.append("<table class=\"table table-striped table-bordered table-condensed\">");
   _builder.newLine();
   _builder.append("\t");
   _builder.append("<thead>");
   _builder.newLine();
   _builder.append("\t\t");
   _builder.append("<tr>");
   _builder.newLine();
   {
     EList<ExampleColumn> _columns = table.getColumns();
     for (final ExampleColumn headingCell : _columns) {
       _builder.append("\t\t");
       _builder.append("<th>");
       String _name = headingCell.getName();
       _builder.append(_name, "\t\t");
       _builder.append("</th>");
       _builder.newLineIfNotEmpty();
     }
   }
   _builder.append("\t\t");
   _builder.append("</tr>");
   _builder.newLine();
   _builder.append("\t");
   _builder.append("</thead>");
   _builder.newLine();
   _builder.append("\t");
   _builder.append("<tbody>");
   _builder.newLine();
   {
     EList<ExampleRow> _rows = table.getRows();
     for (final ExampleRow row : _rows) {
       _builder.append("\t");
       _builder.append("<tr>");
       _builder.newLine();
       {
         EList<ExampleCell> _cells = row.getCells();
         for (final ExampleCell cell : _cells) {
           _builder.append("\t");
           _builder.append("\t");
           _builder.append("<td>");
           XExpression _expression = cell.getExpression();
           List<Filter> _emptyList = CollectionLiterals.<Filter>emptyList();
           String _serialize = this.serialize(_expression, _emptyList);
           _builder.append(_serialize, "\t\t");
           _builder.append("</td>");
           _builder.newLineIfNotEmpty();
         }
       }
       _builder.append("\t");
       _builder.append("</tr>");
       _builder.newLine();
     }
   }
   _builder.append("\t");
   _builder.append("</tbody>");
   _builder.newLine();
   _builder.append("</table>");
   _builder.newLine();
   return _builder;
 }