Package javax.swing.text.html.HTMLDocument

Examples of javax.swing.text.html.HTMLDocument.RunElement


        htmlDoc = null;
        super.tearDown();
    }

    public void testGetName() {
        AbstractElement run = htmlDoc.new RunElement(null, null, 0, 0);
        assertEquals("content", run.getName());
        htmlDoc.lockWrite();

        final String name = "asddsa";
        run = htmlDoc.new RunElement(null, null, 0, 0);
        run.addAttribute(StyleConstants.NameAttribute, name);
        assertEquals(name, run.getName());
    }
View Full Code Here


        run.addAttribute(StyleConstants.NameAttribute, name);
        assertEquals(name, run.getName());
    }

    public void testGetResolveParent() {
        AbstractElement parent = htmlDoc.new RunElement(null, null, 0, 0);
        AbstractElement block = htmlDoc.new RunElement(parent, null, 0, 0);
        assertNull(parent.getResolveParent());
        assertNull(block.getResolveParent());
    }
View Full Code Here

    }

    public void testRunElement() {
        htmlDoc.lockWrite();

        RunElement run = htmlDoc.new RunElement(leaf1, as[2],
                3, 9);

        assertSame(leaf1, run.getParent());
        assertSame(leaf1, run.getParentElement());
        assertSame(run, run.getAttributes());
        assertEquals(as[2].getAttributeCount(), run.getAttributeCount());
        assertEquals(3, run.getStartOffset());
        assertEquals(9, run.getEndOffset());

        int[] start    = {-1333}; // start offset
        int[] expStart = {0333}// expectations for start offset
        int[] end      = {9, -11, 20}// end offset
        int[] expEnd   = {901, 20}// expectations for end offset
        int[] intEnd   = {933, 20}// expectations for DRL's end offset
        for (int i = 0; i < start.length; i++) {
            run = htmlDoc.new RunElement(null, null, start[i], end[i]);
            assertEquals("Start (" + i + ")", expStart[i],
                         run.getStartOffset());
            assertEquals("End (" + i + ")",
                         isHarmony() ? intEnd[i] : expEnd[i],
                         run.getEndOffset());
        }

        htmlDoc.unlockWrite();
    }
View Full Code Here

        htmlDoc = null;
        super.tearDown();
    }

    public void testGetName() {
        AbstractElement run = htmlDoc.new RunElement(null, null, 0, 0);
        assertEquals("content", run.getName());
        htmlDoc.lockWrite();

        final String name = "asddsa";
        run = htmlDoc.new RunElement(null, null, 0, 0);
        run.addAttribute(StyleConstants.NameAttribute, name);
        assertEquals(name, run.getName());
    }
View Full Code Here

        run.addAttribute(StyleConstants.NameAttribute, name);
        assertEquals(name, run.getName());
    }

    public void testGetResolveParent() {
        AbstractElement parent = htmlDoc.new RunElement(null, null, 0, 0);
        AbstractElement block = htmlDoc.new RunElement(parent, null, 0, 0);
        assertNull(parent.getResolveParent());
        assertNull(block.getResolveParent());
    }
View Full Code Here

    }

    public void testRunElement() {
        htmlDoc.lockWrite();

        RunElement run = htmlDoc.new RunElement(leaf1, as[2],
                3, 9);

        assertSame(leaf1, run.getParent());
        assertSame(leaf1, run.getParentElement());
        assertSame(run, run.getAttributes());
        assertEquals(as[2].getAttributeCount(), run.getAttributeCount());
        assertEquals(3, run.getStartOffset());
        assertEquals(9, run.getEndOffset());

        int[] start    = {-1333}; // start offset
        int[] expStart = {0333}// expectations for start offset
        int[] end      = {9, -11, 20}// end offset
        int[] expEnd   = {901, 20}// expectations for end offset
        int[] intEnd   = {933, 20}// expectations for DRL's end offset
        for (int i = 0; i < start.length; i++) {
            run = htmlDoc.new RunElement(null, null, start[i], end[i]);
            assertEquals("Start (" + i + ")", expStart[i],
                         run.getStartOffset());
            assertEquals("End (" + i + ")",
                         isHarmony() ? intEnd[i] : expEnd[i],
                         run.getEndOffset());
        }

        htmlDoc.unlockWrite();
    }
View Full Code Here

TOP

Related Classes of javax.swing.text.html.HTMLDocument.RunElement

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.