Package javax.swing.text.html.HTML

Examples of javax.swing.text.html.HTML.Tag


         * @return the {@link Tag} that is stored in the node, if node
         *             is not null. If node in null, then null is returned.
         */
        private Tag getNodeTag(DefaultMutableTreeNode node) {
            TagElement tag = getNodeTagElement(node);
            Tag t = null;
            if (tag != null) {
                t = tag.getHTMLTag();
            }
            return t;
        }
View Full Code Here


                }
            }

            private FormAction getFormAction() {
                for (int i = 0; i < formActionTags.length; i++) {
                    final Tag tag = formActionTags[i];
                    TagAction action = getAction(tag);
                    if (action instanceof FormAction) {
                        return (FormAction)action;
                    }
                }
View Full Code Here

public class HTML_TagTest extends TestCase {
    private Tag tag;

    public void testTag() {
        tag = new Tag();
        assertNull(tag.toString());
        assertFalse("breaks Flow", tag.breaksFlow());
        assertFalse("isBlock", tag.isBlock());
        assertFalse("isPre", tag.isPreformatted());
    }
View Full Code Here

        assertFalse("isPre", tag.isPreformatted());
    }

    public void testTagString() {
        final String tagName = "newTag";
        tag = new Tag(tagName);
        assertEquals("newTag", tag.toString());
        assertSame(tagName, tag.toString());
        assertFalse("breaks Flow", tag.breaksFlow());
        assertFalse("isBlock", tag.isBlock());
        assertFalse("isPre", tag.isPreformatted());
View Full Code Here

        assertFalse("isBlock", tag.isBlock());
        assertFalse("isPre", tag.isPreformatted());
    }

    public void testTagStringboolbool() {
        tag = new Tag("tag1", true, false);
        assertSame("tag1", tag.toString());
        assertTrue("breaks Flow", tag.breaksFlow());
        assertFalse("isBlock", tag.isBlock());
        assertFalse("isPre", tag.isPreformatted());

        tag = new Tag("tag2", false, true);
        assertSame("tag2", tag.toString());
        assertFalse("breaks Flow", tag.breaksFlow());
        assertTrue("isBlock", tag.isBlock());
        assertFalse("isPre", tag.isPreformatted());
    }
View Full Code Here

        assertTrue("isBlock", tag.isBlock());
        assertFalse("isPre", tag.isPreformatted());
    }

    public void testIsPreformatted() throws Exception {
        tag = new Tag("pre", false, false);
        assertNotSame(Tag.PRE, tag);
        assertEquals(Tag.PRE.toString(), tag.toString());
        assertFalse("isPre", tag.isPreformatted());

        tag = new Tag("textarea", false, false);
        assertNotSame(Tag.TEXTAREA, tag);
        assertEquals(Tag.TEXTAREA.toString(), tag.toString());
        assertFalse("isPre", tag.isPreformatted());

        tag = new Tag("verb", true, false) {
            public boolean isPreformatted() {
                return true;
            }
        };
        assertEquals("verb", tag.toString());
View Full Code Here

        doc.setPreservesUnknownTags(true);
        reader.handleStartTag(Tag.HTML, attr, 0);
        reader.handleStartTag(Tag.BODY, attr, 0);
        reader.handleStartTag(Tag.P, attr, 0);
        assertEquals(3, reader.parseBuffer.size());
        reader.handleSimpleTag(new Tag("fake"), attr, 0);
        assertEquals(4, reader.parseBuffer.size());
    }
View Full Code Here

    public void testAnchorStartEnd() {
        SimpleAttributeSet attr = new SimpleAttributeSet();
        // If href attribute is absent, after 4606 handleStartTag(Tag.A) does
        // nothing. After addition the href attribute, Tag.A works as before
        attr.addAttribute(HTML.Attribute.HREF, "");
        final Tag tag = Tag.A;
        reader.handleStartTag(tag, attr, 0);
        assertEquals(1, reader.charAttr.getAttributeCount());
        assertEquals(0, reader.parseBuffer.size());
        reader.handleEndTag(tag, 0);
        assertEquals(0, reader.charAttr.getAttributeCount());
View Full Code Here

    public void testAnchorStartTextEnd() {
        SimpleAttributeSet attr = new SimpleAttributeSet();
        attr.addAttribute("aaaa", "bbbb");
        attr.addAttribute(HTML.Attribute.HREF, "file:///index.html");
        final Tag tag = Tag.A;
        reader.handleStartTag(Tag.BODY, attr, 0);
        reader.handleStartTag(tag, attr, 0);
        assertEquals(1, reader.charAttr.getAttributeCount());
        assertEquals(1, reader.parseBuffer.size());
        reader.handleText("text".toCharArray(), 0);
View Full Code Here

                };
            }
        };
        reader = (HTMLReader)doc.getReader(0);
        String text = "precontent";
        Tag tag = Tag.HTML;
        SimpleAttributeSet attr = new SimpleAttributeSet();
        attr.addAttribute("aaaa", "bbbb");
        reader.addSpecialElement(tag, attr);
        assertTrue(specialMarker.isOccurred());
        ArrayList callInfo = (ArrayList)specialMarker.getAuxiliary();
View Full Code Here

TOP

Related Classes of javax.swing.text.html.HTML.Tag

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.