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