- java.lang.Object
-
- org.scijava.AbstractContextual
-
- org.scijava.plugin.AbstractRichPlugin
-
- org.scijava.service.AbstractService
-
- org.scijava.desktop.DefaultDesktopService
-
- All Implemented Interfaces:
Comparable<org.scijava.Prioritized>,org.scijava.Contextual,DesktopService,org.scijava.Disposable,org.scijava.Identifiable,org.scijava.Initializable,org.scijava.Locatable,org.scijava.log.Logged,org.scijava.plugin.HasPluginInfo,org.scijava.plugin.RichPlugin,org.scijava.plugin.SciJavaPlugin,org.scijava.Prioritized,org.scijava.service.SciJavaService,org.scijava.service.Service,org.scijava.Versioned
public class DefaultDesktopService extends org.scijava.service.AbstractService implements DesktopService
Default implementation ofDesktopService.- Author:
- Curtis Rueden
-
-
Constructor Summary
Constructors Constructor Description DefaultDesktopService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddFileType(String extension, String mimeType, String description)Adds a single file type.voidaddFileTypes(org.scijava.object.LazyObjects<FileType> fileTypes)Adds a batch of file types to be coelesced lazily at registration time.StringgetDescription(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).booleanisDesktopIconPresent()TODO javadocbooleanisDesktopIconToggleable()TODO javadocbooleanisFileExtensionsEnabled()TODO javadocbooleanisFileExtensionsToggleable()TODO javadocbooleanisWebLinksEnabled()TODO javadocbooleanisWebLinksToggleable()TODO javadocvoidonEvent(org.scijava.event.ContextCreatedEvent event)voidsyncDesktopIntegration(boolean webLinks, boolean desktopIcon, boolean fileTypes)Applies desktop integration settings.-
Methods inherited from class org.scijava.plugin.AbstractRichPlugin
getInfo, getPriority, setInfo, setPriority
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.scijava.desktop.DesktopService
addFileType, addFileTypes, addFileTypes
-
-
-
-
Method Detail
-
syncDesktopIntegration
public void syncDesktopIntegration(boolean webLinks, boolean desktopIcon, boolean fileTypes)Description copied from interface:DesktopServiceApplies desktop integration settings.The behavior of each setting is platform-specific; not all settings have an effect on every platform.
- Specified by:
syncDesktopIntegrationin interfaceDesktopService- Parameters:
webLinks- whether URI scheme handlers should be registereddesktopIcon- whether the application launcher entry should be presentfileTypes- whether file-extension associations should be registered
-
isDesktopIconToggleable
public boolean isDesktopIconToggleable()
Description copied from interface:DesktopServiceTODO javadoc- Specified by:
isDesktopIconToggleablein interfaceDesktopService
-
isDesktopIconPresent
public boolean isDesktopIconPresent()
Description copied from interface:DesktopServiceTODO javadoc- Specified by:
isDesktopIconPresentin interfaceDesktopService
-
isWebLinksToggleable
public boolean isWebLinksToggleable()
Description copied from interface:DesktopServiceTODO javadoc- Specified by:
isWebLinksToggleablein interfaceDesktopService
-
isWebLinksEnabled
public boolean isWebLinksEnabled()
Description copied from interface:DesktopServiceTODO javadoc- Specified by:
isWebLinksEnabledin interfaceDesktopService
-
isFileExtensionsToggleable
public boolean isFileExtensionsToggleable()
Description copied from interface:DesktopServiceTODO javadoc- Specified by:
isFileExtensionsToggleablein interfaceDesktopService
-
isFileExtensionsEnabled
public boolean isFileExtensionsEnabled()
Description copied from interface:DesktopServiceTODO javadoc- Specified by:
isFileExtensionsEnabledin interfaceDesktopService
-
addFileType
public void addFileType(String extension, String mimeType, String description)
Description copied from interface:DesktopServiceAdds a single file type.- Specified by:
addFileTypein interfaceDesktopService- Parameters:
extension- 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, ornullto synthesize one from the extension.
-
addFileTypes
public void addFileTypes(org.scijava.object.LazyObjects<FileType> fileTypes)
Description copied from interface:DesktopServiceAdds a batch of file types to be coelesced lazily at registration time.- Specified by:
addFileTypesin interfaceDesktopService- Parameters:
fileTypes- Lazy callback to be invoked later when file types are needed.
-
getFileTypes
public Map<String,String> getFileTypes()
Description copied from interface:DesktopServiceGets 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.- Specified by:
getFileTypesin interfaceDesktopService
-
getDescription
public String getDescription(String extension)
Description copied from interface:DesktopServiceGets the description for a given file type extension, or null if none.- Specified by:
getDescriptionin interfaceDesktopService
-
onEvent
public void onEvent(org.scijava.event.ContextCreatedEvent event)
-
-