APIdia Launch Partner
Top Description Constructors Methods
javafx.scene.web

public Class HTMLEditor

extends Control
Class Inheritance
Imports
com.sun.javafx.scene.control.ControlHelper, javafx.css.StyleableProperty, javafx.scene.control.Control, .Skin, javafx.print.PrinterJob

A control that allows for users to edit text, and apply styling to this text. The underlying data model is HTML, although this is not shown visually to the end-user.
Since
JavaFX 2.0

Constructor Summary

AccessConstructor and Description
public
HTMLEditor()

Creates a new instance of the HTMLEditor control.

Method Summary

Modifier and TypeMethod and Description
protected Skin<?>
createDefaultSkin()

Overrides javafx.scene.control.Control.createDefaultSkin.

Create a new instance of the default skin for this control.

public String

Returns:

the HTML content
getHtmlText
()

Returns the HTML content of the editor.

public void
setHtmlText(String
the full HTML markup to put into the editor. This should include all normal HTML elements, starting with <html>, and including a <body>.
htmlText
)

Sets the HTML content of the editor.

Inherited from javafx.scene.control.Control:
computeMaxHeightcomputeMaxWidthcomputeMinHeightcomputeMinWidthcomputePrefHeightcomputePrefWidthcontextMenuPropertyexecuteAccessibleActiongetBaselineOffsetgetClassCssMetaDatagetContextMenugetControlCssMetaDatagetCssMetaDatagetInitialFocusTraversablegetSkingetTooltipisResizablelayoutChildrenqueryAccessibleAttributesetContextMenusetSkinsetTooltipskinPropertytooltipProperty

Constructor Detail

HTMLEditorback to summary
public HTMLEditor()

Creates a new instance of the HTMLEditor control.

Method Detail

createDefaultSkinback to summary
protected Skin<?> createDefaultSkin()

Overrides javafx.scene.control.Control.createDefaultSkin.

Doc from javafx.scene.control.Control.createDefaultSkin.

Create a new instance of the default skin for this control. This is called to create a skin for the control if no skin is provided via CSS -fx-skin or set explicitly in a sub-class with setSkin(...).

Annotations
@Override
getHtmlTextback to summary
public String getHtmlText()

Returns the HTML content of the editor.

Returns:String

the HTML content

setHtmlTextback to summary
public void setHtmlText(String htmlText)

Sets the HTML content of the editor. Note that if the contentEditable property on the <body> tag of the provided HTML is not set to true, the HTMLEditor will become read-only. You can ensure that the text remains editable by ensuring the body appears as such:

<body contentEditable="true">
Parameters
htmlText:String

the full HTML markup to put into the editor. This should include all normal HTML elements, starting with <html>, and including a <body>.