public class Editor
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_MODE
Default editor mode.
|
static java.lang.String |
DEFAULT_THEME
Default editor theme.
|
private netscape.javascript.JSObject |
editor
ACE editor instance in the web page.
|
private javafx.scene.web.WebEngine |
engine
WebView engine.
|
private java.lang.String |
json
Resulting JSON.
|
private netscape.javascript.JSObject |
session
Session of the ACE editor.
|
private javafx.scene.web.WebView |
view
A read-only text area that displays the resulting JSON.
|
Constructor and Description |
---|
Editor()
WebView and WebEngine initialization.
|
Modifier and Type | Method and Description |
---|---|
private java.lang.String |
escape(java.lang.String str)
Converts classic text with HTML tags to the correct HTML (critical characters
replaced by HTML entities).
|
private java.lang.String |
getBasicHTML() |
java.lang.String |
getJson() |
javafx.scene.web.WebView |
getView() |
void |
setContent(java.lang.String json)
Replaces the editor content.
|
void |
setMode(java.lang.String mode)
Sets a new mode in the editor.
|
void |
setTheme(java.lang.String theme)
Sets a new theme in the editor.
|
public static final java.lang.String DEFAULT_MODE
public static final java.lang.String DEFAULT_THEME
private javafx.scene.web.WebView view
private javafx.scene.web.WebEngine engine
private netscape.javascript.JSObject editor
private netscape.javascript.JSObject session
private java.lang.String json
public void setMode(java.lang.String mode)
mode
- new editor mode.public void setTheme(java.lang.String theme)
theme
- new editor theme.public javafx.scene.web.WebView getView()
public java.lang.String getJson()
public void setContent(java.lang.String json)
json
- new content.private java.lang.String getBasicHTML()
private java.lang.String escape(java.lang.String str)
str
- text that is half plain text ('\n', '\t', etc.) and half html.