public class SHTMLDocument
extends javax.swing.text.html.HTMLDocument
HTMLDocument by a custom reader which supports
the SPAN tag.| Modifier and Type | Class and Description |
|---|---|
class |
SHTMLDocument.SHTMLReader
This reader extends HTMLDocument.HTMLReader by the capability
to handle SPAN tags
|
javax.swing.text.html.HTMLDocument.BlockElement, javax.swing.text.html.HTMLDocument.HTMLReader, javax.swing.text.html.HTMLDocument.Iterator, javax.swing.text.html.HTMLDocument.RunElementjavax.swing.text.DefaultStyledDocument.AttributeUndoableEdit, javax.swing.text.DefaultStyledDocument.ElementBuffer, javax.swing.text.DefaultStyledDocument.ElementSpec, javax.swing.text.DefaultStyledDocument.SectionElementjavax.swing.text.AbstractDocument.AbstractElement, javax.swing.text.AbstractDocument.AttributeContext, javax.swing.text.AbstractDocument.BranchElement, javax.swing.text.AbstractDocument.Content, javax.swing.text.AbstractDocument.DefaultDocumentEvent, javax.swing.text.AbstractDocument.ElementEdit, javax.swing.text.AbstractDocument.LeafElement| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
SUFFIX |
| Constructor and Description |
|---|
SHTMLDocument()
Constructs an SHTMLDocument.
|
SHTMLDocument(javax.swing.text.AbstractDocument.Content c,
javax.swing.text.html.StyleSheet styles)
Constructs an SHTMLDocument with the given content
storage implementation and the given style/attribute
storage mechanism.
|
SHTMLDocument(javax.swing.text.html.StyleSheet styles)
Constructs an SHTMLDocument with the default content
storage implementation and the given style/attribute
storage mechanism.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAttributes(javax.swing.text.Element e,
javax.swing.text.AttributeSet a)
apply a set of attributes to a given document element
|
void |
endCompoundEdit() |
protected void |
fireUndoableEditUpdate(javax.swing.event.UndoableEditEvent e) |
java.net.URL |
getBase() |
java.lang.String |
getDocumentTitle()
get the title of this SHTMLDocument
|
int |
getLastDocumentPosition() |
javax.swing.text.Element |
getParagraphElement(int pos) |
javax.swing.text.Element |
getParagraphElement(int pos,
boolean noPImplied)
Gets the current paragraph element, retracing out of p-implied if the parameter
noImplied is true.
|
javax.swing.text.html.HTMLEditorKit.ParserCallback |
getReader(int pos)
Fetches the reader for the parser to use to load the document
with HTML.
|
java.lang.String |
getStyleRef()
get the style sheet reference of the document in this
DocumentPane. |
boolean |
hasStyleRef()
check whether or not this SHTMLDocument has an explicit style sheet reference
|
void |
insertAfterEnd(javax.swing.text.Element elem,
java.lang.String htmlText) |
void |
insertAfterStart(javax.swing.text.Element elem,
java.lang.String htmlText) |
void |
insertBeforeEnd(javax.swing.text.Element elem,
java.lang.String htmlText) |
void |
insertBeforeStart(javax.swing.text.Element elem,
java.lang.String htmlText) |
void |
insertStyleRef()
insert a style sheet reference into the head of this SHTMLDocument
|
void |
removeElements(javax.swing.text.Element element,
int index,
int count)
Removes a consecutive group of child elements.
|
void |
removeParagraphAttributes(int offset,
int length) |
void |
replaceHTML(javax.swing.text.Element firstElement,
int number,
java.lang.String htmlText) |
void |
setBase(java.net.URL u) |
void |
setDocumentTitle(java.lang.String title)
set the title of this SHTMLDocument
|
void |
setOuterHTML(javax.swing.text.Element paragraphElement,
java.lang.String htmlText) |
void |
setParagraphAttributes(int offset,
int length,
javax.swing.text.AttributeSet s,
boolean replace) |
void |
startCompoundEdit() |
create, createBranchElement, createDefaultRoot, createLeafElement, fireChangedUpdate, getElement, getElement, getIterator, getParser, getPreservesUnknownTags, getReader, getStyleSheet, getTokenThreshold, insert, insertUpdate, processHTMLFrameHyperlinkEvent, setInnerHTML, setParser, setPreservesUnknownTags, setTokenThresholdaddDocumentListener, addStyle, getBackground, getCharacterElement, getDefaultRootElement, getFont, getForeground, getLogicalStyle, getStyle, getStyleNames, removeDocumentListener, removeElement, removeStyle, removeUpdate, setCharacterAttributes, setLogicalStyle, styleChangedaddUndoableEditListener, createPosition, dump, fireInsertUpdate, fireRemoveUpdate, getAsynchronousLoadPriority, getAttributeContext, getBidiRootElement, getContent, getCurrentWriter, getDocumentFilter, getDocumentListeners, getDocumentProperties, getEndPosition, getLength, getListeners, getProperty, getRootElements, getStartPosition, getText, getText, getUndoableEditListeners, insertString, postRemoveUpdate, putProperty, readLock, readUnlock, remove, removeUndoableEditListener, render, replace, setAsynchronousLoadPriority, setDocumentFilter, setDocumentProperties, writeLock, writeUnlockpublic static final java.lang.String SUFFIX
public SHTMLDocument()
public SHTMLDocument(javax.swing.text.html.StyleSheet styles)
styles - the stylespublic SHTMLDocument(javax.swing.text.AbstractDocument.Content c,
javax.swing.text.html.StyleSheet styles)
c - the container for the contentstyles - the stylespublic void addAttributes(javax.swing.text.Element e,
javax.swing.text.AttributeSet a)
e - the element to apply attributes toa - the set of attributes to applypublic void removeElements(javax.swing.text.Element element,
int index,
int count)
throws javax.swing.text.BadLocationException
element - the parent element to remove child elements fromindex - the index of the first child element to removecount - the number of child elements to removejavax.swing.text.BadLocationExceptionpublic void setOuterHTML(javax.swing.text.Element paragraphElement,
java.lang.String htmlText)
throws javax.swing.text.BadLocationException,
java.io.IOException
setOuterHTML in class javax.swing.text.html.HTMLDocumentjavax.swing.text.BadLocationExceptionjava.io.IOExceptionpublic void insertAfterEnd(javax.swing.text.Element elem,
java.lang.String htmlText)
throws javax.swing.text.BadLocationException,
java.io.IOException
insertAfterEnd in class javax.swing.text.html.HTMLDocumentjavax.swing.text.BadLocationExceptionjava.io.IOExceptionpublic void insertAfterStart(javax.swing.text.Element elem,
java.lang.String htmlText)
throws javax.swing.text.BadLocationException,
java.io.IOException
insertAfterStart in class javax.swing.text.html.HTMLDocumentjavax.swing.text.BadLocationExceptionjava.io.IOExceptionpublic void insertBeforeEnd(javax.swing.text.Element elem,
java.lang.String htmlText)
throws javax.swing.text.BadLocationException,
java.io.IOException
insertBeforeEnd in class javax.swing.text.html.HTMLDocumentjavax.swing.text.BadLocationExceptionjava.io.IOExceptionpublic void insertBeforeStart(javax.swing.text.Element elem,
java.lang.String htmlText)
throws javax.swing.text.BadLocationException,
java.io.IOException
insertBeforeStart in class javax.swing.text.html.HTMLDocumentjavax.swing.text.BadLocationExceptionjava.io.IOExceptionpublic void replaceHTML(javax.swing.text.Element firstElement,
int number,
java.lang.String htmlText)
throws javax.swing.text.BadLocationException,
java.io.IOException
javax.swing.text.BadLocationExceptionjava.io.IOExceptionpublic void startCompoundEdit()
public void endCompoundEdit()
protected void fireUndoableEditUpdate(javax.swing.event.UndoableEditEvent e)
fireUndoableEditUpdate in class javax.swing.text.html.HTMLDocumentpublic void setDocumentTitle(java.lang.String title)
title - the title this document shall havepublic java.lang.String getDocumentTitle()
public void insertStyleRef()
public boolean hasStyleRef()
public java.lang.String getStyleRef()
DocumentPane.public javax.swing.text.html.HTMLEditorKit.ParserCallback getReader(int pos)
getReader in class javax.swing.text.html.HTMLDocumentpublic javax.swing.text.Element getParagraphElement(int pos)
getParagraphElement in interface javax.swing.text.StyledDocumentgetParagraphElement in class javax.swing.text.DefaultStyledDocumentpublic javax.swing.text.Element getParagraphElement(int pos,
boolean noPImplied)
DefaultStyledDocument.getParagraphElement(int)public int getLastDocumentPosition()
public void setParagraphAttributes(int offset,
int length,
javax.swing.text.AttributeSet s,
boolean replace)
setParagraphAttributes in interface javax.swing.text.StyledDocumentsetParagraphAttributes in class javax.swing.text.html.HTMLDocumentpublic void removeParagraphAttributes(int offset,
int length)
public java.net.URL getBase()
getBase in class javax.swing.text.html.HTMLDocumentpublic void setBase(java.net.URL u)
setBase in class javax.swing.text.html.HTMLDocument