public class CustomCodeArea
extends org.fxmisc.richtext.CodeArea
StyleLayer, which you can affect with styleCss(Node, Set), clearPrimaryStyleLayer() and the like. Syntax highlighting uses another internal style layer. Syntax highlighting
is performed asynchronously by another thread. You must shut down the executor gracefully by calling disableSyntaxHighlighting() before exiting the application.| Type | Property and Description |
|---|---|
javafx.beans.property.BooleanProperty |
syntaxHighlightingEnabled |
autoScrollOnDragDesiredProperty, beingUpdatedProperty, contextMenuObjectProperty, contextMenuXOffsetProperty, contextMenuYOffsetProperty, editableProperty, estimatedScrollXProperty, estimatedScrollYProperty, lengthProperty, mouseOverTextDelayProperty, onInsideSelectionMousePressReleaseProperty, onNewSelectionDragEndProperty, onNewSelectionDragProperty, onOutsideSelectionMousePressProperty, onSelectionDragProperty, onSelectionDropProperty, paragraphGraphicFactoryProperty, textProperty, totalHeightEstimateProperty, totalWidthEstimateProperty, useInitialStyleForInsertionProperty, wrapTextPropertybackgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, heightProperty, insetsProperty, maxHeightProperty, maxWidthProperty, minHeightProperty, minWidthProperty, opaqueInsetsProperty, paddingProperty, prefHeightProperty, prefWidthProperty, scaleShapeProperty, shapeProperty, snapToPixelProperty, widthPropertyimpl_traversalEngineProperty, needsLayoutPropertyaccessibleHelpProperty, accessibleRoleDescriptionProperty, accessibleRoleProperty, accessibleTextProperty, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, cacheHintProperty, cacheProperty, clipProperty, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectiveNodeOrientationProperty, effectProperty, eventDispatcherProperty, focusedProperty, focusTraversableProperty, hoverProperty, idProperty, impl_showMnemonicsProperty, impl_treeVisibleProperty, inputMethodRequestsProperty, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParentTransformProperty, localToSceneTransformProperty, managedProperty, mouseTransparentProperty, nodeOrientationProperty, onContextMenuRequestedProperty, onDragDetectedProperty, onDragDoneProperty, onDragDroppedProperty, onDragEnteredProperty, onDragExitedProperty, onDragOverProperty, onInputMethodTextChangedProperty, onKeyPressedProperty, onKeyReleasedProperty, onKeyTypedProperty, onMouseClickedProperty, onMouseDragEnteredProperty, onMouseDragExitedProperty, onMouseDraggedProperty, onMouseDragOverProperty, onMouseDragReleasedProperty, onMouseEnteredProperty, onMouseExitedProperty, onMouseMovedProperty, onMousePressedProperty, onMouseReleasedProperty, onRotateProperty, onRotationFinishedProperty, onRotationStartedProperty, onScrollFinishedProperty, onScrollProperty, onScrollStartedProperty, onSwipeDownProperty, onSwipeLeftProperty, onSwipeRightProperty, onSwipeUpProperty, onTouchMovedProperty, onTouchPressedProperty, onTouchReleasedProperty, onTouchStationaryProperty, onZoomFinishedProperty, onZoomProperty, onZoomStartedProperty, opacityProperty, parentProperty, pickOnBoundsProperty, pressedProperty, rotateProperty, rotationAxisProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, styleProperty, translateXProperty, translateYProperty, translateZProperty, visibleProperty| Constructor and Description |
|---|
CustomCodeArea() |
| Modifier and Type | Method and Description |
|---|---|
void |
clearPrimaryStyleLayer()
Clears the primary style layer from its contents.
|
void |
clearStyleLayers()
Clears all style layers from their contents.
|
void |
disableSyntaxHighlighting()
Disables syntax highlighting gracefully, if enabled.
|
boolean |
isInRange(Node n)
Returns true if the node is in the range of the current text.
|
boolean |
isSyntaxHighlightingEnabled()
Gets the value of the property syntaxHighlightingEnabled.
|
void |
paintCss()
Forcefully applies the possibly updated css classes.
|
void |
restylePrimaryStyleLayer(Node node,
java.util.Set<java.lang.String> cssClasses)
Replaces the styling of the primary layer by styling the node's position with the given css classes.
|
void |
setSyntaxHighlightingEnabled(SyntaxHighlighter highlighter)
Enables syntax highlighting if disabled and sets it to use the given highlighter.
|
void |
styleCss(int beginLine,
int beginColumn,
int endLine,
int endColumn,
java.util.Set<java.lang.String> cssClasses)
Styles the region delimited by the coordinates with the given css classes.
|
void |
styleCss(Node node,
java.util.Set<java.lang.String> cssClasses)
Styles the node's position with the given css classes.
|
javafx.beans.property.BooleanProperty |
syntaxHighlightingEnabledProperty() |
createStyledTextNode, createStyledTextNodeallParToVisibleParIndex, autoScrollOnDragDesiredProperty, beingUpdatedProperty, contextMenuObjectProperty, contextMenuXOffsetProperty, contextMenuYOffsetProperty, displaceCaret, dispose, editableProperty, estimatedScrollXProperty, estimatedScrollYProperty, getAbsolutePosition, getApplyParagraphStyle, getCaretBoundsOnScreen, getCaretSelectionBind, getCharacterBoundsOnScreen, getClassCssMetaData, getContent, getCssMetaData, getDocument, getInitialParagraphStyle, getInitialTextStyle, getParagraphBoundsOnScreen, getParagraphLinesCount, getParagraphs, getParagraphSelection, getParagraphStyleForInsertionAt, getSegOps, getStyleAtPosition, getStyleAtPosition, getStyleCodecs, getStyleOfChar, getStyleOfChar, getStyleRangeAtPosition, getStyleRangeAtPosition, getStyleSpans, getStyleSpans, getStyleSpans, getText, getText, getText, getTextStyleForInsertionAt, getUndoManager, getViewportHeight, getVisibleParagraphBoundsOnScreen, getVisibleParagraphs, hit, isContextMenuPresent, isPreserveStyle, layoutChildren, lengthProperty, lineEnd, lineIndex, lineStart, mouseOverTextDelayProperty, nextPage, offsetToPosition, onInsideSelectionMousePressReleaseProperty, onNewSelectionDragEndProperty, onNewSelectionDragProperty, onOutsideSelectionMousePressProperty, onSelectionDragProperty, onSelectionDropProperty, paragraphGraphicFactoryProperty, plainTextChanges, position, prevPage, replace, replace, replaceText, requestFollowCaret, richChanges, scrollBy, scrollXBy, scrollXToPixel, scrollYBy, scrollYToPixel, setParagraphStyle, setStyle, setStyle, setStyle, setStyleCodecs, setStyleSpans, setStyleSpans, setUndoManager, showParagraphAtBottom, showParagraphAtTop, showParagraphInViewport, showParagraphRegion, subDocument, subDocument, textProperty, totalHeightEstimateProperty, totalWidthEstimateProperty, useInitialStyleForInsertionProperty, viewportDirtyEvents, visibleParToAllParIndex, wrapTextPropertybackgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, computeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, getBackground, getBorder, getHeight, getInsets, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOpaqueInsets, getPadding, getPrefHeight, getPrefWidth, getShape, getUserAgentStylesheet, getWidth, heightProperty, impl_computeContains, impl_computeGeomBounds, impl_computeLayoutBounds, impl_createPeer, impl_notifyLayoutBoundsChanged, impl_pickNodeLocal, impl_updatePeer, insetsProperty, isCacheShape, isCenterShape, isResizable, isScaleShape, isSnapToPixel, layoutInArea, layoutInArea, layoutInArea, layoutInArea, maxHeight, maxHeightProperty, maxWidth, maxWidthProperty, minHeight, minHeightProperty, minWidth, minWidthProperty, opaqueInsetsProperty, paddingProperty, positionInArea, positionInArea, prefHeight, prefHeightProperty, prefWidth, prefWidthProperty, resize, scaleShapeProperty, setBackground, setBorder, setCacheShape, setCenterShape, setHeight, setMaxHeight, setMaxSize, setMaxWidth, setMinHeight, setMinSize, setMinWidth, setOpaqueInsets, setPadding, setPrefHeight, setPrefSize, setPrefWidth, setScaleShape, setShape, setSnapToPixel, setWidth, shapeProperty, snappedBottomInset, snappedLeftInset, snappedRightInset, snappedTopInset, snapPosition, snapSize, snapSpace, snapToPixelProperty, widthPropertygetBaselineOffset, getChildren, getChildrenUnmodifiable, getImpl_traversalEngine, getManagedChildren, getStylesheets, impl_getAllParentStylesheets, impl_processCSS, impl_processMXNode, impl_traversalEngineProperty, isNeedsLayout, layout, lookup, needsLayoutProperty, queryAccessibleAttribute, requestLayout, requestParentLayout, setImpl_traversalEngine, setNeedsLayout, updateBoundsaccessibleHelpProperty, accessibleRoleDescriptionProperty, accessibleRoleProperty, accessibleTextProperty, addEventFilter, addEventHandler, applyCss, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, computeAreaInScreen, contains, contains, containsBounds, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectiveNodeOrientationProperty, effectProperty, eventDispatcherProperty, executeAccessibleAction, fireEvent, focusedProperty, focusTraversableProperty, getAccessibleHelp, getAccessibleRole, getAccessibleRoleDescription, getAccessibleText, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClip, getContentBias, getCursor, getDepthTest, getEffect, getEffectiveNodeOrientation, getEventDispatcher, getId, getInputMethodRequests, getLayoutBounds, getLayoutX, getLayoutY, getLocalToParentTransform, getLocalToSceneTransform, getNodeOrientation, getOnContextMenuRequested, getOnDragDetected, getOnDragDone, getOnDragDropped, getOnDragEntered, getOnDragExited, getOnDragOver, getOnInputMethodTextChanged, getOnKeyPressed, getOnKeyReleased, getOnKeyTyped, getOnMouseClicked, getOnMouseDragEntered, getOnMouseDragExited, getOnMouseDragged, getOnMouseDragOver, getOnMouseDragReleased, getOnMouseEntered, getOnMouseExited, getOnMouseMoved, getOnMousePressed, getOnMouseReleased, getOnRotate, getOnRotationFinished, getOnRotationStarted, getOnScroll, getOnScrollFinished, getOnScrollStarted, getOnSwipeDown, getOnSwipeLeft, getOnSwipeRight, getOnSwipeUp, getOnTouchMoved, getOnTouchPressed, getOnTouchReleased, getOnTouchStationary, getOnZoom, getOnZoomFinished, getOnZoomStarted, getOpacity, getParent, getProperties, getPseudoClassStates, getRotate, getRotationAxis, getScaleX, getScaleY, getScaleZ, getScene, getStyle, getStyleableParent, getStyleClass, getTransforms, getTranslateX, getTranslateY, getTranslateZ, getTypeSelector, getUserData, hasProperties, hoverProperty, idProperty, impl_clearDirty, impl_computeIntersects, impl_cssGetCursorInitialValue, impl_cssGetFocusTraversableInitialValue, impl_findStyles, impl_geomChanged, impl_getLeafTransform, impl_getMatchingStyles, impl_getPeer, impl_getPivotX, impl_getPivotY, impl_getPivotZ, impl_getStyleMap, impl_hasTransforms, impl_intersects, impl_intersectsBounds, impl_isDirty, impl_isDirtyEmpty, impl_isShowMnemonics, impl_isTreeVisible, impl_layoutBoundsChanged, impl_markDirty, impl_pickNode, impl_processCSS, impl_reapplyCSS, impl_setShowMnemonics, impl_setStyleMap, impl_showMnemonicsProperty, impl_syncPeer, impl_transformsChanged, impl_traverse, impl_treeVisibleProperty, inputMethodRequestsProperty, intersects, intersects, isCache, isDisable, isDisabled, isFocused, isFocusTraversable, isHover, isManaged, isMouseTransparent, isPickOnBounds, isPressed, isVisible, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParent, localToParent, localToParent, localToParent, localToParent, localToParentTransformProperty, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToSceneTransformProperty, localToScreen, localToScreen, localToScreen, localToScreen, localToScreen, lookupAll, managedProperty, mouseTransparentProperty, nodeOrientationProperty, notifyAccessibleAttributeChanged, onContextMenuRequestedProperty, onDragDetectedProperty, onDragDoneProperty, onDragDroppedProperty, onDragEnteredProperty, onDragExitedProperty, onDragOverProperty, onInputMethodTextChangedProperty, onKeyPressedProperty, onKeyReleasedProperty, onKeyTypedProperty, onMouseClickedProperty, onMouseDragEnteredProperty, onMouseDragExitedProperty, onMouseDraggedProperty, onMouseDragOverProperty, onMouseDragReleasedProperty, onMouseEnteredProperty, onMouseExitedProperty, onMouseMovedProperty, onMousePressedProperty, onMouseReleasedProperty, onRotateProperty, onRotationFinishedProperty, onRotationStartedProperty, onScrollFinishedProperty, onScrollProperty, onScrollStartedProperty, onSwipeDownProperty, onSwipeLeftProperty, onSwipeRightProperty, onSwipeUpProperty, onTouchMovedProperty, onTouchPressedProperty, onTouchReleasedProperty, onTouchStationaryProperty, onZoomFinishedProperty, onZoomProperty, onZoomStartedProperty, opacityProperty, parentProperty, parentToLocal, parentToLocal, parentToLocal, parentToLocal, parentToLocal, pickOnBoundsProperty, pressedProperty, pseudoClassStateChanged, relocate, removeEventFilter, removeEventHandler, requestFocus, resizeRelocate, rotateProperty, rotationAxisProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, screenToLocal, screenToLocal, screenToLocal, setAccessibleHelp, setAccessibleRole, setAccessibleRoleDescription, setAccessibleText, setBlendMode, setCache, setCacheHint, setClip, setCursor, setDepthTest, setDisable, setDisabled, setEffect, setEventDispatcher, setEventHandler, setFocused, setFocusTraversable, setHover, setId, setInputMethodRequests, setLayoutX, setLayoutY, setManaged, setMouseTransparent, setNodeOrientation, setOnContextMenuRequested, setOnDragDetected, setOnDragDone, setOnDragDropped, setOnDragEntered, setOnDragExited, setOnDragOver, setOnInputMethodTextChanged, setOnKeyPressed, setOnKeyReleased, setOnKeyTyped, setOnMouseClicked, setOnMouseDragEntered, setOnMouseDragExited, setOnMouseDragged, setOnMouseDragOver, setOnMouseDragReleased, setOnMouseEntered, setOnMouseExited, setOnMouseMoved, setOnMousePressed, setOnMouseReleased, setOnRotate, setOnRotationFinished, setOnRotationStarted, setOnScroll, setOnScrollFinished, setOnScrollStarted, setOnSwipeDown, setOnSwipeLeft, setOnSwipeRight, setOnSwipeUp, setOnTouchMoved, setOnTouchPressed, setOnTouchReleased, setOnTouchStationary, setOnZoom, setOnZoomFinished, setOnZoomStarted, setOpacity, setPickOnBounds, setPressed, setRotate, setRotationAxis, setScaleX, setScaleY, setScaleZ, setStyle, setTranslateX, setTranslateY, setTranslateZ, setUserData, setVisible, snapshot, snapshot, startDragAndDrop, startFullDrag, styleProperty, toBack, toFront, toString, translateXProperty, translateYProperty, translateZProperty, usesMirroring, visiblePropertyclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitappend, appendText, clear, deleteNextChar, deletePreviousChar, deleteText, deleteText, deleteText, insert, insert, insertText, insertText, moveSelectedText, replace, replaceSelection, replaceSelection, replaceTextanchorProperty, caretBoundsProperty, caretColumnProperty, caretPositionProperty, currentParagraphProperty, getAnchor, getCaretBounds, getCaretColumn, getCaretPosition, getCurrentParagraph, getLength, getParagraph, getParagraphLength, getParagraphSelection, getSelectedText, getSelection, getSelectionBounds, getShowCaret, getText, getText, isBeingUpdated, replace, replace, replace, replace, replaceText, replaceText, selectedTextProperty, selectionBoundsProperty, selectionProperty, selectRange, selectRange, setShowCaret, showCaretProperty, subDocument, subDocumentdeselect, end, moveTo, moveTo, moveTo, moveTo, nextChar, paragraphEnd, paragraphStart, previousChar, selectAll, selectParagraph, selectWord, start, wordBreaksBackwards, wordBreaksForwardsclearParagraphStyle, clearStyle, clearStyle, clearStyle, getStyleSpans, getStyleSpans, getUseInitialStyleForInsertion, setUseInitialStyleForInsertionisRedoAvailable, isUndoAvailable, redo, redoAvailableProperty, undo, undoAvailablePropertyfirstVisibleParToAllParIndex, getContextMenu, getContextMenuXOffset, getContextMenuYOffset, getMouseOverTextDelay, getOnInsideSelectionMousePressRelease, getOnNewSelectionDrag, getOnNewSelectionDragEnd, getOnOutsideSelectionMousePress, getOnSelectionDrag, getOnSelectionDrop, getParagraphGraphicFactory, hideContextMenu, isAutoScrollOnDragDesired, isEditable, isWrapText, lastVisibleParToAllParIndex, selectLine, setAutoScrollOnDragDesired, setContextMenu, setContextMenuXOffset, setContextMenuYOffset, setEditable, setMouseOverTextDelay, setOnInsideSelectionMousePressRelease, setOnNewSelectionDrag, setOnNewSelectionDragEnd, setOnOutsideSelectionMousePress, setOnSelectionDrag, setOnSelectionDrop, setParagraphGraphicFactory, setWrapTextpublic javafx.beans.property.BooleanProperty syntaxHighlightingEnabledProperty
public void styleCss(int beginLine,
int beginColumn,
int endLine,
int endColumn,
java.util.Set<java.lang.String> cssClasses)
paintCss() to update the visual appearance.beginLine - Begin linebeginColumn - Begin columnendLine - End lineendColumn - End columncssClasses - The css classes to applyjava.lang.IllegalArgumentException - if the region identified by the coordinates is out of boundspublic void styleCss(Node node, java.util.Set<java.lang.String> cssClasses)
node - The node to stylecssClasses - The css classes to applyjava.lang.IllegalArgumentException - if the node's coordinates are out of boundspublic void restylePrimaryStyleLayer(Node node, java.util.Set<java.lang.String> cssClasses)
node - The node to stylecssClasses - The css classes to applyjava.lang.IllegalArgumentException - if the node's coordinates are out of boundspublic boolean isInRange(Node n)
n - The node to checkpublic void clearPrimaryStyleLayer()
public void clearStyleLayers()
public boolean isSyntaxHighlightingEnabled()
public void setSyntaxHighlightingEnabled(SyntaxHighlighter highlighter)
highlighter - The highlighter to use (not null)public javafx.beans.property.BooleanProperty syntaxHighlightingEnabledProperty()
public void paintCss()
public void disableSyntaxHighlighting()
Copyright © 2002–2017 PMD. All rights reserved.