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
ConstructorsModifierConstructorDescriptionprotectedOSXAdapter(String proxySignature, Object target, Method handler) -
Method Summary
Modifier and TypeMethodDescriptionbooleancallTarget(Object appleEvent) protected booleanisCorrectMethod(Method method, Object[] args) static voidsetAboutHandler(Object target, Method aboutHandler) protected voidsetApplicationEventHandled(Object event, boolean handled) static voidsetFileHandler(Object target, Method fileHandler) static voidsetHandler(OSXAdapter adapter) static voidsetPreferencesHandler(Object target, Method prefsHandler) static voidsetQuitHandler(Object target, Method quitHandler)
-
Field Details
-
targetObject
-
targetMethod
-
proxySignature
-
-
Constructor Details
-
OSXAdapter
-
-
Method Details
-
setQuitHandler
-
setAboutHandler
-
setPreferencesHandler
-
setFileHandler
-
setHandler
-
callTarget
public boolean callTarget(Object appleEvent) throws InvocationTargetException, IllegalAccessException -
invoke
- Specified by:
invokein interfaceInvocationHandler- Throws:
Throwable
-
isCorrectMethod
-
setApplicationEventHandled
-