- java.lang.Object
-
- org.scijava.platform.AbstractPlatform
-
- org.scijava.desktop.platform.macos.MacOSPlatform
-
- All Implemented Interfaces:
DesktopIntegrationProvider,org.scijava.Disposable,org.scijava.platform.Platform,org.scijava.plugin.SciJavaPlugin,org.scijava.plugin.SingletonPlugin
public class MacOSPlatform extends org.scijava.platform.AbstractPlatform implements DesktopIntegrationProvider
A platform implementation for handling Apple macOS platform issues:- Application events are rebroadcast as SciJava events.
- macOS screen menu bar is enabled.
- Special screen menu bar menu items are handled.
- Author:
- Curtis Rueden
-
-
Constructor Summary
Constructors Constructor Description MacOSPlatform()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconfigure(org.scijava.platform.PlatformService service)voiddispose()SchemeInstallergetSchemeInstaller()Creates a SchemeInstaller for this platform.booleanisDesktopIconPresent()booleanisDesktopIconToggleable()booleanisFileExtensionsEnabled()booleanisFileExtensionsToggleable()booleanisWebLinksEnabled()booleanisWebLinksToggleable()protected voidonEvent(org.scijava.display.event.window.WinActivatedEvent evt)voidopen(URL url)StringosName()booleanregisterAppMenus(Object menus)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).-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.scijava.desktop.DesktopIntegrationProvider
syncDesktopIntegration
-
-
-
-
Method Detail
-
osName
public String osName()
- Specified by:
osNamein interfaceorg.scijava.platform.Platform
-
configure
public void configure(org.scijava.platform.PlatformService service)
- Specified by:
configurein interfaceorg.scijava.platform.Platform- Overrides:
configurein classorg.scijava.platform.AbstractPlatform
-
open
public void open(URL url) throws IOException
- Specified by:
openin interfaceorg.scijava.platform.Platform- Throws:
IOException
-
registerAppMenus
public boolean registerAppMenus(Object menus)
- Specified by:
registerAppMenusin interfaceorg.scijava.platform.Platform
-
isWebLinksEnabled
public boolean isWebLinksEnabled()
- Specified by:
isWebLinksEnabledin interfaceDesktopIntegrationProvider
-
isWebLinksToggleable
public boolean isWebLinksToggleable()
- Specified by:
isWebLinksToggleablein interfaceDesktopIntegrationProvider
-
setWebLinksEnabled
public void setWebLinksEnabled(boolean enable)
Description copied from interface:DesktopIntegrationProviderEnables or disables URI scheme registration (e.g.,myapp://links).This operation only works if
DesktopIntegrationProvider.isWebLinksToggleable()returns true. Otherwise, calling this method may throwUnsupportedOperationException.- Specified by:
setWebLinksEnabledin interfaceDesktopIntegrationProvider- Parameters:
enable- whether to enable or disable web links
-
isDesktopIconPresent
public boolean isDesktopIconPresent()
- Specified by:
isDesktopIconPresentin interfaceDesktopIntegrationProvider
-
isDesktopIconToggleable
public boolean isDesktopIconToggleable()
- Specified by:
isDesktopIconToggleablein interfaceDesktopIntegrationProvider
-
setDesktopIconPresent
public void setDesktopIconPresent(boolean install)
Description copied from interface:DesktopIntegrationProviderInstalls or removes the desktop icon (application launcher, menu entry).This operation only works if
DesktopIntegrationProvider.isDesktopIconToggleable()returns true. Otherwise, calling this method may throwUnsupportedOperationException.- Specified by:
setDesktopIconPresentin interfaceDesktopIntegrationProvider- Parameters:
install- whether to install or remove the desktop icon
-
isFileExtensionsEnabled
public boolean isFileExtensionsEnabled()
- Specified by:
isFileExtensionsEnabledin interfaceDesktopIntegrationProvider
-
isFileExtensionsToggleable
public boolean isFileExtensionsToggleable()
- Specified by:
isFileExtensionsToggleablein interfaceDesktopIntegrationProvider
-
setFileExtensionsEnabled
public void setFileExtensionsEnabled(boolean enable)
Description copied from interface:DesktopIntegrationProviderEnables or disables file extension associations (e.g.,.tif,.png).This operation only works if
DesktopIntegrationProvider.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.
- Specified by:
setFileExtensionsEnabledin interfaceDesktopIntegrationProvider- Parameters:
enable- whether to enable or disable file extension associations
-
getSchemeInstaller
public SchemeInstaller getSchemeInstaller()
Description copied from interface:DesktopIntegrationProviderCreates a SchemeInstaller for this platform.- Specified by:
getSchemeInstallerin interfaceDesktopIntegrationProvider- Returns:
- a SchemeInstaller, or null if not supported on this platform
-
dispose
public void dispose()
- Specified by:
disposein interfaceorg.scijava.Disposable
-
onEvent
protected void onEvent(org.scijava.display.event.window.WinActivatedEvent evt)
-
-