Class PmdCoordinatesSystem
- java.lang.Object
-
- net.sourceforge.pmd.util.fxdesigner.util.codearea.PmdCoordinatesSystem
-
public final class PmdCoordinatesSystem extends Object
Maps PMD's (line, column) coordinate system to and from the code area's one-dimensional (absolute offset-based) system.- Since:
- 6.13.0
- Author:
- Clément Fournier
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Optional<net.sourceforge.pmd.lang.ast.Node>
findNodeAt(net.sourceforge.pmd.lang.ast.Node root, int target)
Locates the innermost node in the given [root] that contains the position at [textOffset] in the [codeArea].static Optional<net.sourceforge.pmd.lang.ast.Node>
findNodeCovering(net.sourceforge.pmd.lang.ast.Node root, net.sourceforge.pmd.lang.document.TextRegion range, boolean exact)
Returns the innermost node that covers the entire given text range in the given tree.static int
getRtfxParIndexFromPmdLine(int line)
-
-
-
Method Detail
-
getRtfxParIndexFromPmdLine
public static int getRtfxParIndexFromPmdLine(int line)
-
findNodeAt
public static Optional<net.sourceforge.pmd.lang.ast.Node> findNodeAt(net.sourceforge.pmd.lang.ast.Node root, int target)
Locates the innermost node in the given [root] that contains the position at [textOffset] in the [codeArea].
-
findNodeCovering
public static Optional<net.sourceforge.pmd.lang.ast.Node> findNodeCovering(net.sourceforge.pmd.lang.ast.Node root, net.sourceforge.pmd.lang.document.TextRegion range, boolean exact)
Returns the innermost node that covers the entire given text range in the given tree.- Parameters:
root
- Root of the treerange
- Range to findexact
- If true, will return the *outermost* node whose range is *exactly* the given text range, otherwise it may be larger.
-
-