当前位置: 首页>>代码示例>>Java>>正文


Java GapContent类代码示例

本文整理汇总了Java中javax.swing.text.GapContent的典型用法代码示例。如果您正苦于以下问题:Java GapContent类的具体用法?Java GapContent怎么用?Java GapContent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


GapContent类属于javax.swing.text包,在下文中一共展示了GapContent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testHTMLDocumentContentStyleSheet

import javax.swing.text.GapContent; //导入依赖的package包/类
public void testHTMLDocumentContentStyleSheet() throws MalformedURLException {
    StyleSheet styles = new StyleSheet();
    final GapContent gapContent = new GapContent(10);
    htmlDoc = new PublicHTMLDocument(gapContent, styles);
    assertSame(styles, htmlDoc.getAttributeContextPublicly());
    assertSame(gapContent, htmlDoc.getContentPublicly());

    URL u1 = new URL("http://www.apache.org");
    styles.setBase(u1);
    htmlDoc = new PublicHTMLDocument(gapContent, styles);
    assertNull(htmlDoc.getBase());
}
 
开发者ID:shannah,项目名称:cn1,代码行数:13,代码来源:HTMLDocumentTest.java

示例2: testHTMLDocumentStyleSheet

import javax.swing.text.GapContent; //导入依赖的package包/类
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());
}
 
开发者ID:shannah,项目名称:cn1,代码行数:13,代码来源:HTMLDocumentTest.java

示例3: testHTMLDocument

import javax.swing.text.GapContent; //导入依赖的package包/类
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());
    final Style style = ((StyleSheet)styleSheet).getStyle("default");
    assertEquals(1, style.getAttributeCount());
    assertEquals("default", style.getAttribute(StyleConstants.NameAttribute));
}
 
开发者ID:shannah,项目名称:cn1,代码行数:14,代码来源:HTMLDocumentTest.java

示例4: ServerDocumentImpl

import javax.swing.text.GapContent; //导入依赖的package包/类
/**
 * Creates a new ServerDocumentImpl instance.
 */
public ServerDocumentImpl(RemoteUserProxy publisher) {
	super(new GapContent());
	defaultRoot = (BranchElement) createDefaultRoot();
	addParticipant(0, publisher);
	setCaretHandler(0, new CaretHandler(0, 0));
}
 
开发者ID:forgeide,项目名称:forgeide,代码行数:10,代码来源:ServerDocumentImpl.java

示例5: fromField

import javax.swing.text.GapContent; //导入依赖的package包/类
static ContentTextBuilder fromField(Instance instance, String field, Heap heap) {
    Object model = instance.getValueOfField(field);
    if (!(model instanceof Instance)) return null;
    if (!DetailsUtils.isSubclassOf((Instance)model, GapContent.class.getName())) return null;
    return new ContentTextBuilder((Instance)model, heap);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:7,代码来源:TextComponentBuilders.java

示例6: IntegerDocument

import javax.swing.text.GapContent; //导入依赖的package包/类
public IntegerDocument() {
	this(new GapContent(), 10);
}
 
开发者ID:cams7,项目名称:erp,代码行数:4,代码来源:IntegerDocument.java

示例7: StringDocument

import javax.swing.text.GapContent; //导入依赖的package包/类
public StringDocument() {
	this(new GapContent(), null);
}
 
开发者ID:cams7,项目名称:erp,代码行数:4,代码来源:StringDocument.java

示例8: DecimalDocument

import javax.swing.text.GapContent; //导入依赖的package包/类
public DecimalDocument() {
	this(new GapContent(), 15, 5);
}
 
开发者ID:cams7,项目名称:erp,代码行数:4,代码来源:DecimalDocument.java

示例9: HTMLDocument

import javax.swing.text.GapContent; //导入依赖的package包/类
/**
 * Constructs an HTML document using the default buffer size and a default
 * StyleSheet.
 */
public HTMLDocument()
{
  this(new GapContent(BUFFER_SIZE_DEFAULT), new StyleSheet());
}
 
开发者ID:vilie,项目名称:javify,代码行数:9,代码来源:HTMLDocument.java

示例10: PublicHTMLDocument

import javax.swing.text.GapContent; //导入依赖的package包/类
public PublicHTMLDocument(final GapContent content, final StyleSheet styles) {
    super(content, styles);
}
 
开发者ID:shannah,项目名称:cn1,代码行数:4,代码来源:HTMLDocumentTestCase.java

示例11: JifDocument

import javax.swing.text.GapContent; //导入依赖的package包/类
public JifDocument(InformContext styles) {
    this(new GapContent(BUFFER_SIZE_DEFAULT), (StyleContext)styles);
}
 
开发者ID:silverslade,项目名称:jif,代码行数:4,代码来源:JifDocument.java

示例12: XMLDocument

import javax.swing.text.GapContent; //导入依赖的package包/类
/**
 * Constructs the XML Document with a new GapContent buffer.
 * 
 * @param editor the editor component.
 */
public XMLDocument( JEditorPane editor) {
    super( new GapContent( 1024));
    
    this.editor = editor;
}
 
开发者ID:huajun2013,项目名称:ablaze,代码行数:11,代码来源:XMLDocument.java

示例13: JifProjectDocument

import javax.swing.text.GapContent; //导入依赖的package包/类
/**
 * Constructs a JifProject document with the default content storage
 * implementation and a shared set of styles for syntax highlighting.
 * 
 * @param styles
 *            the set of styles for Inform syntax highlighting
 */
protected JifProjectDocument(StyleContext styles) {
    this(new GapContent(BUFFER_SIZE_DEFAULT), styles);
}
 
开发者ID:silverslade,项目名称:jif,代码行数:11,代码来源:JifProjectDocument.java

示例14: ResourceDocument

import javax.swing.text.GapContent; //导入依赖的package包/类
/**
 * Constructs a Resource document with the default content storage
 * implementation and a shared set of styles for syntax highlighting.
 * 
 * @param styles
 *            the set of styles for Inform syntax highlighting
 */
protected ResourceDocument(StyleContext styles) {
    this(new GapContent(BUFFER_SIZE_DEFAULT), styles);
}
 
开发者ID:silverslade,项目名称:jif,代码行数:11,代码来源:ResourceDocument.java

示例15: JifConfigurationDocument

import javax.swing.text.GapContent; //导入依赖的package包/类
/**
 * Constructs a JifConfiguration document with the default content storage
 * implementation and a shared set of styles for syntax highlighting.
 * 
 * @param styles
 *            the set of styles for Inform syntax highlighting
 */
protected JifConfigurationDocument(StyleContext styles) {
    this(new GapContent(BUFFER_SIZE_DEFAULT), styles);
}
 
开发者ID:silverslade,项目名称:jif,代码行数:11,代码来源:JifConfigurationDocument.java


注:本文中的javax.swing.text.GapContent类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。