Package javax.swing.text.html.HTML

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


        other = new UnknownTag("author");
        assertFalse(tag.equals(other));
    }

    public void testHashCode() {
        Tag other = new UnknownTag(new String(tagName));
        assertNotSame(tag.toString(), other.toString());
        assertEquals(tag.toString(), other.toString());
        assertEquals(tagName.hashCode(), tag.hashCode());
        assertEquals(other.hashCode(), tag.hashCode());

        other = new UnknownTag("author");
        assertFalse(other.hashCode() == tag.hashCode());
    }
View Full Code Here


    public void testNull() {
        tag = new UnknownTag(null);
        assertNull(tag.toString());

        Tag other = new UnknownTag(null);
        try {
            assertTrue(tag.equals(other));
            fail("NPE expected");
        } catch (NullPointerException e) { }
View Full Code Here

            fail("NPE expected");
        } catch (NullPointerException e) { }
    }

    public void testSerializable() throws Exception {
        Tag readTag = (Tag)serializeObject(tag);
        assertTrue(readTag instanceof UnknownTag);
        assertEquals(tagName, readTag.toString());
        assertTrue(tag.equals(readTag));
        assertFalse(readTag.breaksFlow());
        assertFalse(readTag.isBlock());
        assertFalse(readTag.isPreformatted());
    }
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

        private void flushHtmlText(boolean breaksFlowAfter) {
            if (htmlText2flush != null) {
                boolean breaksFlowBefore = breaksFlowBefore();
                char[] s = getText(htmlText2flush, breaksFlowBefore, breaksFlowAfter);
                if (s.length != 0) {
                   Tag tag =getNodeTag(currentElemNode);
                    if (tag != null && tag.equals(Tag.TITLE)) {
                        handleTitle(s);
                   }
                   manageStartElement(dtd.pcdata, htmlText2flush.getOffset());
                   currentStartPos = htmlText2flush.getOffset();
                   handleText(s);       
View Full Code Here

         * @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

        private void flushHtmlText(boolean breaksFlowAfter) {
            if (htmlText2flush != null) {
                boolean breaksFlowBefore = breaksFlowBefore();
                char[] s = getText(htmlText2flush, breaksFlowBefore, breaksFlowAfter);
                if (s.length != 0) {
                   Tag tag =getNodeTag(currentElemNode);
                    if (tag != null && tag.equals(Tag.TITLE)) {
                        handleTitle(s);
                   }
                   manageStartElement(dtd.pcdata, htmlText2flush.getOffset());
                   currentStartPos = htmlText2flush.getOffset();
                   handleText(s);       
View Full Code Here

         * @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 void flushHtmlText(boolean breaksFlowAfter) {
            if (htmlText2flush != null) {
                boolean breaksFlowBefore = breaksFlowBefore();
                char[] s = getText(htmlText2flush, breaksFlowBefore, breaksFlowAfter);
                if (s.length != 0) {
                   Tag tag =getNodeTag(currentElemNode);
                    if (tag != null && tag.equals(Tag.TITLE)) {
                        handleTitle(s);
                   }
                   manageStartElement(dtd.pcdata, htmlText2flush.getOffset());
                   currentStartPos = htmlText2flush.getOffset();
                   handleText(s);       
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.