Top Description Fields Constructors Methods
org.fxmisc.richtext

public Class LineNumberFactory<PS>

extends Object
implements IntFunction<Node>
Class Inheritance
All Implemented Interfaces
java.util.function.IntFunction
Imports
java.util.function.IntFunction, .Predicate, .UnaryOperator, javafx.application.Platform, javafx.geometry.Insets, .Pos, javafx.scene.Cursor, .Node, javafx.scene.control.ContentDisplay, .Label, javafx.scene.layout.Background, .BackgroundFill, javafx.scene.paint.Color, .Paint, javafx.scene.text.Font, .FontPosture, .FontWeight, org.reactfx.collection.LiveList, org.reactfx.value.Val

Graphic factory that produces labels containing line numbers and a "+" to indicate folded paragraphs. To customize appearance, use .lineno and .fold-indicator style classes in CSS stylesheets.

Field Summary

Modifier and TypeField and Description
private final GenericStyledArea<PS, ?, ?>
private static final Background
private static final Font
private static final Font
private static final Insets
private static final Paint
private final IntFunction<String>
private final Predicate<PS>
private final Val<Integer>
private final UnaryOperator<PS>

Constructor Summary

AccessConstructor and Description
private
LineNumberFactory(GenericStyledArea<PS, ?, ?> area, IntFunction<String> format, Predicate<PS> isFolded, UnaryOperator<PS> removeFoldStyle)

Method Summary

Modifier and TypeMethod and Description
public Node
apply(int idx)

Implements java.util.function.IntFunction.apply.

Applies this function to the given argument.

private void
private String
format(int x, int max)

public static IntFunction<Node>
get(GenericStyledArea<?, ?, ?> area)

public static <PS> IntFunction<Node>
get(GenericStyledArea<PS, ?, ?> area, IntFunction<String> format)

public static <
The paragraph style type being used by the text area
PS
>
IntFunction<Node>
get(GenericStyledArea<PS, ?, ?> area, IntFunction<String>
Given an int convert to a String for the line number.
format
,
Predicate<PS>
Given a paragraph style PS check if it's folded.
isFolded
,
UnaryOperator<PS>
Given a paragraph style PS, return a new PS that excludes fold styling.
removeFoldStyle
)

Use this if you extended GenericStyledArea for your own text area and you're using paragraph folding.

private void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

areaback to summary
private final GenericStyledArea<PS, ?, ?> area
DEFAULT_BACKGROUNDback to summary
private static final Background DEFAULT_BACKGROUND
DEFAULT_FOLD_FONTback to summary
private static final Font DEFAULT_FOLD_FONT
DEFAULT_FONTback to summary
private static final Font DEFAULT_FONT
DEFAULT_INSETSback to summary
private static final Insets DEFAULT_INSETS
DEFAULT_TEXT_FILLback to summary
private static final Paint DEFAULT_TEXT_FILL
formatback to summary
private final IntFunction<String> format
isFoldedCheckback to summary
private final Predicate<PS> isFoldedCheck
nParagraphsback to summary
private final Val<Integer> nParagraphs
removeFoldStyleback to summary
private final UnaryOperator<PS> removeFoldStyle

Constructor Detail

LineNumberFactoryback to summary
private LineNumberFactory(GenericStyledArea<PS, ?, ?> area, IntFunction<String> format, Predicate<PS> isFolded, UnaryOperator<PS> removeFoldStyle)

Method Detail

applyback to summary
public Node apply(int idx)

Implements java.util.function.IntFunction.apply.

Doc from java.util.function.IntFunction.apply.

Applies this function to the given argument.

Annotations
@Override
deleteParagraphCheckback to summary
private void deleteParagraphCheck()
formatback to summary
private String format(int x, int max)
getback to summary
public static IntFunction<Node> get(GenericStyledArea<?, ?, ?> area)
getback to summary
public static <PS> IntFunction<Node> get(GenericStyledArea<PS, ?, ?> area, IntFunction<String> format)
getback to summary
public static <PS> IntFunction<Node> get(GenericStyledArea<PS, ?, ?> area, IntFunction<String> format, Predicate<PS> isFolded, UnaryOperator<PS> removeFoldStyle)

Use this if you extended GenericStyledArea for your own text area and you're using paragraph folding.

Parameters
<PS>
The paragraph style type being used by the text area
format:IntFunction<String>

Given an int convert to a String for the line number.

isFolded:Predicate<PS>

Given a paragraph style PS check if it's folded.

removeFoldStyle:UnaryOperator<PS>

Given a paragraph style PS, return a new PS that excludes fold styling.

insertParagraphCheckback to summary
private void insertParagraphCheck()