function openCoverageDetails(studio)
% cvi.Informer.openCoverageDetails
%
% Open Coverage Details pane(s) for the specified studio.  If no studio is
% specified, then use the active studio.

% Copyright 2019 The MathWorks, Inc.

    if (nargin < 1)
        allStudios = DAS.Studio.getAllStudiosSortedByMostRecentlyActive;
        studio = allStudios(1);
    end
    
    % Get the cvi.Informer object associated with model in active editor.
    activeEditor = studio.App.getActiveEditor;
    activeModel = cvi.DockedReport.getSfLibInstanceParentModel();
    if isempty(activeModel)
        activeModel = get_param(activeEditor.blockDiagramHandle, 'name');
    end
    modelH = get_param(activeModel, 'handle');
    infrmObj = cvi.Informer.findInformer(modelH);
    if isempty(infrmObj)
        return;
    end
    
    dockedReports = infrmObj.getDockedReportsForStudio(studio);
    if isempty(dockedReports)
        % Create new docked report(s)
        covModes = infrmObj.reportManager.getCovModes();
        hasMultipleTypes = numel(covModes) > 1;
        for i=1:numel(covModes)
            dockedReport = infrmObj.createDockedReport(studio, covModes{i}, hasMultipleTypes);
            dockedReport.init();
        end
    else
        % Show existing docked report(s)
        for i=1:numel(dockedReports)
            dockedReports(i).refreshContent();
            dockedReports(i).show();
        end
    end
        
end