Interface DesktopService

    • Method Detail

      • syncDesktopIntegration

        void syncDesktopIntegration​(boolean webLinks,
                                    boolean desktopIcon,
                                    boolean fileTypes)
        Applies desktop integration settings.

        The behavior of each setting is platform-specific; not all settings have an effect on every platform.

        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
      • isDesktopIconToggleable

        boolean isDesktopIconToggleable()
        TODO javadoc
      • isDesktopIconPresent

        boolean isDesktopIconPresent()
        TODO javadoc
      • isWebLinksToggleable

        boolean isWebLinksToggleable()
        TODO javadoc
      • isWebLinksEnabled

        boolean isWebLinksEnabled()
        TODO javadoc
      • isFileExtensionsToggleable

        boolean isFileExtensionsToggleable()
        TODO javadoc
      • isFileExtensionsEnabled

        boolean isFileExtensionsEnabled()
        TODO javadoc
      • addFileType

        default void addFileType​(String ext,
                                 String mimeType)
        Adds a single file type.
        Parameters:
        ext - File extension without leading dot (e.g. "png").
        mimeType - MIME type (e.g. "image/png"), or a wildcard of the form "category/*" (e.g. "image/*") if the specific type is unknown. Wildcard values are resolved against the bundled MIME database by extension; if still unresolved, the sentinel is preserved for platform-specific code to handle at OS registration time.
      • addFileType

        void addFileType​(String ext,
                         String mimeType,
                         String description)
        Adds a single file type.
        Parameters:
        ext - File extension without leading dot (e.g. "png").
        mimeType - MIME type (e.g. "image/png"), or a wildcard of the form "category/*" (e.g. "image/*") if the specific type is unknown. Wildcard values are resolved against the bundled MIME database by extension; if still unresolved, the sentinel is preserved for platform-specific code to handle at OS registration time.
        description - Human-readable description of the file type (e.g. "Gatan Digital Micrograph image"), used as the label when registering a custom MIME type, or null to synthesize one from the extension.
      • addFileTypes

        default void addFileTypes​(List<String> extensions,
                                  String mimeType)
        Adds a batch of file types sharing the same MIME type or wildcard. Equivalent to calling addFileType(String, String) for each extension.
        Parameters:
        extensions - File extensions without leading dot (e.g. "tiff", "tif").
        mimeType - MIME type or wildcard; see addFileType(String, String).
      • addFileTypes

        void addFileTypes​(org.scijava.object.LazyObjects<FileType> fileTypes)
        Adds a batch of file types to be coelesced lazily at registration time.
        Parameters:
        fileTypes - Lazy callback to be invoked later when file types are needed.
      • getFileTypes

        Map<String,​String> getFileTypes()
        Gets the map of supported file types (extension → MIME type).

        Values ending in "/*" (e.g. "image/*") are unresolved sentinels, meaning the specific MIME type is not yet known. Callers that write OS registrations should resolve these against the system MIME database and synthesize a concrete type (e.g. "image/x-dm3") if still unresolved.

      • getDescription

        String getDescription​(String extension)
        Gets the description for a given file type extension, or null if none.