private void processViewAnnotation ( ) { // Find the AutoHandler annotation if any because it's optional final AutoHandler ah = ClassUtility . getLastClassAnnotation ( this . getClass ( ) , AutoHandler . class ) ; // Use the annotation value to define the callbackObject : View or Controller // When controller is null always use the view as callbackObject if ( ah != null && ah . value ( ) == CallbackObject . View || controller ( ) == null ) { this . callbackObject = this ; } else { // by default use the controller object as callback object this . callbackObject = this . controller ( ) ; } // Find the RootNodeId annotation final RootNodeId rni = ClassUtility . getLastClassAnnotation ( this . getClass ( ) , RootNodeId . class ) ; if ( rni != null ) { node ( ) . setId ( rni . value ( ) . isEmpty ( ) ? this . getClass ( ) . getSimpleName ( ) : rni . value ( ) ) ; } // Find the RootNodeClass annotation final RootNodeClass rnc = ClassUtility . getLastClassAnnotation ( this . getClass ( ) , RootNodeClass . class ) ; if ( rnc != null && rnc . value ( ) . length > 0 ) { for ( final String styleClass : rnc . value ( ) ) { if ( styleClass != null && ! styleClass . isEmpty ( ) ) { node ( ) . getStyleClass ( ) . add ( styleClass ) ; } } } // Process Event Handler Annotation // For each View class annotation we will attach an event handler to the root node for ( final Annotation a : this . getClass ( ) . getAnnotations ( ) ) { // Manage only JRebirth OnXxxxx annotations if ( a . annotationType ( ) . getName ( ) . startsWith ( BASE_ANNOTATION_NAME ) ) { try { // Process the annotation if the node is not null if ( node ( ) != null && controller ( ) instanceof AbstractController ) { addHandler ( node ( ) , a ) ; } } catch ( IllegalArgumentException | CoreException e ) { LOGGER . log ( UIMessages . VIEW_ANNO_PROCESSING_FAILURE , e , this . getClass ( ) . getName ( ) ) ; } } } }
Process view annotation .