Class LineSelection
java.lang.Object
io.github.jbastgen.stemma.app.git.LineSelection
The lines the user has selected in the diff of the working tree (feature 50): the keys of the lines (
+12, -7, see
Hunks.ChangeLine) of one section of the diff, the unstaged or the staged changes. It outlives the diff view, which is made again
whenever the repository view is drawn, and belongs to one file: another file starts with nothing selected. Pure, no JavaFX.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaction()The section of the lines: "stage" for the unstaged changes (they can be staged or discarded), "unstage" for the staged ones.intanchor()The row that was clicked last; the start of a range made with Shift.voidclear()Forgets all lines and the anchor.booleanWhether the line is selected in this section.voidStarts over when the diff is of another file or commit than the one the selection was made in.booleanisEmpty()Whether no line is selected.keys()The keys, in the order they were selected.voidpaint(String section, Collection<String> range, boolean select, int row) Selects or unselects a range of lines (as one drag or a click with Shift does); lines of the other section replace the selection.voidTakes lines out of the selection, for example those that are gone from the diff after something was staged.intsize()How many lines are selected.booleanSelects or unselects one line; a line of the other section replaces the selection.
-
Constructor Details
-
LineSelection
public LineSelection()
-
-
Method Details
-
forOwner
Starts over when the diff is of another file or commit than the one the selection was made in. -
clear
public void clear()Forgets all lines and the anchor. -
isEmpty
public boolean isEmpty()Whether no line is selected. -
size
public int size()How many lines are selected. -
action
The section of the lines: "stage" for the unstaged changes (they can be staged or discarded), "unstage" for the staged ones. -
keys
The keys, in the order they were selected. -
contains
Whether the line is selected in this section. -
anchor
public int anchor()The row that was clicked last; the start of a range made with Shift. -
toggle
Selects or unselects one line; a line of the other section replaces the selection. Returns whether the line is selected now. -
paint
Selects or unselects a range of lines (as one drag or a click with Shift does); lines of the other section replace the selection. -
retain
Takes lines out of the selection, for example those that are gone from the diff after something was staged.
-