protected TagRenderingBase renderSelectionLink ( AbstractRenderAppender writer , TreeElement node , String nodeName , AttributeRenderer attrs , InheritableState state ) throws JspException { // calculate the selection link for this node String selectionLink = getSelectionlink ( node , nodeName , state ) ; TagRenderingBase endRender = null ; // if there is a selection link we need to put an anchor out. if ( selectionLink != null ) { _anchorState . clear ( ) ; _anchorState . href = selectionLink ; String target = node . getTarget ( ) ; if ( target == null ) { target = state . getSelectionTarget ( ) ; } _anchorState . registerAttribute ( AbstractHtmlState . ATTR_GENERAL , TARGET , target ) ; String title = node . getTitle ( ) ; _anchorState . registerAttribute ( AbstractHtmlState . ATTR_GENERAL , TITLE , title ) ; // set the selection styles if ( node . isSelected ( ) ) { _anchorState . style = _trs . selectedStyle ; _anchorState . styleClass = _trs . selectedStyleClass ; } else { _anchorState . style = _trs . unselectedStyle ; _anchorState . styleClass = _trs . unselectedStyleClass ; } if ( _anchorState . style == null && _anchorState . styleClass == null ) { _anchorState . style = "text-decoration: none" ; } // render any attributes applied to the HTML attrs . renderSelectionLink ( _anchorState , node ) ; // render the runAtClient attributes if ( _trs . runAtClient ) { String action = node . getClientAction ( ) ; if ( action != null ) { action = HtmlUtils . escapeEscapes ( action ) ; action = ScriptRequestState . getString ( "netuiAction" , new Object [ ] { action } ) ; } _anchorState . registerAttribute ( AbstractHtmlState . ATTR_JAVASCRIPT , ONCLICK , action ) ; // Jira 299 //_anchorState.onClick = action; } // actually render the anchor. renderSelectionLinkPrefix ( writer , node ) ; _anchorRenderer . doStartTag ( writer , _anchorState ) ; endRender = _anchorRenderer ; } else { // This node doesn's support selection. This means we consider it disabled. We will // put a span around it and set the style/class to indicate that it is disabled. _spanState . clear ( ) ; _spanState . styleClass = _trs . disabledStyleClass ; _spanState . style = _trs . disabledStyle ; renderSelectionLinkPrefix ( writer , node ) ; _spanRenderer . doStartTag ( writer , _spanState ) ; endRender = _spanRenderer ; } return endRender ; }
If needed render the selection link around the icon for this node . Note that the tag rendered here needs to be closed after the actual icon and label are rendered .