Class RichTextImporter

java.lang.Object
com.codename1.ui.editor.RichTextImporter

public final class RichTextImporter extends Object
Parses supported rich-text interchange formats into the shared editor model. HTML delegates to the framework HTML/XML parser; Markdown and RTF are read by com.codename1.wordprocessing, the one implementation of each in the framework; AsciiDoc is parsed here.
  • Method Details

    • parse

      public static HtmlImporter.Result parse(String content, RichTextFormat format)
      Parses rich text into the editor model. AsciiDoc is built directly; Markdown and RTF come through the word processing readers.
    • fromHtml

      public static String fromHtml(String html, RichTextFormat format)
      Converts HTML produced by a browser fallback into another rich-text format through the shared document model. Pure editors do not use this path for Markdown or AsciiDoc input.
    • convert

      public static String convert(String content, RichTextFormat sourceFormat, RichTextFormat targetFormat)
      Converts between non-HTML formats through the native rich-text model. This preserves source mode in browser fallbacks without using HTML as an intermediate representation.
    • toHtml

      public static String toHtml(String content, RichTextFormat format)
      Converts content to an HTML fragment. HTML input is returned unchanged and plain text is escaped.