Examples of TextRange


Examples of com.salas.bb.domain.utils.TextRange

     */
    public void testAddLinkToMap()
    {
        Map<String, java.util.List<TextRange>> map = new HashMap<String, java.util.List<TextRange>>();

        TextRange range0 = new TextRange(0, 0);
        HTMLArticleDisplay.addLinkToMap(map, "a", range0);

        assertEquals("The link wasn't added.", 1, map.size());
        java.util.List<TextRange> record = map.get("a");
        assertTrue("Wrong object.", record.get(0) == range0);

        // Adding duplicate link
        TextRange range1 = new TextRange(1, 1);
        HTMLArticleDisplay.addLinkToMap(map, "a", range1);

        assertEquals("The link should be added to existing link entry.", 1, map.size());
        record = map.get("a");
        assertTrue("Wrong object.", record.get(0) == range0);
View Full Code Here

Examples of org.eclipse.handly.util.TextRange

            } else {
                ErlLogger.error(e);
            }
            return false;
        }
        final TextRange identifyingRange = info.getIdentifyingRange();
        if (identifyingRange.isNull()) {
            return false;
        }
        textEditor.selectAndReveal(identifyingRange.getOffset(),
                identifyingRange.getLength());
        return true;
    }
View Full Code Here

Examples of org.eclipse.handly.util.TextRange

    return ((OtpErlangAtom) _head).atomValue();
  }
 
  public TextRange getPos() {
    try {
      TextRange _xblockexpression = null;
      {
        Iterable<OtpErlangObject> _tail = IterableExtensions.<OtpErlangObject>tail(this.items);
        OtpErlangObject _head = IterableExtensions.<OtpErlangObject>head(_tail);
        final Bindings pos = OtpErlang.match("{{Line,Offset,FileOffset},Len}", _head);
        int _int = pos.getInt("FileOffset");
        int _int_1 = pos.getInt("Len");
        _xblockexpression = new TextRange(_int, _int_1);
      }
      return _xblockexpression;
    } catch (Throwable _e) {
      throw Exceptions.sneakyThrow(_e);
    }
View Full Code Here

Examples of org.eclipse.handly.util.TextRange

            _switchResult = new ErlFunction(source, _name_1, _arg);
          }
        }
        final ErlForm handle = _switchResult;
        final SourceElementBody body = new SourceElementBody();
        TextRange _pos = node.getPos();
        body.setFullRange(_pos);
        this.addChild(parentBody, handle, body);
        this.complete(body);
      }
    }
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.