Package com.salas.bb.domain.utils

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


        DefaultHighlighter.DefaultHighlightPainter painter =
            new DefaultHighlighter.DefaultHighlightPainter(aBackground);

        for (int i = 0; i < aRanges.length; i++)
        {
            TextRange range = aRanges[i];

            try
            {
                highlighter.addHighlight(range.getStart(), range.getEnd(), painter);
            } catch (BadLocationException e)
            {
                // Failed to put highligh marks
            }
        }
View Full Code Here

            String link = (String)attrSet.getAttribute(HTML.Attribute.HREF);
            if (link != null)
            {
                int startOffset = tagIterator.getStartOffset();
                int endOffset = tagIterator.getEndOffset();
                TextRange textRange = new TextRange(startOffset, endOffset);

                addLinkToMap(links, link, textRange);
            }

            tagIterator.next();
View Full Code Here

TOP

Related Classes of com.salas.bb.domain.utils.TextRange

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.