Examples of ParserDelegator


Examples of javax.swing.text.html.parser.ParserDelegator

        htmlDoc.setParser(new ParserDelegator());
        htmlDoc.insertBeforeStart(null, "<a>link</a>");
    }

    public void testSetInnerHTML_Specs() throws Exception {
        htmlDoc.setParser(new ParserDelegator());
        loadDocument(htmlDoc, "<table><tr><td>table</td></tr></table>");
        htmlDoc.setEditable(false);
       
        Element root = htmlDoc.getDefaultRootElement();
        Element body = root.getElement(1);
View Full Code Here

Examples of javax.swing.text.html.parser.ParserDelegator

        checkEndTagSpec(specs[6]);
        checkEndTagSpec(specs[7]);
    }

    public void testSetInnerHTML_Specs2() throws Exception {
        htmlDoc.setParser(new ParserDelegator());
        htmlDoc.setEditable(false);
       
        Element root = htmlDoc.getDefaultRootElement();
        Element body = root.getElement(0);
        Element p = body.getElement(0);
View Full Code Here

Examples of javax.swing.text.html.parser.ParserDelegator

        Element root = htmlDoc.getDefaultRootElement();
        Element branch1 = root.getElement(0);
        final Element branch2 = branch1.getElement(0);
        Element branch3 = branch2.getElement(0);

        htmlDoc.setParser(new ParserDelegator());
        DocumentController listener = new DocumentController();
        htmlDoc.addDocumentListener(listener);
        htmlDoc.setInnerHTML(branch2, "<a>link</a><b>bold</b>");
        assertEquals(2, listener.getNumEvents());
        checkEvent(branch2, listener.getEvent(0), DocumentEvent.EventType.INSERT, 4, 9, 0);
View Full Code Here

Examples of javax.swing.text.html.parser.ParserDelegator

        Element root = htmlDoc.getDefaultRootElement();
        Element branch1 = root.getElement(0);
        Element branch2 = branch1.getElement(0);
        Element branch3 = branch2.getElement(0);
       
        htmlDoc.setParser(new ParserDelegator());
        assertEquals(4, branch2.getElementCount());
        htmlDoc.setInnerHTML(branch2, "<a>link</a><b>bold</b>");
        assertEquals("linkbold", htmlDoc.getText(0, htmlDoc.getLength()));
        assertEquals(3, branch2.getElementCount());
       
View Full Code Here

Examples of javax.swing.text.html.parser.ParserDelegator

            htmlDoc.setInnerHTML(branch3, "<a>link</a>");
            fail("IllegalStateException should be thrown");
        } catch (IllegalStateException e) {
        }
       
        htmlDoc.setParser(new ParserDelegator());
        try {
            htmlDoc.setInnerHTML(branch3, "<a>link</a>");
            fail("IllegalArgumentException should be thrown");
        } catch (IllegalArgumentException e) {
        }
View Full Code Here

Examples of javax.swing.text.html.parser.ParserDelegator

        htmlDoc.setInnerHTML(null, "<a>link</a>");
    }

    public void testSetOuterHTML_Specs() throws Exception {
        htmlDoc.setParser(new ParserDelegator());
        loadDocument(htmlDoc, "<table><tr><td><br>table</td></tr></table>");
       
        Element root = htmlDoc.getDefaultRootElement();
        Element body = root.getElement(1);
        Element table = body.getElement(0);
View Full Code Here

Examples of javax.swing.text.html.parser.ParserDelegator

        assertSpec(specs[4], ElementSpec.ContentType, ElementSpec.OriginateDirection, 0, new char[]{'\n'});
        checkEndTagSpec(specs[5]);
    }

    public void testSetOuterHTML_Specs2() throws Exception {
        htmlDoc.setParser(new ParserDelegator());
       
        Element root = htmlDoc.getDefaultRootElement();
        Element body = root.getElement(0);
        Element p = body.getElement(0);
View Full Code Here

Examples of javax.swing.text.html.parser.ParserDelegator

        addElements();
        Element root = htmlDoc.getDefaultRootElement();
        Element branch1 = root.getElement(0);
        Element branch2 = branch1.getElement(0);
        Element branch3 = branch2.getElement(0);
        htmlDoc.setParser(new ParserDelegator());
       
        DocumentController listener = new DocumentController();
        htmlDoc.addDocumentListener(listener);
       
        assertEquals(4, branch2.getElementCount());
View Full Code Here

Examples of javax.swing.text.html.parser.ParserDelegator

        addElements();
        Element root = htmlDoc.getDefaultRootElement();
        Element branch1 = root.getElement(0);
        Element branch2 = branch1.getElement(0);
   
        htmlDoc.setParser(new ParserDelegator());
        assertEquals(1, branch1.getElementCount());
        htmlDoc.setOuterHTML(branch2, "<a>link</a><b>bold</b>");
        assertEquals("linkbold", htmlDoc.getText(0, htmlDoc.getLength()));
        assertEquals(3, branch1.getElementCount());
   
View Full Code Here

Examples of javax.swing.text.html.parser.ParserDelegator

        assertEquals(Tag.FRAME, frameAttr.getAttribute(StyleConstants.NameAttribute));
        controller.reset();

        // tests improper use behaviour (for compatibility reasons)
        HTMLFrameHyperlinkEvent event6 = new HTMLFrameHyperlinkEvent(htmlDoc, HyperlinkEvent.EventType.ACTIVATED, new URL(urlStr1), newFrame, "_parent");
        ParserDelegator parser = new ParserDelegator();
        htmlDoc.setParser(parser);
        htmlDoc.processHTMLFrameHyperlinkEvent(event6);
        assertSame(parser, htmlDoc.getParser());
        assertTrue(controller.isChanged());
        assertEquals(2, controller.getNumEvents());
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.