public void testPlainDocumentContent() { doc = new PlainDocument(new GapContent(30)); Content content = doc.getContent(); assertTrue(content instanceof GapContent); GapContent gapContent = (GapContent) content; assertEquals(29, gapContent.getGapEnd() - gapContent.getGapStart()); Object tabSize = doc.getProperty(PlainDocument.tabSizeAttribute); assertEquals(8, ((Integer) tabSize).intValue()); assertNull(doc.getProperty(PlainDocument.lineLimitAttribute)); assertNotNull(doc.getDefaultRootElement()); }
public void testPlainDocument() { doc = new PlainDocument(); Content content = doc.getContent(); assertTrue(content instanceof GapContent); GapContent gapContent = (GapContent) content; assertEquals(9, gapContent.getGapEnd() - gapContent.getGapStart()); Object tabSize = doc.getProperty(PlainDocument.tabSizeAttribute); assertEquals(8, ((Integer) tabSize).intValue()); assertNull(doc.getProperty(PlainDocument.lineLimitAttribute)); assertNotNull(doc.getDefaultRootElement()); }
public void testHTMLDocumentStyleSheet() throws BadLocationException, MalformedURLException { StyleSheet styles = new StyleSheet(); htmlDoc = new PublicHTMLDocument(styles); assertSame(styles, htmlDoc.getAttributeContextPublicly()); final Content content = htmlDoc.getContentPublicly(); assertTrue(content instanceof GapContent); URL u1 = new URL("http://www.apache.org"); styles.setBase(u1); htmlDoc = new PublicHTMLDocument(styles); assertNull(htmlDoc.getBase()); }
/** * Constructor */ public AntDocument(AbstractDocument.Content content) { super(content); isModified = false; insertMode = true; }