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()); }
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()); }
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)); }
/** * Creates a new ServerDocumentImpl instance. */ public ServerDocumentImpl(RemoteUserProxy publisher) { super(new GapContent()); defaultRoot = (BranchElement) createDefaultRoot(); addParticipant(0, publisher); setCaretHandler(0, new CaretHandler(0, 0)); }
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); }
public IntegerDocument() { this(new GapContent(), 10); }
public IntegerDocument(final int size) { this(new GapContent(), size); }
public StringDocument() { this(new GapContent(), null); }
public StringDocument(final int size) { this(new GapContent(), size); }
public StringDocument(final String mask) { this(new GapContent(), new Mask(mask)); }
public StringDocument(final Mask mask) { this(new GapContent(), mask); }
public DecimalDocument() { this(new GapContent(), 15, 5); }
public DecimalDocument(final int size, final int precision) { this(new GapContent(), size, precision); }
/** * Constructs an HTML document using the default buffer size and a default * StyleSheet. */ public HTMLDocument() { this(new GapContent(BUFFER_SIZE_DEFAULT), new StyleSheet()); }
public PublicHTMLDocument(final GapContent content, final StyleSheet styles) { super(content, styles); }
public JifDocument(InformContext styles) { this(new GapContent(BUFFER_SIZE_DEFAULT), (StyleContext)styles); }
public JifDocument() { this(new GapContent(BUFFER_SIZE_DEFAULT), (StyleContext) new InformContext()); }
/** * 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; }
/** * Constructs an HTML document with the default content storage * implementation and the specified style/attribute storage mechanism. * * @param styles - the style sheet */ public HTMLDocument(StyleSheet styles) { this(new GapContent(BUFFER_SIZE_DEFAULT), styles); }
/** * 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); }
/** * Constructs a JifProject document with the default content storage * implementation and a default set of styles for syntax highlighting. * */ public JifProjectDocument() { this(new GapContent(BUFFER_SIZE_DEFAULT), (StyleContext) new InformContext()); }
/** * 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); }
/** * Constructs a Resource document with the default content storage * implementation and a default set of styles for syntax highlighting. * */ public ResourceDocument() { this(new GapContent(BUFFER_SIZE_DEFAULT), (StyleContext) new InformContext()); }
/** * 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); }
/** * Constructs a JifConfiguration document with the default content storage * implementation and a default set of styles for syntax highlighting. * */ public JifConfigurationDocument() { this(new GapContent(BUFFER_SIZE_DEFAULT), (StyleContext) new InformContext()); }
/** * Constructs an Inform 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 InformDocument(StyleContext styles) { this(new GapContent(BUFFER_SIZE_DEFAULT), styles); }
/** * Constructs an Inform document with the default content storage * implementation and a default set of styles for syntax highlighting. * */ public InformDocument() { this(new GapContent(BUFFER_SIZE_DEFAULT), (StyleContext) new InformContext()); }