Interface DesktopIntegrationProvider

  • All Known Implementing Classes:
    LinuxPlatform, MacOSPlatform, WindowsPlatform

    public interface DesktopIntegrationProvider
    Marker interface for platform implementations that provide desktop integration features.
    Author:
    Curtis Rueden
    • Method Detail

      • isWebLinksEnabled

        boolean isWebLinksEnabled()
      • isWebLinksToggleable

        boolean isWebLinksToggleable()
      • isDesktopIconPresent

        boolean isDesktopIconPresent()
      • isDesktopIconToggleable

        boolean isDesktopIconToggleable()
      • isFileExtensionsEnabled

        boolean isFileExtensionsEnabled()
      • isFileExtensionsToggleable

        boolean isFileExtensionsToggleable()
      • setFileExtensionsEnabled

        void setFileExtensionsEnabled​(boolean enable)
                               throws IOException
        Enables or disables file extension associations (e.g., .tif, .png).

        This operation only works if isFileExtensionsToggleable() returns true. Otherwise, calling this method may throw UnsupportedOperationException.

        When enabled, the application will be registered as a handler for all supported file extensions. The application appears in "Open With" menus, allowing users to choose it for specific file types.

        Parameters:
        enable - whether to enable or disable file extension associations
        Throws:
        IOException - if the operation fails
        UnsupportedOperationException - if not supported on this platform
      • syncDesktopIntegration

        default void syncDesktopIntegration​(boolean webLinks,
                                            boolean desktopIcon,
                                            boolean fileTypes)
                                     throws IOException
        Atomically applies all three desktop integration settings at once.

        Implementations that store all three settings in a single artifact (e.g. a Linux .desktop file) should override this method to synthesize that artifact in one pass rather than via three independent read-modify-write cycles.

        The default implementation calls the three individual setters in order, guarded by the corresponding isXxxToggleable() checks.

        Parameters:
        webLinks - whether URI scheme handlers should be registered
        desktopIcon - whether the application launcher entry should be present
        fileTypes - whether file-extension associations should be registered
        Throws:
        IOException - if any part of the update fails
      • getSchemeInstaller

        SchemeInstaller getSchemeInstaller()
        Creates a SchemeInstaller for this platform.
        Returns:
        a SchemeInstaller, or null if not supported on this platform