Package javax.swing.text.AbstractDocument

Examples of javax.swing.text.AbstractDocument.AttributeContext


        assertNotSame(reader1, reader2);
        assertNotSame(reader2, reader3);
    }

    public void testGetStyleSheet() {
        AttributeContext styleSheet = htmlDoc.getAttributeContextPublicly();
        assertTrue(styleSheet instanceof StyleSheet);
        assertSame(styleSheet, htmlDoc.getStyleSheet());
    }
View Full Code Here


     * Tests constructor.
     * Non-mutable (<code>StyleContext.SmallAttributeSet</code>) is passed
     * as parameter.
     */
    public void testOptionSmallAttrSet() {
        AttributeContext context = new StyleContext();
        attrs = context.addAttribute(context.getEmptySet(), "key", "value");

        item = new Option(attrs);
        final AttributeSet itAttrs = item.getAttributes();
        assertFalse(itAttrs instanceof MutableAttributeSet);
        assertTrue(itAttrs instanceof StyleContext.SmallAttributeSet);
View Full Code Here

    }

    public void testHTMLDocument() {
        htmlDoc = new PublicHTMLDocument();
        assertTrue(htmlDoc.getContentPublicly() instanceof GapContent);
        AttributeContext styleSheet = htmlDoc.getAttributeContextPublicly();
        assertTrue(styleSheet instanceof StyleSheet);
        final Enumeration styleNames = ((StyleSheet)styleSheet).getStyleNames();
        assertTrue(styleNames.hasMoreElements());
        assertEquals("default", styleNames.nextElement());
        assertFalse(styleNames.hasMoreElements());
View Full Code Here

        assertNotSame(reader1, reader2);
        assertNotSame(reader2, reader3);
    }

    public void testGetStyleSheet() {
        AttributeContext styleSheet = htmlDoc.getAttributeContextPublicly();
        assertTrue(styleSheet instanceof StyleSheet);
        assertSame(styleSheet, htmlDoc.getStyleSheet());
    }
View Full Code Here

     * Tests constructor.
     * Non-mutable (<code>StyleContext.SmallAttributeSet</code>) is passed
     * as parameter.
     */
    public void testOptionSmallAttrSet() {
        AttributeContext context = new StyleContext();
        attrs = context.addAttribute(context.getEmptySet(), "key", "value");

        item = new Option(attrs);
        final AttributeSet itAttrs = item.getAttributes();
        assertFalse(itAttrs instanceof MutableAttributeSet);
        assertTrue(itAttrs instanceof StyleContext.SmallAttributeSet);
View Full Code Here

TOP

Related Classes of javax.swing.text.AbstractDocument.AttributeContext

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.