private < E extends Event > EventHandler < E > buildEventHandler ( final Class < ? extends EventAdapter > adapterClass , final Class < ? extends EventHandler < E > > handlerClass ) throws CoreException { EventHandler < E > eventHandler = null ; // Build the mouse handler instance if ( adapterClass . isAssignableFrom ( this . getClass ( ) ) ) { eventHandler = wrapbuildHandler ( this , adapterClass , handlerClass ) ; } else { throw new CoreException ( this . getClass ( ) . getName ( ) + " must implement " + adapterClass . getName ( ) + " interface" ) ; } return eventHandler ; }
Build an event handler by reflection using the Controller object as eventAdapter .