Package org.eclipse.xtext.nodemodel.impl

Examples of org.eclipse.xtext.nodemodel.impl.AbstractNode


  <T extends EObject> T find(String text, int count, Class<T> type, List<SearchOption> options) {
    int offset = protoAsText.indexOf(text);
    String name = text.substring(0, count);
    Iterator<AbstractNode> iterator = root.basicIterator();
    while (iterator.hasNext()) {
      AbstractNode node = iterator.next();
      int nodeOffset = node.getOffset();
      if (nodeOffset > offset || (nodeOffset + node.getLength()) <= offset) {
        continue;
      }
      EObject e = node.getSemanticElement();
      if (isDefaultValueFieldOption(name, type, e)) {
        return type.cast(e);
      }
      if (type.isInstance(e)) {
        if (areNamesEqual(name, e, options)) {
View Full Code Here


  }

  ILeafNode find(String text) {
    BidiTreeIterator<AbstractNode> iterator = root.basicIterator();
    while (iterator.hasNext()) {
      AbstractNode node = iterator.next();
      if (!(node instanceof ILeafNode)) {
        continue;
      }
      String nodeText = clean(node.getText());
      if (text.equals(nodeText)) {
        return (ILeafNode) node;
      }
    }
    String format = "Unable to find node. Text: '%s'";
View Full Code Here

TOP

Related Classes of org.eclipse.xtext.nodemodel.impl.AbstractNode

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.