Class LineNumberDecorator
java.lang.Object
jfx.incubator.scene.control.richtext.LineNumberDecorator
- All Implemented Interfaces:
SideDecorator
Side decorator which shows paragraph (line) numbers.
The numbering starts at line 1.
- Since:
- 24
-
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance with the Western-style group separator (comma).LineNumberDecorator
(DecimalFormat format) Creates an instance using the specifiedDecimalFormat
. -
Method Summary
Modifier and TypeMethodDescriptiongetMeasurementNode
(int index) Returns the special measurement node to use for sizing the pane that holds the side decorations.getNode
(int index) Creates a Node to be added to the layout to the right or to the left of the given paragraph.double
getPrefWidth
(double viewWidth) Returns the width to size the pane which hosts the side decorationNode
s.
-
Constructor Details
-
LineNumberDecorator
public LineNumberDecorator()Creates an instance with the Western-style group separator (comma). -
LineNumberDecorator
Creates an instance using the specifiedDecimalFormat
.- Parameters:
format
- theDecimalFormat
to use
-
-
Method Details
-
getPrefWidth
public double getPrefWidth(double viewWidth) Description copied from interface:SideDecorator
Returns the width to size the pane which hosts the side decorationNode
s.When return value is 0 or negative, an alternative method to size the side pane hosting the decoration will be used: a special measurement
Node
will be obtained viaSideDecorator.getMeasurementNode(int)
, whose preferred width will be used instead.- Specified by:
getPrefWidth
in interfaceSideDecorator
- Parameters:
viewWidth
- width of the view- Returns:
- the preferred width
-
getMeasurementNode
Description copied from interface:SideDecorator
Returns the special measurement node to use for sizing the pane that holds the side decorations. This method will only be called ifSideDecorator.getPrefWidth(double)
returns 0 or negative value. The measurement node will not be displayed and will be discarded.- Specified by:
getMeasurementNode
in interfaceSideDecorator
- Parameters:
index
- the paragraph index at the top of the viewable area- Returns:
- the measurement
Node
-
getNode
Description copied from interface:SideDecorator
Creates a Node to be added to the layout to the right or to the left of the given paragraph. This method may returnnull
.- Specified by:
getNode
in interfaceSideDecorator
- Parameters:
index
- the paragraph index- Returns:
- new instance
Node
-