au.edu.jcu.hermes.util
Class OSXAdapter

java.lang.Object
  extended by au.edu.jcu.hermes.util.OSXAdapter
All Implemented Interfaces:
java.lang.reflect.InvocationHandler

public class OSXAdapter
extends java.lang.Object
implements java.lang.reflect.InvocationHandler


Field Summary
protected  java.lang.String proxySignature
           
protected  java.lang.reflect.Method targetMethod
           
protected  java.lang.Object targetObject
           
 
Constructor Summary
protected OSXAdapter(java.lang.String proxySignature, java.lang.Object target, java.lang.reflect.Method handler)
           
 
Method Summary
 boolean callTarget(java.lang.Object appleEvent)
           
 java.lang.Object invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args)
           
protected  boolean isCorrectMethod(java.lang.reflect.Method method, java.lang.Object[] args)
           
static void setAboutHandler(java.lang.Object target, java.lang.reflect.Method aboutHandler)
           
protected  void setApplicationEventHandled(java.lang.Object event, boolean handled)
           
static void setFileHandler(java.lang.Object target, java.lang.reflect.Method fileHandler)
           
static void setHandler(OSXAdapter adapter)
           
static void setPreferencesHandler(java.lang.Object target, java.lang.reflect.Method prefsHandler)
           
static void setQuitHandler(java.lang.Object target, java.lang.reflect.Method quitHandler)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

targetObject

protected java.lang.Object targetObject

targetMethod

protected java.lang.reflect.Method targetMethod

proxySignature

protected java.lang.String proxySignature
Constructor Detail

OSXAdapter

protected OSXAdapter(java.lang.String proxySignature,
                     java.lang.Object target,
                     java.lang.reflect.Method handler)
Method Detail

setQuitHandler

public static void setQuitHandler(java.lang.Object target,
                                  java.lang.reflect.Method quitHandler)

setAboutHandler

public static void setAboutHandler(java.lang.Object target,
                                   java.lang.reflect.Method aboutHandler)

setPreferencesHandler

public static void setPreferencesHandler(java.lang.Object target,
                                         java.lang.reflect.Method prefsHandler)

setFileHandler

public static void setFileHandler(java.lang.Object target,
                                  java.lang.reflect.Method fileHandler)

setHandler

public static void setHandler(OSXAdapter adapter)

callTarget

public boolean callTarget(java.lang.Object appleEvent)
                   throws java.lang.reflect.InvocationTargetException,
                          java.lang.IllegalAccessException
Throws:
java.lang.reflect.InvocationTargetException
java.lang.IllegalAccessException

invoke

public java.lang.Object invoke(java.lang.Object proxy,
                               java.lang.reflect.Method method,
                               java.lang.Object[] args)
                        throws java.lang.Throwable
Specified by:
invoke in interface java.lang.reflect.InvocationHandler
Throws:
java.lang.Throwable

isCorrectMethod

protected boolean isCorrectMethod(java.lang.reflect.Method method,
                                  java.lang.Object[] args)

setApplicationEventHandled

protected void setApplicationEventHandled(java.lang.Object event,
                                          boolean handled)