Interface DiffView.Actions
- Enclosing class:
DiffView
public static interface DiffView.Actions
Callbacks into the owning repository view.
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Goes back to the history.default intHow many unchanged lines are shown around a change (seeDiffView.CONTEXT_CHOICES).default voiddiscardLines(Set<String> keys, boolean hunk) The user pressed Discard lines (or Discard hunk,hunk) for lines of the unstaged changes with these keys.default voidThe user pressed the button of a hunk:actionis "stage" or "unstage",headerits @@ line.default booleanWhether picture files are shown as pictures (the file can be read from the repository and the diff is of one commit).default voidThe user pressed Stage lines or Unstage lines (actionis "stage" or "unstage") for lines with these keys.default LineSelectionThe lines selected in the diff of the working tree (feature 50); null where lines cannot be staged (a commit, a sample).default voidloadImages(Consumer<ImageFiles.Versions> onLoaded) Reads the picture before and after the change and hands it toonLoadedon the UI thread; null if it cannot be read.default voidloadPreview(Consumer<String> onText) Reads the text of the file (its new version) and hands it toonTexton the UI thread; null if it cannot be read.voidopen(FileChange file) Opens another file of the same commit or change.default voidThe user clicked a link of the preview.default booleanWhether the file can be shown rendered (a Markdown file whose text can be read); the tab bar is only there then.default booleanWhether the preview tab was chosen: kept while the diff view is made again.default voidsetContext(int lines) The user chose another number of context lines.default voidsetPreviewSelected(boolean on) voidsetSplit(boolean split) Switches between the unified and the side-by-side diff.default voidsetWrapLines(boolean wrap) The user switched the wrapping of long lines on or off.default booleanWhether long lines are wrapped (else the diff scrolls sideways).
-
Method Details
-
close
void close()Goes back to the history. -
open
Opens another file of the same commit or change. -
setSplit
void setSplit(boolean split) Switches between the unified and the side-by-side diff. -
wrapLines
default boolean wrapLines()Whether long lines are wrapped (else the diff scrolls sideways). -
setWrapLines
default void setWrapLines(boolean wrap) The user switched the wrapping of long lines on or off. -
previewAvailable
default boolean previewAvailable()Whether the file can be shown rendered (a Markdown file whose text can be read); the tab bar is only there then. -
loadPreview
Reads the text of the file (its new version) and hands it toonTexton the UI thread; null if it cannot be read. -
previewSelected
default boolean previewSelected()Whether the preview tab was chosen: kept while the diff view is made again. -
setPreviewSelected
default void setPreviewSelected(boolean on) -
imagesAvailable
default boolean imagesAvailable()Whether picture files are shown as pictures (the file can be read from the repository and the diff is of one commit). -
loadImages
Reads the picture before and after the change and hands it toonLoadedon the UI thread; null if it cannot be read. -
openLink
The user clicked a link of the preview. -
contextLines
default int contextLines()How many unchanged lines are shown around a change (seeDiffView.CONTEXT_CHOICES). -
setContext
default void setContext(int lines) The user chose another number of context lines. -
hunk
The user pressed the button of a hunk:actionis "stage" or "unstage",headerits @@ line. -
lineSelection
The lines selected in the diff of the working tree (feature 50); null where lines cannot be staged (a commit, a sample). -
lines
The user pressed Stage lines or Unstage lines (actionis "stage" or "unstage") for lines with these keys. -
discardLines
The user pressed Discard lines (or Discard hunk,hunk) for lines of the unstaged changes with these keys.
-