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.doublegetPrefWidth(double viewWidth) Returns the width to size the pane which hosts the side decorationNodes.
-
Constructor Details
-
LineNumberDecorator
public LineNumberDecorator()Creates an instance with the Western-style group separator (comma). -
LineNumberDecorator
Creates an instance using the specifiedDecimalFormat.- Parameters:
format- theDecimalFormatto use
-
-
Method Details
-
getPrefWidth
public double getPrefWidth(double viewWidth) Description copied from interface:SideDecoratorReturns the width to size the pane which hosts the side decorationNodes.When return value is 0 or negative, an alternative method to size the side pane hosting the decoration will be used: a special measurement
Nodewill be obtained viaSideDecorator.getMeasurementNode(int), whose preferred width will be used instead.- Specified by:
getPrefWidthin interfaceSideDecorator- Parameters:
viewWidth- width of the view- Returns:
- the preferred width
-
getMeasurementNode
Description copied from interface:SideDecoratorReturns 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:
getMeasurementNodein interfaceSideDecorator- Parameters:
index- the paragraph index at the top of the viewable area- Returns:
- the measurement
Node
-
getNode
Description copied from interface:SideDecoratorCreates 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:
getNodein interfaceSideDecorator- Parameters:
index- the paragraph index- Returns:
- new instance
Node
-