Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.
package com.codename1.wordprocessing
Word-processing documents.
A Document is an immutable list of Blocks – Paragraphs of styled RichText,
Tables whose cells hold blocks of their own, and Pictures – laid out on a PageSpec.
A DocumentModel holds the current document of an editor, tells its DocumentListeners
when it is replaced and keeps the undo history, the way a com.codename1.ui.table.TableModel
backs a table.
Documents are read and written as Codename One .cn1doc files, plain text, HTML and
Markdown; see Document.Format.
Types
interface Block | One top-level unit of a Document’s body: a Paragraph, a Table or a Picture. |
class Comment | A review comment anchored to a range of the document: from an offset in one paragraph to an offset in the same or a later one. |
class Document | An immutable word-processing document: a list of Blocks (paragraphs, tables and pictures), the page they are laid out on and a title. |
class DocumentEditor | A DocumentView with its embedded components alive: each component box on screen holds a real Codename One component, made by the factory EmbeddedComponents has for its type, that the user can tap, drag and type into. |
class DocumentLayout | A document broken into pages: every line, table, picture and footnote placed, in points. |
interface DocumentListener | Notified when a DocumentModel’s document is replaced, by an edit, an undo or a redo. |
class DocumentModel | The editable state behind a document view: the current immutable Document, its listeners and its undo history. |
class DocumentView | Shows a document as pages and edits it, the way DataGrid shows and edits a Sheet. |
class EmbeddedComponent | A live Codename One component placed in a document’s text, such as a chart, a map, a button or a form. |
class EmbeddedComponents | The registry that turns an EmbeddedComponent – a type name and a state string in a document – into a live Codename One component, and back. |
class Field | A field: an instruction such as PAGE, DATE \@ "d MMMM yyyy" or =SUM(ABOVE) with the result it last produced. |
interface Inline | Content that sits inside a paragraph’s text and takes one character there, RichText.OBJECT: a Field, a Note reference, a Picture placed in the line, or an EmbeddedComponent. |
class LayoutItem | One thing drawn on a laid out page: a piece of text, a filled or stroked rectangle, a line, a picture or the box of an embedded component. |
class LayoutPage | One page of a DocumentLayout: its size and everything drawn on it, in painting order. |
interface Measurer | Measures text for DocumentLayout, in points. |
class Note | A footnote or endnote, placed in the text where its reference mark goes. |
class PageSpec | Immutable page geometry in points: paper size and the four margins. |
class Paragraph | An immutable paragraph: styled text plus the paragraph’s own layout. |
class PdfExport | Writes a laid out document as PDF, page for page as DocumentView shows it. |
class PdfMeasurer | Measures with the fonts a PDF is drawn in, so a document paginates identically on screen and on paper. |
class Picture | An immutable picture block: the original encoded image bytes, kept as they were read so a document written back carries the same image, plus its displayed size in points. |
class Revision | A tracked change on a run of text: who inserted or deleted it and when. |
class RichText | Immutable styled text: a sequence of runs, each a string with one TextStyle, and inline objects – fields, note references, pictures and embedded components – each of which takes exactly one character, OBJECT. |
class RichTextDocuments | Moves content between a RichTextArea and a Document, so the light editor and the paged one can work on the same text. |
class ScreenMeasurer | Measures text with the platform fonts DocumentView draws it in. |
class SectionBreak | Starts a new section: the blocks after it, up to the next break, are laid out on the page this break gives, with its margins, orientation and columns. |
class TabStop | A tab stop: where the text after a tab character lines up. |
class Table | An immutable table: a rectangular grid of cells, each holding its own blocks (paragraphs, pictures and nested tables), with optional merged ranges. |
class TableBinding | Keeps a table of a document and a live Sheet in step, so the table can be edited in a DataGrid with Excel formulas, sorting and a formula bar, and the document follows. |
class TableSheets | Moves tables between documents and spreadsheets, so a table’s numbers and formulas are calculated by the same engine as a Workbook’s. |
class TextPosition | A place between two characters of a paragraph: the caret position a point on a page maps to. |
class TextStyle | Immutable character formatting for a run of text. |