private List < Element > getClassElements ( final UIClassification _uiclass , final Map < UUID , String > _uuid2InstanceKey ) throws EFapsException { final List < Element > ret = new ArrayList <> ( ) ; if ( _uiclass . isSelected ( ) && ! _uiclass . isRoot ( ) ) { final UIFieldForm fieldform ; if ( _uuid2InstanceKey . containsKey ( _uiclass . getClassificationUUID ( ) ) ) { fieldform = new UIFieldForm ( getCommandUUID ( ) , _uuid2InstanceKey . get ( _uiclass . getClassificationUUID ( ) ) ) ; } else { fieldform = new UIFieldForm ( getCommandUUID ( ) , _uiclass ) ; if ( isEditMode ( ) ) { // in edit mode, if there is no classification yet, create // mode must be forced fieldform . setMode ( TargetMode . CREATE ) ; } } ret . add ( new Element ( ElementType . SUBFORM , fieldform ) ) ; } for ( final UIClassification child : _uiclass . getChildren ( ) ) { ret . addAll ( getClassElements ( child , _uuid2InstanceKey ) ) ; } Collections . sort ( ret , ( _o1 , _o2 ) -> ( ( UIFieldForm ) _o1 . getElement ( ) ) . getWeight ( ) . compareTo ( ( ( UIFieldForm ) _o2 . getElement ( ) ) . getWeight ( ) ) ) ; return ret ; }
Recursive method to add the children classification forms .