Class CodeSelectorPresentation
- java.lang.Object
-
- com.puppycrawl.tools.checkstyle.gui.CodeSelectorPresentation
-
public class CodeSelectorPresentation extends java.lang.Object
Presentation model for CodeSelector.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<java.lang.Integer>lines2positionMapping.private java.lang.ObjectnodeDetailAST or DetailNode node.private intselectionEndSelection end position.private intselectionStartSelection start position.
-
Constructor Summary
Constructors Constructor Description CodeSelectorPresentation(DetailAST ast, java.util.List<java.lang.Integer> lines2position)Constructor.CodeSelectorPresentation(DetailNode node, java.util.List<java.lang.Integer> lines2position)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private intfindLastPosition(DetailAST astNode)Finds the last position of node without children.private intfindLastPosition(DetailNode detailNode)Finds the last position of node without children.voidfindSelectionPositions()Find start and end selection positions from AST line and Column.private voidfindSelectionPositions(DetailAST ast)Find start and end selection positions from AST line and Column.private voidfindSelectionPositions(DetailNode detailNode)Find start and end selection positions from DetailNode line and Column.intgetSelectionEnd()Returns selection end position.intgetSelectionStart()Returns selection start position.
-
-
-
Field Detail
-
node
private final java.lang.Object node
DetailAST or DetailNode node.
-
lines2position
private final java.util.List<java.lang.Integer> lines2position
Mapping.
-
selectionStart
private int selectionStart
Selection start position.
-
selectionEnd
private int selectionEnd
Selection end position.
-
-
Constructor Detail
-
CodeSelectorPresentation
public CodeSelectorPresentation(DetailAST ast, java.util.List<java.lang.Integer> lines2position)
Constructor.- Parameters:
ast- ast node.lines2position- list to map lines.
-
CodeSelectorPresentation
public CodeSelectorPresentation(DetailNode node, java.util.List<java.lang.Integer> lines2position)
Constructor.- Parameters:
node- DetailNode node.lines2position- list to map lines.
-
-
Method Detail
-
getSelectionStart
public int getSelectionStart()
Returns selection start position.- Returns:
- selection start position.
-
getSelectionEnd
public int getSelectionEnd()
Returns selection end position.- Returns:
- selection end position.
-
findSelectionPositions
public void findSelectionPositions()
Find start and end selection positions from AST line and Column.
-
findSelectionPositions
private void findSelectionPositions(DetailAST ast)
Find start and end selection positions from AST line and Column.- Parameters:
ast- DetailAST node for which selection finds
-
findSelectionPositions
private void findSelectionPositions(DetailNode detailNode)
Find start and end selection positions from DetailNode line and Column.- Parameters:
detailNode- DetailNode node for which selection finds
-
findLastPosition
private int findLastPosition(DetailAST astNode)
Finds the last position of node without children.- Parameters:
astNode- DetailAST node.- Returns:
- Last position of node without children.
-
findLastPosition
private int findLastPosition(DetailNode detailNode)
Finds the last position of node without children.- Parameters:
detailNode- DetailNode node.- Returns:
- Last position of node without children.
-
-