#NEWLINE# def moveFocus( self , selection ) : #NEWLINE# #INDENT# focusableWidget = selection . getFocusableWidget ( ) #NEWLINE# if ( focusableWidget is not None ) : #NEWLINE# #INDENT# focusableWidget . setFocus ( True ) #NEWLINE# DOM . scrollIntoView ( focusableWidget . getElement ( ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# selectedElem = selection . getContentElem ( ) #NEWLINE# containerLeft = self . getAbsoluteLeft ( ) #NEWLINE# containerTop = self . getAbsoluteTop ( ) #NEWLINE# left = ( DOM . getAbsoluteLeft ( selectedElem ) - containerLeft ) #NEWLINE# top = ( DOM . getAbsoluteTop ( selectedElem ) - containerTop ) #NEWLINE# width = DOM . getIntAttribute ( selectedElem , 'offsetWidth' ) #NEWLINE# height = DOM . getIntAttribute ( selectedElem , 'offsetHeight' ) #NEWLINE# DOM . setIntStyleAttribute ( self . focusable , 'left' , ( '%spx' % left ) ) #NEWLINE# DOM . setIntStyleAttribute ( self . focusable , 'top' , ( '%spx' % top ) ) #NEWLINE# DOM . setIntStyleAttribute ( self . focusable , 'width' , ( '%spx' % width ) ) #NEWLINE# DOM . setIntStyleAttribute ( self . focusable , 'height' , ( '%spx' % height ) ) #NEWLINE# DOM . scrollIntoView ( self . focusable ) #NEWLINE# Focus . focus ( self . focusable )