Interface DesktopService

  • All Superinterfaces:
    Comparable<org.scijava.Prioritized>, org.scijava.Contextual, org.scijava.Disposable, org.scijava.plugin.HasPluginInfo, org.scijava.Identifiable, org.scijava.Initializable, org.scijava.Locatable, org.scijava.log.Logged, org.scijava.Prioritized, org.scijava.plugin.RichPlugin, org.scijava.plugin.SciJavaPlugin, org.scijava.service.SciJavaService, org.scijava.service.Service, org.scijava.Versioned
    All Known Implementing Classes:
    DefaultDesktopService

    public interface DesktopService
    extends org.scijava.service.SciJavaService
    Service interface for an application's desktop-related concerns.
    Author:
    Curtis Rueden
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default void addFileType​(String ext, String mimeType)
      Adds a single file type.
      void addFileType​(String ext, String mimeType, String description)
      Adds a single file type.
      default void addFileTypes​(List<String> extensions, String mimeType)
      Adds a batch of file types sharing the same MIME type or wildcard.
      default void addFileTypes​(List<String> extensions, String mimeType, String description)
      Adds a batch of file types sharing the same MIME type or wildcard.
      void addFileTypes​(org.scijava.object.LazyObjects<FileType> fileTypes)
      Adds a batch of file types to be coelesced lazily at registration time.
      String getDescription​(String extension)
      Gets the description for a given file type extension, or null if none.
      Map<String,​String> getFileTypes()
      Gets the map of supported file types (extension → MIME type).
      boolean isDesktopIconPresent()
      TODO javadoc
      boolean isDesktopIconToggleable()
      TODO javadoc
      boolean isFileExtensionsEnabled()
      TODO javadoc
      boolean isFileExtensionsToggleable()
      TODO javadoc
      boolean isWebLinksEnabled()
      TODO javadoc
      boolean isWebLinksToggleable()
      TODO javadoc
      void syncDesktopIntegration​(boolean webLinks, boolean desktopIcon, boolean fileTypes)
      Applies desktop integration settings.
      • Methods inherited from interface org.scijava.Contextual

        context, getContext, setContext
      • Methods inherited from interface org.scijava.Disposable

        dispose
      • Methods inherited from interface org.scijava.plugin.HasPluginInfo

        getInfo, setInfo
      • Methods inherited from interface org.scijava.Locatable

        getLocation
      • Methods inherited from interface org.scijava.Prioritized

        compareTo, getPriority, setPriority
      • Methods inherited from interface org.scijava.plugin.RichPlugin

        getIdentifier, log
      • Methods inherited from interface org.scijava.service.Service

        initialize, registerEventHandlers
      • Methods inherited from interface org.scijava.Versioned

        getVersion
    • 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.