本文整理汇总了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());
}
示例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());
}
示例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));
}
示例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));
}
示例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);
}
示例6: IntegerDocument
import javax.swing.text.GapContent; //导入依赖的package包/类
public IntegerDocument() {
this(new GapContent(), 10);
}
示例7: StringDocument
import javax.swing.text.GapContent; //导入依赖的package包/类
public StringDocument() {
this(new GapContent(), null);
}
示例8: DecimalDocument
import javax.swing.text.GapContent; //导入依赖的package包/类
public DecimalDocument() {
this(new GapContent(), 15, 5);
}
示例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());
}
示例10: PublicHTMLDocument
import javax.swing.text.GapContent; //导入依赖的package包/类
public PublicHTMLDocument(final GapContent content, final StyleSheet styles) {
super(content, styles);
}
示例11: JifDocument
import javax.swing.text.GapContent; //导入依赖的package包/类
public JifDocument(InformContext styles) {
this(new GapContent(BUFFER_SIZE_DEFAULT), (StyleContext)styles);
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}