public class PureEditor
- Object
- PureEditor
Known subtypesCodePureEditor, RichPureEditor
The pure Codename One editor backend. It owns an EditorView and translates the semantic
command / query vocabulary spoken by RichTextArea and CodeEditor (the same strings the
BrowserComponent backend understands) into operations on the pure text engine.
This base class handles the shared, plain text portion of the vocabulary. The rich text and code
feature layers subclass it (and subclass EditorView) to add styling, syntax highlighting, the
gutter, completion and diagnostics.
Constructors
public PureEditor(EditorHost host, String editorType) | Creates a pure editor backend. |
Methods
protected EditorView createView(EditorHost host, boolean codeMode) | Creates the editor view. |
public Component getView() | Returns the editing surface component to place in the editor container. |
protected EditorView view() | Returns the underlying editor view. |
protected boolean isCodeMode() | True for a code editor backend. |
public void cmd(String name, String arg) | Executes a one way command. |
public String query(String name, String arg) | Executes a query returning a string result. |
Inherited methods
Constructor details
PureEditor
public PureEditor(EditorHost host, String editorType)Creates a pure editor backend.
Parameters
hostEditorHost- the bridge to the owning editor component
editorTypeString"code"or"richtext"
Method details
createView
protected EditorView createView(EditorHost host, boolean codeMode)Creates the editor view. Subclasses override to supply a code or rich text view.
getView
public Component getView()Returns the editing surface component to place in the editor container.
view
protected EditorView view()Returns the underlying editor view.
isCodeMode
protected boolean isCodeMode()True for a code editor backend.
cmd
public void cmd(String name, String arg)Executes a one way command. Unknown commands are ignored so subclasses can add vocabulary without
breaking the base.
Parameters
nameString- the command name
argString- the optional argument, may be null
query
public String query(String name, String arg)Executes a query returning a string result. Unknown queries return an empty string.
Parameters
nameString- the query name
argString- the optional argument, may be null