Interface Host

All Known Implementing Classes:
MainView

public interface Host
What views need from the application window.
  • Method Summary

    Modifier and Type
    Method
    Description
    ai()
    The connection to AI services (switched off unless the settings say otherwise).
    default void
    aiBusy(boolean on)
    An AI command starts (true) or ends (false): the window shows a spinner while at least one runs (feature 30).
    The global settings as last saved.
    default Avatars
    The pictures of the authors (feature 59); none by default, so a host without them shows the initials.
    void
    Closes the dialog shown with showDialog(javafx.scene.layout.Region).
    The accounts and their secrets.
    The commit labels.
    void
    A real repository was reloaded: the library entry (branch, changes, ahead/behind) may have changed.
    default ProjectLogos
    The logos of the projects (feature 61); none by default.
    default void
    openFile(Path file)
    Opens the file with the program the system has for it (feature 12), in the background; a failure comes as a toast.
    default void
    Opens a web address (http or https) in the default browser, in the background; a failure comes as a toast.
    default void
    Opens a terminal in the folder (feature 11), in the background; a failure comes as a toast.
    default void
    runTool(String name, List<String> command, Path workDir)
    Starts a program of the tools list (feature 13) in the background; a failure comes as a toast.
    The Git service all real repositories are used through.
    The look settings; the changes of them go to the window.
    void
    showDialog(javafx.scene.layout.Region dialog)
    Shows a larger dialog (settings) over the window.
    default void
    showInFileManager(Path repo, String relPath)
    Shows the repository, or one of its files, in the system's file manager (feature 10).
    void
    Shows a form dialog over the window.
    void
    Called when the state of a repository changed in a way that affects the status bar.
    Describes commits with AI; remembers the answers.
    The active colour theme (needed by popups, which have their own scene).
    void
    toast(String text, Tone tone)
    Shows a short message that goes away by itself.
    default void
    toast(String text, Tone tone, String action, Runnable onAction)
    A toast with one button, e.g.
    default UserBook
    The user mapping (feature 26); an empty one when the feature is off.
    default void
    The user mapping file was changed: load it again and redraw.
    void
    A look or layout setting changed (e.g. a panel was resized): save it.
    void
    Runs action (an operation that talks to a remote) once the stored credentials can be used: if they are locked, the user is asked for the master password first.
  • Method Details

    • settings

      ViewSettings settings()
      The look settings; the changes of them go to the window.
    • appSettings

      AppSettings appSettings()
      The global settings as last saved.
    • ai

      AiService ai()
      The connection to AI services (switched off unless the settings say otherwise).
    • summarizer

      CommitSummarizer summarizer()
      Describes commits with AI; remembers the answers.
    • labels

      LabelService labels()
      The commit labels.
    • credentials

      CredentialService credentials()
      The accounts and their secrets.
    • withCredentials

      void withCredentials(Runnable action)
      Runs action (an operation that talks to a remote) once the stored credentials can be used: if they are locked, the user is asked for the master password first. If they decline, the action runs anyway: SSH agents and credential helpers may still work.
    • showInFileManager

      default void showInFileManager(Path repo, String relPath)
      Shows the repository, or one of its files, in the system's file manager (feature 10). Runs in the background and reports a failure as a toast; uses the command from the settings when there is one.
      Parameters:
      relPath - the file inside the repository, or null for the repository's folder
    • runTool

      default void runTool(String name, List<String> command, Path workDir)
      Starts a program of the tools list (feature 13) in the background; a failure comes as a toast.
    • openFile

      default void openFile(Path file)
      Opens the file with the program the system has for it (feature 12), in the background; a failure comes as a toast.
    • aiBusy

      default void aiBusy(boolean on)
      An AI command starts (true) or ends (false): the window shows a spinner while at least one runs (feature 30). Calls come in pairs from the UI thread.
    • logos

      default ProjectLogos logos()
      The logos of the projects (feature 61); none by default.
    • avatars

      default Avatars avatars()
      The pictures of the authors (feature 59); none by default, so a host without them shows the initials.
    • openInTerminal

      default void openInTerminal(Path dir)
      Opens a terminal in the folder (feature 11), in the background; a failure comes as a toast. Uses the terminal and the command of the settings.
    • openInBrowser

      default void openInBrowser(String url)
      Opens a web address (http or https) in the default browser, in the background; a failure comes as a toast. Only the address is handed over, nothing is sent.
    • theme

      Theme theme()
      The active colour theme (needed by popups, which have their own scene).
    • toast

      void toast(String text, Tone tone)
      Shows a short message that goes away by itself.
    • toast

      default void toast(String text, Tone tone, String action, Runnable onAction)
      A toast with one button, e.g. Undo; it stays a little longer. A host that cannot show buttons shows the text only.
    • showModal

      void showModal(ModalSpec spec)
      Shows a form dialog over the window.
    • showDialog

      void showDialog(javafx.scene.layout.Region dialog)
      Shows a larger dialog (settings) over the window.
    • closeDialog

      void closeDialog()
      Closes the dialog shown with showDialog(javafx.scene.layout.Region).
    • statusChanged

      void statusChanged()
      Called when the state of a repository changed in a way that affects the status bar.
    • viewSettingsChanged

      void viewSettingsChanged()
      A look or layout setting changed (e.g. a panel was resized): save it.
    • users

      default UserBook users()
      The user mapping (feature 26); an empty one when the feature is off.
    • usersChanged

      default void usersChanged()
      The user mapping file was changed: load it again and redraw.
    • service

      The Git service all real repositories are used through.
    • libraryEntryChanged

      void libraryEntryChanged(LibraryEntry entry)
      A real repository was reloaded: the library entry (branch, changes, ahead/behind) may have changed.