function headerLabels = getHeaderLabels(h)
%

% Copyright 2009-2017 The MathWorks, Inc.
info = [];
% no need to do any work if the view has no properties
info = [info struct('name','Name', 'width', -1, 'icon', '')];
if ~isempty(h.Properties)
    props   = find(h.Properties, 'isVisible', true);
    columns = get(props, 'Name');
    widths = get(props, 'Width');
    if ~isempty(columns)
        if (~iscell(columns))
            columns = { columns };
        end
        if (~iscell(widths))
            widths = { widths };
        end
        if numel(columns) > 0
            info = [];
            for i=1:numel(columns)
                info = [info struct('name',columns{i}, 'width', widths{i}, 'icon', '')];
            end
        end
    end
end
headerLabels = jsonencode(struct('columns', info));
