Top Description Inners Fields Constructors Methods
javafx.scene.web

public Class HTMLEditorSkin

extends SkinBase<HTMLEditor>
Class Inheritance
Imports
java.util.ResourceBundle, .HashMap, .Locale, .Map, com.sun.javafx.application.PlatformImpl, com.sun.javafx.scene.ParentHelper, com.sun.javafx.scene.traversal.Algorithm, .Direction, .ParentTraversalEngine, .TraversalContext, javafx.css.PseudoClass, .StyleableProperty, javafx.geometry.Orientation, .NodeOrientation, org.w3c.dom.html.HTMLDocument, .HTMLElement, javafx.application.ConditionalFeature, .Platform, javafx.collections.FXCollections, .ObservableList, .ListChangeListener, javafx.scene.Node, .Scene, javafx.scene.control.Button, .ComboBox, .ListCell, .ListView, .Separator, .TextInputControl, .ToggleButton, .ToggleGroup, .ToolBar, .Tooltip, javafx.scene.control.*, javafx.scene.image.Image, .ImageView, javafx.scene.input.KeyCode, .KeyEvent, .MouseEvent, javafx.scene.layout.ColumnConstraints, .GridPane, .Priority, javafx.scene.layout.*, javafx.scene.paint.Color, javafx.scene.text.Font, javafx.util.Callback, com.sun.javafx.scene.control.skin.FXVK, com.sun.javafx.scene.web.behavior.HTMLEditorBehavior, com.sun.webkit.WebPage, com.sun.javafx.webkit.Accessor, javafx.print.PrinterJob

HTML editor skin.
Since
9
See Also
HTMLEditor

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
HTMLEditorSkin.Command

Represents commands that can be passed into the HTMLEditor web engine.

Field Summary

Modifier and TypeField and Description
private ToggleButton
private ToggleButton
private ToggleButton
private ToggleGroup
private ToggleButton
private int
private ColorPicker
private ToggleButton
private ToggleButton
private String
private static PseudoClass
private Button
private Button
private static final Color
private static final Color
private static final String[][]
private boolean
private ParentTraversalEngine
private ColorPicker
private static final int
private static final int
private static final int
private ComboBox<String>
private ComboBox<String>
private Map<String, String>
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private ComboBox<String>
private Map<String, String>
private GridPane
private Button
private Button
private boolean
private ToggleButton
private ListChangeListener<Node>
private ToggleButton
private Button
private Button
private boolean
private ResourceBundle
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private Map<String, String>
private ToggleButton
private Map<String, String>
private ToolBar
private ToolBar
private ToggleButton
private WebPage
private WebView

Constructor Summary

AccessConstructor and Description
public
HTMLEditorSkin(HTMLEditor
The control that this skin should be installed onto.
control
)

Creates a new HTMLEditorSkin instance, installing the necessary child nodes into the Control children list, as well as the necessary input mappings for handling key, mouse, etc events.

Method Summary

Modifier and TypeMethod and Description
private Button
addButton(ToolBar toolbar, final String iconName, String tooltipText, final String command, final String styleClass)

private ToggleButton
addToggleButton(ToolBar toolbar, ToggleGroup toggleGroup, final String iconName, String tooltipText, final String command, final String styleClass)

private void
private String
private void
createFontSizeMenuItem(String fontSizeValue, String label)

private void
createFormatMenuItem(String formatValue, String label)

private void
enableToolbar(final boolean enable)

private boolean
executeCommand(String command, String value)

private Color
private boolean
private String
pack-priv final String
private boolean
protected void
layoutChildren(final double x, final double y, final double w, final double h)

Overrides javafx.scene.control.SkinBase.layoutChildren.

Called during the layout pass of the scenegraph.

public void
performCommand(final HTMLEditorSkin.Command
the command
command
)

Special-case handling for certain commands.

private void
private void
setContentEditable(boolean b)

pack-priv final void
setHTMLText(String htmlText)

private void
private void
updateToolbarState(final boolean updateAlignment)

Inherited from javafx.scene.control.SkinBase:
computeBaselineOffsetcomputeMaxHeightcomputeMaxWidthcomputeMinHeightcomputeMinWidthcomputePrefHeightcomputePrefWidthconsumeMouseEventsdisposeexecuteAccessibleActiongetChildrengetClassCssMetaDatagetCssMetaDatagetNodegetSkinnablelayoutInArealayoutInArealayoutInAreapositionInAreapositionInAreapseudoClassStateChangedqueryAccessibleAttributeregisterChangeListenerregisterInvalidationListenerregisterListChangeListenersnappedBottomInsetsnappedLeftInsetsnappedRightInsetsnappedTopInsetsnapPositionsnapPositionXsnapPositionYsnapSizesnapSizeXsnapSizeYsnapSpacesnapSpaceXsnapSpaceYunregisterChangeListenersunregisterInvalidationListenersunregisterListChangeListeners

Field Detail

alignCenterButtonback to summary
private ToggleButton alignCenterButton
alignJustifyButtonback to summary
private ToggleButton alignJustifyButton
alignLeftButtonback to summary
private ToggleButton alignLeftButton
alignmentToggleGroupback to summary
private ToggleGroup alignmentToggleGroup
alignRightButtonback to summary
private ToggleButton alignRightButton
atomicityCountback to summary
private int atomicityCount
bgColorButtonback to summary
private ColorPicker bgColorButton
boldButtonback to summary
private ToggleButton boldButton
bulletsButtonback to summary
private ToggleButton bulletsButton
cachedHTMLTextback to summary
private String cachedHTMLText
CONTAINS_FOCUS_PSEUDOCLASS_STATEback to summary
private static PseudoClass CONTAINS_FOCUS_PSEUDOCLASS_STATE
copyButtonback to summary
private Button copyButton
cutButtonback to summary
private Button cutButton
DEFAULT_BG_COLORback to summary
private static final Color DEFAULT_BG_COLOR
DEFAULT_FG_COLORback to summary
private static final Color DEFAULT_FG_COLOR
DEFAULT_FORMAT_MAPPINGSback to summary
private static final String[][] DEFAULT_FORMAT_MAPPINGS
enableAtomicityCheckback to summary
private boolean enableAtomicityCheck
engineback to summary
private ParentTraversalEngine engine
fgColorButtonback to summary
private ColorPicker fgColorButton
FONT_FAMILY_MENU_WIDTHback to summary
private static final int FONT_FAMILY_MENU_WIDTH
FONT_FAMILY_MENUBUTTON_WIDTHback to summary
private static final int FONT_FAMILY_MENUBUTTON_WIDTH
FONT_SIZE_MENUBUTTON_WIDTHback to summary
private static final int FONT_SIZE_MENUBUTTON_WIDTH
fontFamilyComboBoxback to summary
private ComboBox<String> fontFamilyComboBox
fontSizeComboBoxback to summary
private ComboBox<String> fontSizeComboBox
fontSizeMapback to summary
private Map<String, String> fontSizeMap
FORMAT_HEADING_1back to summary
private static final String FORMAT_HEADING_1
FORMAT_HEADING_2back to summary
private static final String FORMAT_HEADING_2
FORMAT_HEADING_3back to summary
private static final String FORMAT_HEADING_3
FORMAT_HEADING_4back to summary
private static final String FORMAT_HEADING_4
FORMAT_HEADING_5back to summary
private static final String FORMAT_HEADING_5
FORMAT_HEADING_6back to summary
private static final String FORMAT_HEADING_6
FORMAT_PARAGRAPHback to summary
private static final String FORMAT_PARAGRAPH
formatComboBoxback to summary
private ComboBox<String> formatComboBox
formatStyleMapback to summary
private Map<String, String> formatStyleMap
gridPaneback to summary
private GridPane gridPane
indentButtonback to summary
private Button indentButton
insertHorizontalRuleButtonback to summary
private Button insertHorizontalRuleButton
isFirstRunback to summary
private boolean isFirstRun
italicButtonback to summary
private ToggleButton italicButton
itemsListenerback to summary
private ListChangeListener<Node> itemsListener
numbersButtonback to summary
private ToggleButton numbersButton
outdentButtonback to summary
private Button outdentButton
pasteButtonback to summary
private Button pasteButton
resetToolbarStateback to summary
private boolean resetToolbarState
resourcesback to summary
private ResourceBundle resources
SIZE_LARGEback to summary
private static final String SIZE_LARGE
SIZE_MEDIUMback to summary
private static final String SIZE_MEDIUM
SIZE_SMALLback to summary
private static final String SIZE_SMALL
SIZE_X_LARGEback to summary
private static final String SIZE_X_LARGE
SIZE_X_SMALLback to summary
private static final String SIZE_X_SMALL
SIZE_XX_LARGEback to summary
private static final String SIZE_XX_LARGE
SIZE_XX_SMALLback to summary
private static final String SIZE_XX_SMALL
sizeFontMapback to summary
private Map<String, String> sizeFontMap
strikethroughButtonback to summary
private ToggleButton strikethroughButton
styleFormatMapback to summary
private Map<String, String> styleFormatMap
toolbar1back to summary
private ToolBar toolbar1
toolbar2back to summary
private ToolBar toolbar2
underlineButtonback to summary
private ToggleButton underlineButton
webPageback to summary
private WebPage webPage
webViewback to summary
private WebView webView

Constructor Detail

HTMLEditorSkinback to summary
public HTMLEditorSkin(HTMLEditor control)

Creates a new HTMLEditorSkin instance, installing the necessary child nodes into the Control children list, as well as the necessary input mappings for handling key, mouse, etc events.

Parameters
control:HTMLEditor

The control that this skin should be installed onto.

Method Detail

addButtonback to summary
private Button addButton(ToolBar toolbar, final String iconName, String tooltipText, final String command, final String styleClass)
addToggleButtonback to summary
private ToggleButton addToggleButton(ToolBar toolbar, ToggleGroup toggleGroup, final String iconName, String tooltipText, final String command, final String styleClass)
applyTextFormattingback to summary
private void applyTextFormatting()
colorValueToRGBAback to summary
private String colorValueToRGBA(Color c)
createFontSizeMenuItemback to summary
private void createFontSizeMenuItem(String fontSizeValue, String label)
createFormatMenuItemback to summary
private void createFormatMenuItem(String formatValue, String label)
enableToolbarback to summary
private void enableToolbar(final boolean enable)
executeCommandback to summary
private boolean executeCommand(String command, String value)
getColorback to summary
private Color getColor(String value)
getCommandStateback to summary
private boolean getCommandState(String command)
getCommandValueback to summary
private String getCommandValue(String command)
getHTMLTextback to summary
pack-priv final String getHTMLText()
isCommandEnabledback to summary
private boolean isCommandEnabled(String command)
layoutChildrenback to summary
protected void layoutChildren(final double x, final double y, final double w, final double h)

Overrides javafx.scene.control.SkinBase.layoutChildren.

Doc from javafx.scene.control.SkinBase.layoutChildren.

Called during the layout pass of the scenegraph.

Annotations
@Override
performCommandback to summary
public void performCommand(final HTMLEditorSkin.Command command)

Special-case handling for certain commands. Over time this may be extended to handle additional commands. The current list of supported commands is:

  • BOLD
  • ITALIC
  • UNDERLINE
Parameters
command:HTMLEditorSkin.Command

the command

populateToolbarsback to summary
private void populateToolbars()
setContentEditableback to summary
private void setContentEditable(boolean b)
setHTMLTextback to summary
pack-priv final void setHTMLText(String htmlText)
updateNodeOrientationback to summary
private void updateNodeOrientation()
updateToolbarStateback to summary
private void updateToolbarState(final boolean updateAlignment)
javafx.scene.web back to summary

public final Enum HTMLEditorSkin.Command

extends Enum<HTMLEditorSkin.Command>
Class Inheritance

Represents commands that can be passed into the HTMLEditor web engine.

Field Summary

Modifier and TypeField and Description
public static final HTMLEditorSkin.Command
ALIGN_CENTER

Align Center command.

public static final HTMLEditorSkin.Command
ALIGN_JUSTIFY

Align Justify command.

public static final HTMLEditorSkin.Command
ALIGN_LEFT

Align Left command.

public static final HTMLEditorSkin.Command
ALIGN_RIGHT

Align Right command.

public static final HTMLEditorSkin.Command
BACKGROUND_COLOR

Background color command.

public static final HTMLEditorSkin.Command
BOLD

Bold command.

public static final HTMLEditorSkin.Command
BULLETS

Insert bullets command.

private final String
public static final HTMLEditorSkin.Command
COPY

Copy command.

public static final HTMLEditorSkin.Command
CUT

Cut command.

public static final HTMLEditorSkin.Command
FONT_FAMILY

Font name command.

public static final HTMLEditorSkin.Command
FONT_SIZE

Font size command.

public static final HTMLEditorSkin.Command
FOREGROUND_COLOR

Foreground color command.

public static final HTMLEditorSkin.Command
FORMAT

Format command.

public static final HTMLEditorSkin.Command
INDENT

Indent command.

public static final HTMLEditorSkin.Command
INSERT_HORIZONTAL_RULE

Command to insert horizontal rule.

public static final HTMLEditorSkin.Command
INSERT_NEW_LINE

Insert newline command.

public static final HTMLEditorSkin.Command
INSERT_TAB

Insert tab command.

public static final HTMLEditorSkin.Command
ITALIC

Italic command.

public static final HTMLEditorSkin.Command
NUMBERS

Insert numbers command.

public static final HTMLEditorSkin.Command
OUTDENT

Outdent command.

public static final HTMLEditorSkin.Command
PASTE

Paste command.

public static final HTMLEditorSkin.Command
REDO

Redo command.

public static final HTMLEditorSkin.Command
STRIKETHROUGH

Strikethrough command.

public static final HTMLEditorSkin.Command
STYLEWITHCSS

Style with CSS command.

public static final HTMLEditorSkin.Command
UNDERLINE

Underline command.

public static final HTMLEditorSkin.Command
UNDO

Undo command.

Constructor Summary

AccessConstructor and Description
private
Command(String command)

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

the name of this command
getCommand
()

Gets the name of this command.

public static HTMLEditorSkin.Command
public static HTMLEditorSkin.Command[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

ALIGN_CENTERback to summary
public static final HTMLEditorSkin.Command ALIGN_CENTER

Align Center command.

ALIGN_JUSTIFYback to summary
public static final HTMLEditorSkin.Command ALIGN_JUSTIFY

Align Justify command.

ALIGN_LEFTback to summary
public static final HTMLEditorSkin.Command ALIGN_LEFT

Align Left command.

ALIGN_RIGHTback to summary
public static final HTMLEditorSkin.Command ALIGN_RIGHT

Align Right command.

BACKGROUND_COLORback to summary
public static final HTMLEditorSkin.Command BACKGROUND_COLOR

Background color command.

BOLDback to summary
public static final HTMLEditorSkin.Command BOLD

Bold command.

BULLETSback to summary
public static final HTMLEditorSkin.Command BULLETS

Insert bullets command.

commandback to summary
private final String command
COPYback to summary
public static final HTMLEditorSkin.Command COPY

Copy command.

CUTback to summary
public static final HTMLEditorSkin.Command CUT

Cut command.

FONT_FAMILYback to summary
public static final HTMLEditorSkin.Command FONT_FAMILY

Font name command.

FONT_SIZEback to summary
public static final HTMLEditorSkin.Command FONT_SIZE

Font size command.

FOREGROUND_COLORback to summary
public static final HTMLEditorSkin.Command FOREGROUND_COLOR

Foreground color command.

FORMATback to summary
public static final HTMLEditorSkin.Command FORMAT

Format command.

INDENTback to summary
public static final HTMLEditorSkin.Command INDENT

Indent command.

INSERT_HORIZONTAL_RULEback to summary
public static final HTMLEditorSkin.Command INSERT_HORIZONTAL_RULE

Command to insert horizontal rule.

INSERT_NEW_LINEback to summary
public static final HTMLEditorSkin.Command INSERT_NEW_LINE

Insert newline command.

INSERT_TABback to summary
public static final HTMLEditorSkin.Command INSERT_TAB

Insert tab command.

ITALICback to summary
public static final HTMLEditorSkin.Command ITALIC

Italic command.

NUMBERSback to summary
public static final HTMLEditorSkin.Command NUMBERS

Insert numbers command.

OUTDENTback to summary
public static final HTMLEditorSkin.Command OUTDENT

Outdent command.

PASTEback to summary
public static final HTMLEditorSkin.Command PASTE

Paste command.

REDOback to summary
public static final HTMLEditorSkin.Command REDO

Redo command.

STRIKETHROUGHback to summary
public static final HTMLEditorSkin.Command STRIKETHROUGH

Strikethrough command.

STYLEWITHCSSback to summary
public static final HTMLEditorSkin.Command STYLEWITHCSS

Style with CSS command.

UNDERLINEback to summary
public static final HTMLEditorSkin.Command UNDERLINE

Underline command.

UNDOback to summary
public static final HTMLEditorSkin.Command UNDO

Undo command.

Constructor Detail

Commandback to summary
private Command(String command)

Method Detail

getCommandback to summary
public String getCommand()

Gets the name of this command.

Returns:String

the name of this command

valueOfback to summary
public static HTMLEditorSkin.Command valueOf(String name)
valuesback to summary
public static HTMLEditorSkin.Command[] values()