function reset(h)
% reset
% Reset the view manager to its factory state overriding any preferences.
%

%   Copyright 2009 The MathWorks, Inc.

% remove any existing views and install the factory ones w/o side effects
h.disableLiveliness;
delete(find(h, '-isa', 'DAStudio.MEView'));
factoryViews = h.getFactoryViews();
for i = 1:length(factoryViews)
    h.addView(factoryViews(i));
    
end
h.enableLiveliness;

% update the ActiveView. Use the first view by default. clients can change
% the active view after the views have been loaded.
h.ActiveView = find(h, '-isa', 'DAStudio.MEView', 'Name', 'Default');
if isempty(h.ActiveView)
h.ActiveView = factoryViews(1);
end

% save the new configuration to preferences
h.save(h);
