Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

org.madlonkay:desktopsupport

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

org.madlonkay:desktopsupport

A library to bridge Apple Java Extensions and JEP 272 desktop APIs

  • 0.6.0
  • Source
  • Maven
  • Socket score

Version published
Maintainers
1
Source

DesktopSupport Library for Java

This library bridges the Apple Java Extensions APIs and the JEP 272 desktop APIs added in Java 9. It is intended for use by applications that want to support running on both Java 8 and Java 11.

  • Apple Java Extensions
  • Apple Java Extensions Javadoc
  • JEP 272: Platform-Specific Desktop Features

Implementation

This library wraps a subset of the com.apple.eawt.Application API and delegates to whichever actual implementation is available: Apple or Java 9+, or a dummy no-op implementation if neither.

Thus it is safe to call the API anywhere, without checking the platform first. Note, however, that listeners and handlers will never be called under the no-op implementation, so critical logic must not be placed there.

Java versionPlatformImplementation
Java 8macOScom.apple.eawt.*
Java 8OtherNo-op
Java 11Anyjava.awt.*

Coverage

  • Non-deprecated methods on com.apple.eawt.Application
  • Methods on com.apple.eawt.FullScreenUtilities
  • UIManager#createLookAndFeel from Java 9+

Requirements

Java 8+ is required to run.

Java 11 is required in order to build.

Usage

Add the dependency:

implementation 'org.madlonkay:desktopsupport:+'

Call methods on DesktopSupport.getSupport():

DesktopSupport.getSupport().disableSuddenTermination();
DesktopSupport.getSupport().setAboutHandler(e -> {
    // handle About event
});

The API is meant to mostly match the ones it wraps, but it is not quite a drop-in replacement:

  • Event objects that have no methods or payloads (e.g. AboutEvent) are just EventObject
  • FullScreenUtilities (Apple) and Taskbar/GraphicsEnvironment/etc. (Java 9) methods are on IDesktopSupport with everything else rather than in a separate class

License

Apache 2.0

FAQs

Package last updated on 30 Jun 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc