Package org.apache.pdfbox.debugger.ui
Class OSXAdapter
java.lang.Object
org.apache.pdfbox.debugger.ui.OSXAdapter
- All Implemented Interfaces:
InvocationHandler
Hooks existing preferences/about/quit functionality from an
existing Java app into handlers for the Mac OS X application menu.
Uses a Proxy object to dynamically implement the
com.apple.eawt.ApplicationListener interface and register it with the
com.apple.eawt.Application object. This allows the complete project
to be both built and run on any platform without any stubs or
placeholders. Useful for developers looking to implement Mac OS X
features while supporting multiple platforms with minimal impact.
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
OSXAdapter
(String proxySignature, Object target, Method handler) -
Method Summary
Modifier and TypeMethodDescriptionboolean
callTarget
(Object appleEvent) protected boolean
isCorrectMethod
(Method method, Object[] args) private static boolean
static void
setAboutHandler
(Object target, Method aboutHandler) protected void
setApplicationEventHandled
(Object event, boolean handled) static void
setFileHandler
(Object target, Method fileHandler) static void
setHandler
(OSXAdapter adapter) static void
setPreferencesHandler
(Object target, Method prefsHandler) static void
setQuitHandler
(Object target, Method quitHandler)
-
Field Details
-
targetObject
-
targetMethod
-
proxySignature
-
macOSXApplication
-
-
Constructor Details
-
OSXAdapter
-
-
Method Details
-
isMinJdk9
private static boolean isMinJdk9() -
setQuitHandler
-
setAboutHandler
-
setPreferencesHandler
-
setFileHandler
-
setHandler
-
callTarget
public boolean callTarget(Object appleEvent) throws InvocationTargetException, IllegalAccessException -
invoke
- Specified by:
invoke
in interfaceInvocationHandler
- Throws:
Throwable
-
isCorrectMethod
-
setApplicationEventHandled
-