Package org.eclipse.xtext.nodemodel

Examples of org.eclipse.xtext.nodemodel.INode


    acceptor.accept(p);
  }
 
  public void completeTargetPlatform_Contents(final EObject model, final Assignment assignment, final ContentAssistContext context, final ICompletionProposalAcceptor acceptor) {
    int _offset = context.getOffset();
    INode _lastCompleteNode = context.getLastCompleteNode();
    int _endOffset = _lastCompleteNode.getEndOffset();
    final int currentNodeSizeToCursor = (_offset - _endOffset);
    String _xifexpression = null;
    INode _currentNode = context.getCurrentNode();
    String _text = _currentNode.getText();
    int _length = _text.length();
    boolean _greaterEqualsThan = (_length >= currentNodeSizeToCursor);
    if (_greaterEqualsThan) {
      INode _currentNode_1 = context.getCurrentNode();
      String _text_1 = _currentNode_1.getText();
      _xifexpression = _text_1.substring(0, currentNodeSizeToCursor);
    } else {
      _xifexpression = "";
    }
    final String text = _xifexpression;
    boolean _or = false;
    boolean _contains = text.contains("\n");
    if (_contains) {
      _or = true;
    } else {
      INode _currentNode_2 = context.getCurrentNode();
      String _text_2 = _currentNode_2.getText();
      int _length_1 = _text_2.length();
      boolean _lessThan = (_length_1 < currentNodeSizeToCursor);
      _or = _lessThan;
    }
    if (_or) {
View Full Code Here


    acceptor.accept(p);
  }
 
  public void completeOptions_Options(final EObject model, final Assignment assignment, final ContentAssistContext context, final ICompletionProposalAcceptor acceptor) {
    int _offset = context.getOffset();
    INode _lastCompleteNode = context.getLastCompleteNode();
    int _endOffset = _lastCompleteNode.getEndOffset();
    final int currentNodeSizeToCursor = (_offset - _endOffset);
    String _xifexpression = null;
    INode _currentNode = context.getCurrentNode();
    String _text = _currentNode.getText();
    int _length = _text.length();
    boolean _greaterEqualsThan = (_length >= currentNodeSizeToCursor);
    if (_greaterEqualsThan) {
      INode _currentNode_1 = context.getCurrentNode();
      String _text_1 = _currentNode_1.getText();
      _xifexpression = _text_1.substring(0, currentNodeSizeToCursor);
    } else {
      _xifexpression = "";
    }
    final String text = _xifexpression;
    boolean _or = false;
    boolean _contains = text.contains("\n");
    boolean _not = (!_contains);
    if (_not) {
      _or = true;
    } else {
      INode _currentNode_2 = context.getCurrentNode();
      String _text_2 = _currentNode_2.getText();
      int _length_1 = _text_2.length();
      boolean _lessThan = (_length_1 < currentNodeSizeToCursor);
      _or = _lessThan;
    }
    if (_or) {
View Full Code Here

    return p;
  }
 
  public void completeEnvironment_Env(final EObject model, final Assignment assignment, final ContentAssistContext context, final ICompletionProposalAcceptor acceptor) {
    int _offset = context.getOffset();
    INode _lastCompleteNode = context.getLastCompleteNode();
    int _endOffset = _lastCompleteNode.getEndOffset();
    final int currentNodeSizeToCursor = (_offset - _endOffset);
    String _xifexpression = null;
    INode _currentNode = context.getCurrentNode();
    String _text = _currentNode.getText();
    int _length = _text.length();
    boolean _greaterEqualsThan = (_length >= currentNodeSizeToCursor);
    if (_greaterEqualsThan) {
      INode _currentNode_1 = context.getCurrentNode();
      String _text_1 = _currentNode_1.getText();
      _xifexpression = _text_1.substring(0, currentNodeSizeToCursor);
    } else {
      _xifexpression = "";
    }
    final String text = _xifexpression;
    boolean _or = false;
    boolean _contains = text.contains("\n");
    boolean _not = (!_contains);
    if (_not) {
      _or = true;
    } else {
      INode _currentNode_2 = context.getCurrentNode();
      String _text_2 = _currentNode_2.getText();
      int _length_1 = _text_2.length();
      boolean _lessThan = (_length_1 < currentNodeSizeToCursor);
      _or = _lessThan;
    }
    if (_or) {
View Full Code Here

  }
 
  public void completeIU_ID(final EObject model, final Assignment assignment, final ContentAssistContext context, final ICompletionProposalAcceptor acceptor) {
    try {
      int _offset = context.getOffset();
      INode _lastCompleteNode = context.getLastCompleteNode();
      int _endOffset = _lastCompleteNode.getEndOffset();
      final int currentNodeSizeToCursor = (_offset - _endOffset);
      String _xifexpression = null;
      INode _currentNode = context.getCurrentNode();
      String _text = _currentNode.getText();
      int _length = _text.length();
      boolean _greaterEqualsThan = (_length >= currentNodeSizeToCursor);
      if (_greaterEqualsThan) {
        INode _currentNode_1 = context.getCurrentNode();
        String _text_1 = _currentNode_1.getText();
        _xifexpression = _text_1.substring(0, currentNodeSizeToCursor);
      } else {
        _xifexpression = "";
      }
      final String text = _xifexpression;
      boolean _or = false;
      boolean _contains = text.contains("\n");
      if (_contains) {
        _or = true;
      } else {
        INode _currentNode_2 = context.getCurrentNode();
        String _text_2 = _currentNode_2.getText();
        int _length_1 = _text_2.length();
        boolean _lessThan = (_length_1 < currentNodeSizeToCursor);
        _or = _lessThan;
      }
      if (_or) {
View Full Code Here

      } else {
        _xifexpression_1 = "";
      }
      final String prefix = _xifexpression_1;
      int _offset = context.getOffset();
      INode _lastCompleteNode = context.getLastCompleteNode();
      int _endOffset = _lastCompleteNode.getEndOffset();
      final int currentNodeSizeToCursor = (_offset - _endOffset);
      String _xifexpression_2 = null;
      INode _currentNode = context.getCurrentNode();
      String _text = _currentNode.getText();
      int _length_1 = _text.length();
      boolean _greaterEqualsThan_1 = (_length_1 >= currentNodeSizeToCursor);
      if (_greaterEqualsThan_1) {
        INode _currentNode_1 = context.getCurrentNode();
        String _text_1 = _currentNode_1.getText();
        _xifexpression_2 = _text_1.substring(0, currentNodeSizeToCursor);
      } else {
        _xifexpression_2 = "";
      }
      final String text = _xifexpression_2;
      boolean _or = false;
      boolean _contains = text.contains("\n");
      boolean _not_2 = (!_contains);
      if (_not_2) {
        _or = true;
      } else {
        INode _currentNode_2 = context.getCurrentNode();
        String _text_2 = _currentNode_2.getText();
        int _length_2 = _text_2.length();
        boolean _lessThan = (_length_2 < currentNodeSizeToCursor);
        _or = _lessThan;
      }
      if (_or) {
View Full Code Here

   */
  public Enum enumTypeOf(MessageField field) {
    if (field == null) {
      return null;
    }
    INode node = nodes.firstNodeForFeature(field, MESSAGE_FIELD__TYPE);
    if (node == null) {
      return null;
    }
    String typeName = node.getText();
    return (isNullOrEmpty(typeName)) ? null : enumByName(typeName.trim());
  }
View Full Code Here

    when(node.isHidden()).thenReturn(false);
    assertFalse(nodes.isHiddenLeafNode(node));
  }

  @Test public void should_return_false_if_given_node_is_not_an_ILeafNode() {
    INode node = mock(INode.class);
    assertFalse(nodes.isHiddenLeafNode(node));
  }
View Full Code Here

    highlightFirstFeature(o, o.eClass().getEStructuralFeature("name"), acceptor, highlightId);
  }

  private void highlightFirstFeature(EObject semantic, EStructuralFeature feature,
      IHighlightedPositionAcceptor acceptor, String highlightId) {
    INode node = nodes.firstNodeForFeature(semantic, feature);
    if (node == null) {
      return;
    }
    acceptor.addPosition(node.getOffset(), node.getLength(), highlightId);
  }
View Full Code Here

  // message Person {
  //   optional bool active = 1;
  // }
  @Test public void should_return_first_node_for_feature() {
    MessageField field = xtext.find("active", MessageField.class);
    INode node = nodes.firstNodeForFeature(field, MESSAGE_FIELD__NAME);
    assertThat(node.getText().trim(), equalTo("active"));
  }
View Full Code Here

        }
        Import anImport = (Import) resolved;
        if (!imports.isResolved(anImport)) {
          return NO_HYPERLINKS;
        }
        INode importUriNode = nodes.firstNodeForFeature(anImport, IMPORT__IMPORT_URI);
        if (importUriNode.getLength() == 0) {
          return NO_HYPERLINKS;
        }
        ImportHyperlink hyperlink = importHyperlinkProvider.get();
        hyperlink.update(anImport, importUriNode);
        return new IHyperlink[] { hyperlink };
View Full Code Here

TOP

Related Classes of org.eclipse.xtext.nodemodel.INode

Copyright © 2018 www.massapicom. 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.