code: private Layout getActiveLayout(Project phoenixProject)
     {
        //
        // Start with the first layout we find
        //
        Layout activeLayout = phoenixProject.getLayouts().getLayout().get(0);
  
        //
        // If this isn't active, find one which is... and if none are,
        // we'll just use the first.
        //
        if (!activeLayout.isActive().booleanValue())
        {
           for (Layout layout : phoenixProject.getLayouts().getLayout())
           {
              if (layout.isActive().booleanValue())
              {
                 activeLayout = layout;
                 break;
              }
           }
        }
  
        return activeLayout;
     }
docs: Find the current active layout.
  
  @param phoenixProject phoenix project data
  @return current active layout