Interface LauncherPeer


public interface LauncherPeer
What a backend does for Launcher: hand an address or a file to the system its window is on.

A backend receives only what Launcher let through: an absolute address whose scheme the application allows, and an absolute path that existed when it was asked about. It owes three things in return. Each method returns at once: the systems' own calls can wait seconds on the program they start, so they are made off the UI thread. Each stage completes on the UI thread, after the event that asked and never inside it. And the answer is true when the system took what it was handed and false when it did not, with the reason logged, since nothing else says it; a method here does not throw for a refusal.

  • Field Details

    • NONE

      static final LauncherPeer NONE
      The peer of a window with no desktop under it: nothing is handed over.
  • Method Details

    • openAddress

      CompletionStage<Boolean> openAddress(URI address)
      Parameters:
      address - an absolute address of an allowed scheme
      Returns:
      whether the system took it
    • openFile

      CompletionStage<Boolean> openFile(Path file)
      Parameters:
      file - an absolute path that exists
      Returns:
      whether the system took it
    • showInFolder

      CompletionStage<Boolean> showInFolder(Path file)
      Parameters:
      file - an absolute path that exists
      Returns:
      whether the file manager was asked to show it; true as well where the system can open the folder but not select the file in it