Class MarkdownTextPane

  • All Implemented Interfaces:
    adams.gui.core.TextPaneComponent, ImageObserver, MenuContainer, Serializable, Accessible

    public class MarkdownTextPane
    extends adams.gui.core.BasePanel
    implements adams.gui.core.TextPaneComponent
    Renders Markdown text.
    Version:
    $Revision$
    Author:
    FracPete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_Processor

        protected org.markdownj.MarkdownProcessor m_Processor
        the markdown processor.
      • m_Markdown

        protected String m_Markdown
        the markdown text.
      • m_PaneView

        protected adams.gui.core.BaseHtmlEditorPane m_PaneView
        for rendering the markdown.
    • Constructor Detail

      • MarkdownTextPane

        public MarkdownTextPane()
    • Method Detail

      • initialize

        protected void initialize()
        Initializes the members.
        Overrides:
        initialize in class adams.gui.core.BasePanel
      • initGUI

        protected void initGUI()
        Initializes the widgets.
        Overrides:
        initGUI in class adams.gui.core.BasePanel
      • setText

        public void setText​(String value)
        Sets the Markdown text and renders it.
        Specified by:
        setText in interface adams.gui.core.TextPaneComponent
        Parameters:
        value - the markdown text
      • getText

        public String getText()
        Returns the Markdown text.
        Specified by:
        getText in interface adams.gui.core.TextPaneComponent
        Returns:
        the markdown text
      • getSelectedText

        public String getSelectedText()
        Specified by:
        getSelectedText in interface adams.gui.core.TextPaneComponent
      • setEditable

        public void setEditable​(boolean value)
        Sets whether the text pane is editable or not.
        Specified by:
        setEditable in interface adams.gui.core.TextPaneComponent
        Parameters:
        value - if true the text pane is editable
      • isEditable

        public boolean isEditable()
        Returns whether the text pane is editable or not.
        Specified by:
        isEditable in interface adams.gui.core.TextPaneComponent
        Returns:
        true if the text pane is editable
      • getDocument

        public Document getDocument()
        Returns the underlying document.
        Specified by:
        getDocument in interface adams.gui.core.TextPaneComponent
        Returns:
        the document
      • setCaretPosition

        public void setCaretPosition​(int value)
        Sets the position of the cursor.
        Specified by:
        setCaretPosition in interface adams.gui.core.TextPaneComponent
        Parameters:
        value - the position
      • getCaretPosition

        public int getCaretPosition()
        Returns the current position of the cursor.
        Specified by:
        getCaretPosition in interface adams.gui.core.TextPaneComponent
        Returns:
        the cursor position
      • setCaretPositionLast

        public void setCaretPositionLast()
        Sets the position of the cursor at the end.
        Specified by:
        setCaretPositionLast in interface adams.gui.core.TextPaneComponent
      • main

        public static void main​(String[] args)
        For testing only.
        Parameters:
        args - ignored