#NEWLINE# def moveAfterSibling( self , itemId , siblingId ) : #NEWLINE# #INDENT# 'Moves a node (an Item) in the container immediately after a sibling\n        node. The two nodes must have the same parent in the container.\n\n        @param itemId:\n                   the identifier of the moved node (Item)\n        @param siblingId:\n                   the identifier of the reference node (Item), after which the\n                   other node will be located\n        ' #NEWLINE# parent2 = self . getParent ( itemId ) #NEWLINE# if ( parent2 is None ) : #NEWLINE# #INDENT# childrenList = self . _roots #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# childrenList = self . _children . get ( parent2 ) #NEWLINE# #UNINDENT# if ( siblingId is None ) : #NEWLINE# #INDENT# childrenList . remove ( newIndex ) #NEWLINE# childrenList . insert ( 0 , itemId ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# oldIndex = childrenList . index ( itemId ) #NEWLINE# indexOfSibling = childrenList . index ( siblingId ) #NEWLINE# if ( ( indexOfSibling != ( - 1 ) ) and ( oldIndex != ( - 1 ) ) ) : #NEWLINE# #INDENT# if ( oldIndex > indexOfSibling ) : #NEWLINE# #INDENT# newIndex = ( indexOfSibling + 1 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# newIndex = indexOfSibling #NEWLINE# #UNINDENT# del childrenList [ oldIndex ] #NEWLINE# childrenList . insert ( newIndex , itemId ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise ValueError ( 'Given identifiers do not have the same parent.' ) #NEWLINE# #UNINDENT# #UNINDENT# self . fireItemSetChange ( )