Class SwingLogHandler

java.lang.Object
java.util.logging.Handler
io.github.olyutorskii.quetexj.SwingLogHandler

public class SwingLogHandler extends Handler
Log handler for Swing text component model(Document).

Logging is supported from both EDT(Event-Dispatch-Thread) and non-EDT.

  • Constructor Details

    • SwingLogHandler

      public SwingLogHandler()
      Constructor.

      PlainDocument is prepared.

    • SwingLogHandler

      public SwingLogHandler(Document document)
      Constructor.

      Do not access document via non-EDT.

      Parameters:
      document - Document model of Swing text component.
  • Method Details

    • getDocument

      public Document getDocument()
      Return associated document.

      Do not access document via non-EDT.

      Returns:
      document
    • publish

      public void publish(LogRecord logRec)

      This is thread-safe.

      Specified by:
      publish in class Handler
      Parameters:
      logRec -
    • flush

      public void flush()
      Specified by:
      flush in class Handler
    • close

      public void close() throws SecurityException
      Specified by:
      close in class Handler