-
- All Known Implementing Classes:
LinuxPlatform,MacOSPlatform,WindowsPlatform
public interface DesktopIntegrationProviderMarker interface for platform implementations that provide desktop integration features.- Author:
- Curtis Rueden
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description SchemeInstallergetSchemeInstaller()Creates a SchemeInstaller for this platform.booleanisDesktopIconPresent()booleanisDesktopIconToggleable()booleanisFileExtensionsEnabled()booleanisFileExtensionsToggleable()booleanisWebLinksEnabled()booleanisWebLinksToggleable()voidsetDesktopIconPresent(boolean install)Installs or removes the desktop icon (application launcher, menu entry).voidsetFileExtensionsEnabled(boolean enable)Enables or disables file extension associations (e.g.,.tif,.png).voidsetWebLinksEnabled(boolean enable)Enables or disables URI scheme registration (e.g.,myapp://links).default voidsyncDesktopIntegration(boolean webLinks, boolean desktopIcon, boolean fileTypes)Atomically applies all three desktop integration settings at once.
-
-
-
Method Detail
-
isWebLinksEnabled
boolean isWebLinksEnabled()
-
isWebLinksToggleable
boolean isWebLinksToggleable()
-
setWebLinksEnabled
void setWebLinksEnabled(boolean enable) throws IOExceptionEnables or disables URI scheme registration (e.g.,myapp://links).This operation only works if
isWebLinksToggleable()returns true. Otherwise, calling this method may throwUnsupportedOperationException.- Parameters:
enable- whether to enable or disable web links- Throws:
IOException- if the operation failsUnsupportedOperationException- if not supported on this platform
-
isDesktopIconPresent
boolean isDesktopIconPresent()
-
isDesktopIconToggleable
boolean isDesktopIconToggleable()
-
setDesktopIconPresent
void setDesktopIconPresent(boolean install) throws IOExceptionInstalls or removes the desktop icon (application launcher, menu entry).This operation only works if
isDesktopIconToggleable()returns true. Otherwise, calling this method may throwUnsupportedOperationException.- Parameters:
install- whether to install or remove the desktop icon- Throws:
IOException- if the operation failsUnsupportedOperationException- if not supported on this platform
-
isFileExtensionsEnabled
boolean isFileExtensionsEnabled()
-
isFileExtensionsToggleable
boolean isFileExtensionsToggleable()
-
setFileExtensionsEnabled
void setFileExtensionsEnabled(boolean enable) throws IOExceptionEnables or disables file extension associations (e.g.,.tif,.png).This operation only works if
isFileExtensionsToggleable()returns true. Otherwise, calling this method may throwUnsupportedOperationException.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 failsUnsupportedOperationException- if not supported on this platform
-
syncDesktopIntegration
default void syncDesktopIntegration(boolean webLinks, boolean desktopIcon, boolean fileTypes) throws IOExceptionAtomically applies all three desktop integration settings at once.Implementations that store all three settings in a single artifact (e.g. a Linux
.desktopfile) 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 registereddesktopIcon- whether the application launcher entry should be presentfileTypes- 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
-
-