private void addChildren ( final UIClassification _parent , final Set < Classification > _children , final Set < UUID > _selectedUUID , final Instance _instance ) throws EFapsException { for ( final Classification child : _children ) { boolean access ; if ( ! child . isAbstract ( ) ) { final Instance inst = AbstractInstanceObject . getInstance4Create ( child ) ; access = child . hasAccess ( inst , getMode ( ) == TargetMode . CREATE || getMode ( ) == TargetMode . EDIT ? AccessTypeEnums . CREATE . getAccessType ( ) : AccessTypeEnums . SHOW . getAccessType ( ) ) ; } else { access = true ; } if ( access ) { final UIClassification childUI = new UIClassification ( child . getUUID ( ) , _parent . mode , false ) ; if ( _selectedUUID . contains ( child . getUUID ( ) ) ) { childUI . selected = true ; } childUI . addChildren ( childUI , child . getChildClassifications ( ) , _selectedUUID , _instance ) ; _parent . children . add ( childUI ) ; childUI . setParent ( _parent ) ; } } Collections . sort ( _parent . children , new Comparator < UIClassification > ( ) { @ Override public int compare ( final UIClassification _class0 , final UIClassification _class2 ) { return _class0 . getLabel ( ) . compareTo ( _class2 . getLabel ( ) ) ; } } ) ; }
Recursive method used to add the children to this UIClassification .