Class LineNumberDecorator
java.lang.Object
jfx.incubator.scene.control.richtext.LineNumberDecorator
- All Implemented Interfaces:
SideDecorator
public class LineNumberDecorator extends Object implements SideDecorator
Side decorator which shows paragraph (line) numbers. The numbering starts at line 1.
- Since:
- 24
Constructor Summary
| Constructor | Description |
|---|---|
LineNumberDecorator() |
Creates an instance with the Western-style group separator (comma). |
LineNumberDecorator |
Creates an instance using the specified DecimalFormat. |
Method Summary
| Modifier and Type | Method | Description |
|---|---|---|
Node |
getMeasurementNode |
Returns the special measurement node to use for sizing the pane that holds the side decorations. |
Node |
getNode |
Creates a Node to be added to the layout to the right or to the left of the given paragraph. |
double |
getPrefWidth |
Returns the width to size the pane which hosts the side decoration Nodes. |
Constructor Details
LineNumberDecorator
public LineNumberDecorator()
Creates an instance with the Western-style group separator (comma).
LineNumberDecorator
public LineNumberDecorator(DecimalFormat format)
Creates an instance using the specified
DecimalFormat.- 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 decoration
Nodes. 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 via SideDecorator.getMeasurementNode(int), whose preferred width will be used instead.
- Specified by:
-
getPrefWidthin interfaceSideDecorator - Parameters:
-
viewWidth- width of the view - Returns:
- the preferred width
getMeasurementNode
public Node getMeasurementNode(int index)
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 if
SideDecorator.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
public Node getNode(int index)
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 return
null.- Specified by:
-
getNodein interfaceSideDecorator - Parameters:
-
index- the paragraph index - Returns:
- new instance
Node
© 2008, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from JavaFX API Documentation.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Java, JavaFX and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.