private String getApplicationTitle ( final UIContext uic ) { WComponent root = uic . getUI ( ) ; String title = root instanceof WApplication ? ( ( WApplication ) root ) . getTitle ( ) : null ; Map < String , String > params = uic . getEnvironment ( ) . getHiddenParameters ( ) ; String target = params . get ( WWindow . WWINDOW_REQUEST_PARAM_KEY ) ; if ( target != null ) { ComponentWithContext targetComp = WebUtilities . getComponentById ( target , true ) ; if ( targetComp != null && targetComp . getComponent ( ) instanceof WWindow ) { try { UIContextHolder . pushContext ( targetComp . getContext ( ) ) ; title = ( ( WWindow ) targetComp . getComponent ( ) ) . getTitle ( ) ; } finally { UIContextHolder . popContext ( ) ; } } } return title == null ? "" : title ; }
Retrieves the application title for the given context . This mess is required due to WWindow essentially existing as a separate UI root . If WWindow is eventually removed then we can just retrieve the title from the root WApplication .