Package javax.swing.text.DefaultStyledDocument

Examples of javax.swing.text.DefaultStyledDocument.ElementSpec


        action = reader.new BlockAction();
       
        action.start(Tag.B, attr);
        assertEquals(0, reader.charAttr.getAttributeCount());
        assertEquals(1, reader.parseBuffer.size());
        final ElementSpec spec = (ElementSpec)reader.parseBuffer.get(0);
        final AttributeSet specAttr = spec.getAttributes();
        assertEquals(2, specAttr.getAttributeCount());
        checkAttributes(specAttr, StyleConstants.NameAttribute, Tag.B);
        checkAttributes(specAttr, "aaaa", "bbbb");
        assertSpec(spec, ElementSpec.StartTagType, ElementSpec.OriginateDirection, 0, null);
    }
View Full Code Here


        action = reader.new BlockAction();
       
        action.end(Tag.B);
        assertEquals(0, reader.charAttr.getAttributeCount());
        assertEquals(1, reader.parseBuffer.size());
        final ElementSpec spec = (ElementSpec)reader.parseBuffer.get(0);
        checkEndTagSpec(spec);
    }
View Full Code Here

        action = reader.new ParagraphAction();
       
        action.start(Tag.P, attr);
        assertEquals(0, reader.charAttr.getAttributeCount());
        assertEquals(1, reader.parseBuffer.size());
        final ElementSpec spec = (ElementSpec)reader.parseBuffer.get(0);
        final AttributeSet specAttr = spec.getAttributes();
        assertEquals(2, specAttr.getAttributeCount());
        checkAttributes(specAttr, StyleConstants.NameAttribute, Tag.P);
        checkAttributes(specAttr, "aaaa", "bbbb");
        assertSpec(spec, ElementSpec.StartTagType, ElementSpec.OriginateDirection, 0, null);
    }
View Full Code Here

        action = reader.new ParagraphAction();
       
        action.end(Tag.P);
        assertEquals(0, reader.charAttr.getAttributeCount());
        assertEquals(1, reader.parseBuffer.size());
        final ElementSpec spec = (ElementSpec)reader.parseBuffer.get(0);
        checkEndTagSpec(spec);
    }
View Full Code Here

        action = reader.new SpecialAction();
       
        action.start(Tag.IMG, attr);
        assertEquals(0, reader.charAttr.getAttributeCount());
        assertEquals(2, reader.parseBuffer.size());
        ElementSpec spec = (ElementSpec)reader.parseBuffer.get(0);
        AttributeSet specAttr;
        checkOpenImpliedSpec(spec);
        spec = (ElementSpec)reader.parseBuffer.get(1);
        specAttr = spec.getAttributes();
        assertEquals(2, specAttr.getAttributeCount());
        checkAttributes(specAttr, StyleConstants.NameAttribute, "img");
        checkAttributes(specAttr, "aaaa", "bbbb");
        checkImplicitContentSpec(spec);
View Full Code Here

        reader.new SpecialAction().start(Tag.I, new SimpleAttributeSet());
        assertEquals(1, reader.parseBuffer.size());
       
        reader.new SpecialAction().start(Tag.IMG, attr);
        assertEquals(2, reader.parseBuffer.size());
        ElementSpec spec = (ElementSpec)reader.parseBuffer.get(1);
        checkAttributes(spec.getAttributes(), StyleConstants.NameAttribute, Tag.IMG);
        checkImplicitContentSpec(spec);
    }
View Full Code Here

        assertEquals(0, reader.parseBuffer.size());
        assertEquals(1, reader.charAttr.getAttributeCount());
       
        reader.new SpecialAction().start(Tag.IMG, attr);
        assertEquals(1, reader.parseBuffer.size());
        ElementSpec spec = (ElementSpec)reader.parseBuffer.get(0);
        checkAttributes(spec.getAttributes(), StyleConstants.NameAttribute, Tag.IMG);
        checkImplicitContentSpec(spec);
    }
View Full Code Here

        assertEquals(3, reader.parseBuffer.size());

        reader.handleStartTag(Tag.FORM, attr, 0);
        assertEquals(6, reader.parseBuffer.size());
       
        ElementSpec spec = (ElementSpec)reader.parseBuffer.get(3);
        checkCRSpec(spec);
       
        spec = (ElementSpec)reader.parseBuffer.get(4);
        checkEndTagSpec(spec);
       
        spec = (ElementSpec)reader.parseBuffer.get(5);
        AttributeSet specAttr = spec.getAttributes();
        assertEquals(2, specAttr.getAttributeCount());
        checkAttributes(specAttr, StyleConstants.NameAttribute, Tag.FORM);
        checkAttributes(specAttr, "aaaa", "bbbb");
        assertSpec(spec, ElementSpec.StartTagType, ElementSpec.OriginateDirection, 0, null);
View Full Code Here

        action = reader.new PreAction();
       
        action.start(Tag.PRE, attr);
        assertEquals(2, reader.parseBuffer.size());
        assertEquals(0, reader.charAttr.getAttributeCount());
        ElementSpec spec = (ElementSpec)reader.parseBuffer.get(0);
        AttributeSet specAttr = spec.getAttributes();
        assertEquals(2, specAttr.getAttributeCount());
        checkAttributes(specAttr, StyleConstants.NameAttribute, Tag.PRE);
        checkAttributes(specAttr, "aaaa", "bbbb");
        assertSpec(spec, ElementSpec.StartTagType, ElementSpec.OriginateDirection, 0, null);

        spec = (ElementSpec)reader.parseBuffer.get(1);
        specAttr = spec.getAttributes();
        assertEquals(3, specAttr.getAttributeCount());
        checkAttributes(specAttr, StyleConstants.NameAttribute, Tag.IMPLIED);
        checkAttributes(specAttr, CSS.Attribute.WHITE_SPACE, "pre");
        checkAttributes(specAttr, "aaaa", "bbbb");
        assertSpec(spec, ElementSpec.StartTagType, ElementSpec.OriginateDirection, 0, null);
View Full Code Here

       
        action.start(Tag.PRE, attr);
        assertEquals(3, reader.parseBuffer.size());
        assertEquals(0, reader.charAttr.getAttributeCount());
       
        ElementSpec spec = (ElementSpec)reader.parseBuffer.get(1);
        AttributeSet specAttr = spec.getAttributes();
        assertEquals(2, specAttr.getAttributeCount());
        checkAttributes(specAttr, StyleConstants.NameAttribute, Tag.PRE);
        checkAttributes(specAttr, "aaaa", "bbbb");
        assertSpec(spec, ElementSpec.StartTagType, ElementSpec.OriginateDirection, 0, null);

        spec = (ElementSpec)reader.parseBuffer.get(2);
        specAttr = spec.getAttributes();
        assertEquals(3, specAttr.getAttributeCount());
        checkAttributes(specAttr, StyleConstants.NameAttribute, Tag.IMPLIED);
        checkAttributes(specAttr, CSS.Attribute.WHITE_SPACE, "pre");
        checkAttributes(specAttr, "aaaa", "bbbb");
        assertSpec(spec, ElementSpec.StartTagType, ElementSpec.OriginateDirection, 0, null);
View Full Code Here

TOP

Related Classes of javax.swing.text.DefaultStyledDocument.ElementSpec

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.