Examples of ElementSpec


Examples of javax.swing.text.DefaultStyledDocument.ElementSpec

        reader.blockClose(Tag.B);
        assertEquals(6, reader.parseBuffer.size());
        assertEquals(0, reader.charAttr.getAttributeCount());
       
        ElementSpec spec = (ElementSpec)reader.parseBuffer.get(0);
        assertSpec(spec, ElementSpec.StartTagType, ElementSpec.OriginateDirection, 0, null);
        AttributeSet specAttr = spec.getAttributes();
        assertEquals(2, specAttr.getAttributeCount());
        checkAttributes(specAttr, StyleConstants.NameAttribute, Tag.B);
       
        spec = (ElementSpec)reader.parseBuffer.get(1);
        specAttr = spec.getAttributes();
        assertSpec(spec, ElementSpec.StartTagType, ElementSpec.OriginateDirection, 0, null);
        assertEquals(2, specAttr.getAttributeCount());
        checkAttributes(specAttr, StyleConstants.NameAttribute, Tag.IMPLIED);
        checkAttributes(specAttr, "aaaa", "bbbb");
       
        spec = (ElementSpec)reader.parseBuffer.get(2);
        checkOpenImpliedSpec(spec);
       
        spec = (ElementSpec)reader.parseBuffer.get(3);
        specAttr = spec.getAttributes();
        assertSpec(spec, ElementSpec.ContentType, ElementSpec.OriginateDirection, 0, new char[] {'\n'});
        assertEquals(2, specAttr.getAttributeCount());
        checkAttributes(specAttr, StyleConstants.NameAttribute, Tag.CONTENT);
        checkAttributes(specAttr, "CR", Boolean.TRUE);
       
View Full Code Here

Examples of javax.swing.text.DefaultStyledDocument.ElementSpec

        reader.blockClose(Tag.IMPLIED);
        assertEquals(6, reader.parseBuffer.size());
        assertEquals(0, reader.charAttr.getAttributeCount());
       
        ElementSpec spec = (ElementSpec)reader.parseBuffer.get(0);
        assertSpec(spec, ElementSpec.StartTagType, ElementSpec.OriginateDirection, 0, null);
        AttributeSet specAttr = spec.getAttributes();
        assertEquals(2, specAttr.getAttributeCount());
        checkAttributes(specAttr, StyleConstants.NameAttribute, Tag.TITLE);
       
        spec = (ElementSpec)reader.parseBuffer.get(1);
        specAttr = spec.getAttributes();
        assertSpec(spec, ElementSpec.StartTagType, ElementSpec.OriginateDirection, 0, null);
        assertEquals(2, specAttr.getAttributeCount());
        checkAttributes(specAttr, StyleConstants.NameAttribute, Tag.IMPLIED);
        checkAttributes(specAttr, "aaaa", "bbbb");
       
        spec = (ElementSpec)reader.parseBuffer.get(2);
        checkOpenImpliedSpec(spec);
       
        spec = (ElementSpec)reader.parseBuffer.get(3);
        specAttr = spec.getAttributes();
        assertSpec(spec, ElementSpec.ContentType, ElementSpec.OriginateDirection, 0, new char[] {'\n'});
        assertEquals(2, specAttr.getAttributeCount());
        checkAttributes(specAttr, StyleConstants.NameAttribute, Tag.CONTENT);
        checkAttributes(specAttr, "CR", Boolean.TRUE);
       
View Full Code Here

Examples of javax.swing.text.DefaultStyledDocument.ElementSpec

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

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

Examples of javax.swing.text.DefaultStyledDocument.ElementSpec

       
        reader.blockClose(Tag.IMPLIED);
        assertEquals(5, reader.parseBuffer.size());
        assertEquals(1, reader.charAttr.getAttributeCount());
       
        ElementSpec spec = (ElementSpec)reader.parseBuffer.get(0);
        assertSpec(spec, ElementSpec.StartTagType, ElementSpec.OriginateDirection, 0, null);
        AttributeSet specAttr = spec.getAttributes();
        assertEquals(2, specAttr.getAttributeCount());
        checkAttributes(specAttr, StyleConstants.NameAttribute, Tag.IMPLIED);
        checkAttributes(specAttr, "aaaa", "bbbb");
       
        spec = (ElementSpec)reader.parseBuffer.get(1);
        checkOpenImpliedSpec(spec);
       
        spec = (ElementSpec)reader.parseBuffer.get(2);
        assertSpec(spec, ElementSpec.ContentType, ElementSpec.OriginateDirection, 0, text.toCharArray());
        specAttr = spec.getAttributes();
        assertEquals(1, specAttr.getAttributeCount());
        checkAttributes(specAttr, StyleConstants.NameAttribute, Tag.CONTENT);
       
        spec = (ElementSpec)reader.parseBuffer.get(3);
        assertSpec(spec, ElementSpec.ContentType, ElementSpec.OriginateDirection, 0, new char[] {'\n'});
        specAttr = spec.getAttributes();
        assertEquals(2, specAttr.getAttributeCount());
        checkAttributes(specAttr, StyleConstants.NameAttribute, Tag.CONTENT);
        checkAttributes(specAttr, "CR", Boolean.TRUE);
       
        spec = (ElementSpec)reader.parseBuffer.get(4);
View Full Code Here

Examples of javax.swing.text.DefaultStyledDocument.ElementSpec

        reader.preContent(text.toCharArray());
        assertEquals(2, reader.charAttr.getAttributeCount());
        checkAttributes(reader.charAttr, StyleConstants.NameAttribute, Tag.CONTENT);
        assertEquals(2, reader.parseBuffer.size());
       
        ElementSpec spec = (ElementSpec)reader.parseBuffer.get(0);
        checkOpenImpliedSpec(spec);

        spec = (ElementSpec)reader.parseBuffer.get(1);
        assertSpec(spec, ElementSpec.ContentType, ElementSpec.OriginateDirection, 0, text.toCharArray());
        assertEquals(2, spec.getAttributes().getAttributeCount());
        checkAttributes(spec.getAttributes(), "aaaa", "bbbb");
        checkAttributes(spec.getAttributes(), StyleConstants.NameAttribute, Tag.CONTENT);
        assertFalse(createMarker.isOccurred());
        assertFalse(insertMarker.isOccurred());
    }
View Full Code Here

Examples of javax.swing.text.DefaultStyledDocument.ElementSpec

        String text1 = "data";
        String text2 = "atada";
        reader.handleStartTag(Tag.TEXTAREA, attr, 0);
        assertEquals(0, reader.charAttr.getAttributeCount());
        assertEquals(2, reader.parseBuffer.size());
        ElementSpec spec = (ElementSpec)reader.parseBuffer.get(1);
        assertSpec(spec, ElementSpec.ContentType, ElementSpec.OriginateDirection, 0, new char[] {' '});
        assertEquals(2, spec.getAttributes().getAttributeCount());
        checkAttributes(spec.getAttributes(), StyleConstants.NameAttribute, Tag.TEXTAREA);
        Object contentModel = spec.getAttributes().getAttribute(StyleConstants.ModelAttribute);
        assertNotNull(contentModel);
        assertTrue(contentModel instanceof PlainDocument);
        final PlainDocument plainDocument = (PlainDocument)contentModel;
        assertEquals("", plainDocument.getText(0, plainDocument.getLength()));
        reader.parseBuffer.add(new ElementSpec(null, ElementSpec.EndTagType));
        assertEquals(3, reader.parseBuffer.size());
       
        reader.textAreaContent(text1.toCharArray());
        assertEquals(0, reader.charAttr.getAttributeCount());
        assertEquals(3, reader.parseBuffer.size());
View Full Code Here

Examples of javax.swing.text.DefaultStyledDocument.ElementSpec

        attr.addAttribute("aaaa", "bbbb");
        action = reader.new FormAction();
        action.start(Tag.SELECT, attr);
        action.start(Tag.OPTION, attr);
       
        ElementSpec spec = (ElementSpec)reader.parseBuffer.get(1);
        final AttributeSet specAttr = spec.getAttributes();
        assertEquals(3, specAttr.getAttributeCount());
        assertSpec(spec, ElementSpec.ContentType, ElementSpec.OriginateDirection, 0, new char[] {' '});
        Object contentModel = specAttr.getAttribute(StyleConstants.ModelAttribute);
        assertNotNull(contentModel);
        assertTrue(contentModel instanceof DefaultComboBoxModel);
View Full Code Here

Examples of javax.swing.text.DefaultStyledDocument.ElementSpec

        attr.addAttribute("aaaa", "bbbb");
        action = reader.new FormAction();
        action.start(Tag.SELECT, attr);
        action.start(Tag.OPTION, attr);
       
        ElementSpec spec = (ElementSpec)reader.parseBuffer.get(1);
        final AttributeSet specAttr = spec.getAttributes();
        assertEquals(4, specAttr.getAttributeCount());
        assertSpec(spec, ElementSpec.ContentType, ElementSpec.OriginateDirection, 0, new char[] {' '});
        Object contentModel = specAttr.getAttribute(StyleConstants.ModelAttribute);
        assertNotNull(contentModel);
        assertTrue(contentModel instanceof DefaultListModel);
View Full Code Here

Examples of javax.swing.text.DefaultStyledDocument.ElementSpec

        String text = "text";
        SimpleAttributeSet attr = new SimpleAttributeSet();
        attr.addAttribute("aaaa", "bbbb");
        action = reader.new FormAction();
        action.start(Tag.SELECT, attr);
        ElementSpec spec = (ElementSpec)reader.parseBuffer.get(1);
        final AttributeSet specAttr = spec.getAttributes();
        assertNotSame(specAttr, attr);
    }
View Full Code Here

Examples of javax.swing.text.DefaultStyledDocument.ElementSpec

        String text = "text";
        SimpleAttributeSet attr = new SimpleAttributeSet();
        attr.addAttribute("aaaa", "bbbb");
        action = reader.new FormAction();
        action.start(Tag.SELECT, attr);
        ElementSpec spec = (ElementSpec)reader.parseBuffer.get(1);
        final AttributeSet specAttr = spec.getAttributes();
        assertEquals(3, specAttr.getAttributeCount());
        assertSpec(spec, ElementSpec.ContentType, ElementSpec.OriginateDirection, 0, new char[] {' '});
        Object contentModel = specAttr.getAttribute(StyleConstants.ModelAttribute);
        assertNotNull(contentModel);
        assertTrue(contentModel instanceof DefaultComboBoxModel);
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.