Package javax.swing.text.DefaultStyledDocument

Examples of javax.swing.text.DefaultStyledDocument.ElementSpec


        String text = "data       \t \r \f  data";
        assertEquals(2, reader.parseBuffer.size());
        reader.handleText(text.toCharArray(), 0);
       
        assertEquals(7, reader.parseBuffer.size());
        ElementSpec spec = (ElementSpec)reader.parseBuffer.get(6);
        assertEquals(text.length(), spec.getArray().length);
    }
View Full Code Here


        String text = "data       \t \r \f  data";
        assertEquals(2, reader.parseBuffer.size());
        reader.preContent(text.toCharArray());
       
        assertEquals(7, reader.parseBuffer.size());
        ElementSpec spec = (ElementSpec)reader.parseBuffer.get(6);
        assertEquals(text.length(), spec.getArray().length);
    }
View Full Code Here

        String text = "data       \t \r \f  data";
        assertEquals(2, reader.parseBuffer.size());
        reader.handleText(text.toCharArray(), 0);
       
        assertEquals(3, reader.parseBuffer.size());
        ElementSpec spec = (ElementSpec)reader.parseBuffer.get(2);
        assertEquals(text.length(), spec.getLength());
        assertEquals(text.length(), spec.getArray().length);
    }
View Full Code Here

       
        action.end(Tag.PRE);
        assertEquals(0, reader.charAttr.getAttributeCount());
        assertEquals(2, reader.parseBuffer.size());

        ElementSpec spec = (ElementSpec)reader.parseBuffer.get(0);
        checkEndTagSpec(spec);

        spec = (ElementSpec)reader.parseBuffer.get(1);
        checkEndTagSpec(spec);
    }
View Full Code Here

       
        action.start(Tag.ISINDEX, attr);
        assertEquals(0, reader.charAttr.getAttributeCount());
        assertEquals(5, reader.parseBuffer.size());

        ElementSpec spec = (ElementSpec)reader.parseBuffer.get(0);
        checkOpenImpliedSpec(spec);
       
        spec = (ElementSpec)reader.parseBuffer.get(1);
        checkOpenImpliedSpec(spec);

        spec = (ElementSpec)reader.parseBuffer.get(2);
        AttributeSet specAttr = spec.getAttributes();
        assertEquals(3, specAttr.getAttributeCount());
        checkAttributes(specAttr, StyleConstants.NameAttribute, Tag.ISINDEX);
        checkAttributes(specAttr, "aaaa", "bbbb");
        checkAttributes(specAttr, HTML.Attribute.PROMPT, prompt);
        checkImplicitContentSpec(spec);
View Full Code Here

        action.start(Tag.ISINDEX, attr);
        assertEquals(0, reader.charAttr.getAttributeCount());
        assertEquals(5, reader.parseBuffer.size());

        ElementSpec spec = (ElementSpec)reader.parseBuffer.get(0);
        AttributeSet specAttr = spec.getAttributes();
        assertEquals(1, specAttr.getAttributeCount());
        checkAttributes(specAttr, StyleConstants.NameAttribute, Tag.P);
        assertSpec(spec, ElementSpec.StartTagType, ElementSpec.OriginateDirection, 0, null);
       
        spec = (ElementSpec)reader.parseBuffer.get(1);
        checkOpenImpliedSpec(spec);

        spec = (ElementSpec)reader.parseBuffer.get(2);
        specAttr = spec.getAttributes();
        assertEquals(3, specAttr.getAttributeCount());
        checkAttributes(specAttr, StyleConstants.NameAttribute, Tag.ISINDEX);
        checkAttributes(specAttr, "aaaa", "bbbb");
        checkAttributes(specAttr, HTML.Attribute.PROMPT, prompt);
        checkImplicitContentSpec(spec);
View Full Code Here

        action = reader.new HiddenAction();

        action.start(Tag.SCRIPT, attr);
        assertEquals(2, reader.parseBuffer.size());
        assertEquals(0, reader.charAttr.getAttributeCount());
        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, Tag.SCRIPT);
        checkAttributes(specAttr, "aaaa", "bbbb");
        checkImplicitContentSpec(spec);
       
View Full Code Here

        assertEquals(2, reader.parseBuffer.size());
        action.end(Tag.SCRIPT);
        assertEquals(0, reader.charAttr.getAttributeCount());
        assertEquals(3, reader.parseBuffer.size());

        ElementSpec spec = (ElementSpec)reader.parseBuffer.get(2);
        AttributeSet specAttr = spec.getAttributes();
        assertEquals(2, specAttr.getAttributeCount());
        checkAttributes(specAttr, StyleConstants.NameAttribute, Tag.SCRIPT);
        checkAttributes(specAttr, HTML.Attribute.ENDTAG, Boolean.TRUE);
        checkImplicitContentSpec(spec);
    }
View Full Code Here

        SimpleAttributeSet attr = new SimpleAttributeSet();
        attr.addAttribute("aaaa", "bbbb");
        reader.handleStartTag(Tag.TITLE, attr, 0);
        assertEquals(0, reader.charAttr.getAttributeCount());
        assertEquals(2, reader.parseBuffer.size());
        ElementSpec spec = (ElementSpec)reader.parseBuffer.get(0);
        AttributeSet specAttr = spec.getAttributes();
        assertEquals(1, specAttr.getAttributeCount());
        checkOpenImpliedSpec(spec);
       
        spec = (ElementSpec)reader.parseBuffer.get(1);
        specAttr = spec.getAttributes();
        assertEquals(2, specAttr.getAttributeCount());
        checkAttributes(specAttr, StyleConstants.NameAttribute, Tag.TITLE);
        checkAttributes(specAttr, "aaaa", "bbbb");
        checkImplicitContentSpec(spec);
        assertNotSame(attr, specAttr);
View Full Code Here

        assertEquals(2, reader.parseBuffer.size());
        reader.handleEndTag(Tag.TITLE, 0);
       
        assertEquals(0, reader.charAttr.getAttributeCount());
        assertEquals(3, reader.parseBuffer.size());
        ElementSpec spec = (ElementSpec)reader.parseBuffer.get(2);
        AttributeSet specAttr = spec.getAttributes();
        assertEquals(2, specAttr.getAttributeCount());
        checkAttributes(specAttr, StyleConstants.NameAttribute, Tag.TITLE);
        checkAttributes(specAttr, HTML.Attribute.ENDTAG, Boolean.TRUE);
        checkImplicitContentSpec(spec);
    }
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.