public class SwingDocumentImport
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ELEMENT_STYLE_ATTRIBUTE |
static java.lang.String |
NAMESPACE |
static java.lang.String |
STYLESHEET |
static java.lang.String |
STYLESHEET_PCDATA |
static java.lang.String |
STYLESHEET_TYPE |
| Constructor and Description |
|---|
SwingDocumentImport() |
| Modifier and Type | Method and Description |
|---|---|
ConverterAttributeSet |
convertAttributes(javax.swing.text.AttributeSet attr,
javax.swing.text.Element context) |
protected java.lang.String |
getElementText(javax.swing.text.Element element)
Returns the text content of an element.
|
InputFeed |
getFeed() |
java.lang.String |
getNormalizedStyleName(java.lang.String name) |
protected void |
handleElement(javax.swing.text.Element element) |
static void |
main(java.lang.String[] args) |
void |
parseDocument(javax.swing.text.DefaultStyledDocument doc,
InputFeed feed) |
protected void |
processDocumentProperties(javax.swing.text.DefaultStyledDocument document)
Processes the document properties.
|
protected void |
processStyleElements(javax.swing.text.DefaultStyledDocument document)
Processes the style definitions of a styled document.
|
void |
setFeed(InputFeed feed) |
public static final java.lang.String NAMESPACE
public static final java.lang.String STYLESHEET_TYPE
public static final java.lang.String STYLESHEET_PCDATA
public static final java.lang.String STYLESHEET
public static final java.lang.String ELEMENT_STYLE_ATTRIBUTE
public InputFeed getFeed()
public void setFeed(InputFeed feed)
public java.lang.String getNormalizedStyleName(java.lang.String name)
public ConverterAttributeSet convertAttributes(javax.swing.text.AttributeSet attr, javax.swing.text.Element context) throws InputFeedException
InputFeedExceptionprotected void handleElement(javax.swing.text.Element element)
throws javax.swing.text.BadLocationException,
InputFeedException
javax.swing.text.BadLocationExceptionInputFeedExceptionprotected java.lang.String getElementText(javax.swing.text.Element element)
throws javax.swing.text.BadLocationException
element - The element containing text.javax.swing.text.BadLocationException - If the text position is invalid.protected void processStyleElements(javax.swing.text.DefaultStyledDocument document)
throws InputFeedException
document - The source document.InputFeedException - If a problem occured with the feed.protected void processDocumentProperties(javax.swing.text.DefaultStyledDocument document)
throws InputFeedException
document - The document source.InputFeedException - If a problem occured with the feed.public void parseDocument(javax.swing.text.DefaultStyledDocument doc,
InputFeed feed)
throws javax.swing.text.BadLocationException,
InputFeedException
javax.swing.text.BadLocationExceptionInputFeedExceptionpublic static void main(java.lang.String[] args)
throws java.io.IOException,
javax.swing.text.BadLocationException,
InputFeedException
java.io.IOExceptionjavax.swing.text.BadLocationExceptionInputFeedException