Java 类javax.swing.text.AbstractDocument.Content 实例源码

项目:cn1    文件:PlainDocumentTest.java   
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());
}
项目:cn1    文件:PlainDocumentTest.java   
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());
}
项目:cn1    文件:HTMLDocumentTest.java   
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());
}
项目:freeVM    文件:PlainDocumentTest.java   
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());
}
项目:freeVM    文件:PlainDocumentTest.java   
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());
}
项目:freeVM    文件:HTMLDocumentTest.java   
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());
}
项目:freeVM    文件:PlainDocumentTest.java   
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());
}
项目:freeVM    文件:PlainDocumentTest.java   
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());
}
项目:freeVM    文件:HTMLDocumentTest.java   
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());
}
项目:AntIDE    文件:AntDocument.java   
/**
*  Constructor
*/
public AntDocument(AbstractDocument.Content content) {
  super(content);
  isModified = false;
  insertMode = true;
}