Class SwingDocumentImport


  • public class SwingDocumentImport
    extends java.lang.Object
    Right now, we do not convert Swing-styles into CSS styles. Hey, we should, but we don't.

    todo parse styles

    • Constructor Detail

      • SwingDocumentImport

        public SwingDocumentImport()
    • Method Detail

      • setFeed

        public void setFeed​(InputFeed feed)
      • getNormalizedStyleName

        public java.lang.String getNormalizedStyleName​(java.lang.String name)
      • handleElement

        protected void handleElement​(javax.swing.text.Element element)
                              throws javax.swing.text.BadLocationException,
                                     InputFeedException
        Throws:
        javax.swing.text.BadLocationException
        InputFeedException
      • getElementText

        protected java.lang.String getElementText​(javax.swing.text.Element element)
                                           throws javax.swing.text.BadLocationException
        Returns the text content of an element.
        Parameters:
        element - The element containing text.
        Returns:
        The text.
        Throws:
        javax.swing.text.BadLocationException - If the text position is invalid.
      • processStyleElements

        protected void processStyleElements​(javax.swing.text.DefaultStyledDocument document)
                                     throws InputFeedException
        Processes the style definitions of a styled document. Style definitions are declared once in the document and are reused by styled elements.
        Parameters:
        document - The source document.
        Throws:
        InputFeedException - If a problem occured with the feed.
      • processDocumentProperties

        protected void processDocumentProperties​(javax.swing.text.DefaultStyledDocument document)
                                          throws InputFeedException
        Processes the document properties. These properties defined once for the whole document.
        Parameters:
        document - The document source.
        Throws:
        InputFeedException - If a problem occured with the feed.
      • parseDocument

        public void parseDocument​(javax.swing.text.DefaultStyledDocument doc,
                                  InputFeed feed)
                           throws javax.swing.text.BadLocationException,
                                  InputFeedException
        Throws:
        javax.swing.text.BadLocationException
        InputFeedException
      • main

        public static void main​(java.lang.String[] args)
                         throws java.io.IOException,
                                javax.swing.text.BadLocationException,
                                InputFeedException
        Throws:
        java.io.IOException
        javax.swing.text.BadLocationException
        InputFeedException