Quintiq file version 2.0
#parent: #root
Method ParseMenu (output owning JSONBuilder jsonbuilder, Menu component, Number padding) id:Method_GlobalStateTestGenerator_ParseMenu_556
{
  #keys: '[142876.9.202775466]'
  Body:
  [*
    padstr := "".PadLeft( " ", padding );
    
    //info( padstr + component.Text() );
    
    name := '';
    title := '';
    formkey := Key::ZeroKey();
    
    if( component.istype( ComponentMenu ) )
    {
      name := component.astype( ComponentMenu ).GetProperty( 'ComponentType' );
      GlobalStateTestGenerator.GetFormProperties( name, title, formkey );
    }
    else
    {
      name := component.Text();
      title := '{TODO_TITLE}'; // TODO
    }
    
    info( padstr + '|' + name + '|' + title + '|' + [String]formkey );
    
    GlobalStateTestGenerator.TG_UpdateUIForm( &jsonbuilder, name, title, [String]formkey );
    
    traverse( component, SubComponents.astype( Menu ), child )
    {
      this.ParseMenu( &jsonbuilder, child, padding + 4 );
    }
  *]
}
