# 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

  Constructors
  Constructor
  Description
  `LineNumberDecorator()`
  Creates an instance with the Western-style group separator (comma).
  `LineNumberDecorator(DecimalFormat format)`
  Creates an instance using the specified `DecimalFormat`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Node`
  `getMeasurementNode(int index)`
  Returns the special measurement node to use for sizing the pane that holds the side decorations.
  `Node`
  `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 decoration `Node`s.

  ### Methods declared in class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## 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` - the `DecimalFormat` 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 decoration `Node`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 via `SideDecorator.getMeasurementNode(int)`, whose preferred width will be used instead.

    Specified by:
      `getPrefWidth` in interface `SideDecorator`
    Parameters:
      `viewWidth` - width of the view
    Returns:
      the preferred width

  - ### getMeasurementNode

    public Node getMeasurementNode(int index)
    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 if `SideDecorator.getPrefWidth(double)` returns 0 or negative value. The measurement node will not be displayed and will be discarded.
    Specified by:
      `getMeasurementNode` in interface `SideDecorator`
    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: `SideDecorator`
    Creates 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:
      `getNode` in interface `SideDecorator`
    Parameters:
      `index` - the paragraph index
    Returns:
      new instance `Node`