gusucode.com > datatools工具箱 matlab源码程序 > datatools/inspector/matlab/+internal/+matlab/+inspector/InspectorGroup.m

    classdef InspectorGroup < matlab.mixin.util.PropertyGroup & handle
    % This class is unsupported and might change or be removed without
    % notice in a future version.

    % InspectorGroup - a class representing a group of properties for a
    % property inspector view.  Extends the disp PropertyGroup mixin to add
    % additional functionality.  The PropertyGroup class provides a title
    % and a list of properties, which is used here.
    
    % Copyright 2015 The MathWorks, Inc.
    
    properties
        % ID for this inspector group
        GroupID;
        
        % Description for the group, to be shown in a tooltip or detailed
        % information for a group.
        Description;
        
        % Whether the group should be expanded by default, or not.
        Expanded = false;
    end
    
    methods
        % Create an InspectorGroup instance
        function this = InspectorGroup(GroupID, Title, Description)
            this = this@matlab.mixin.util.PropertyGroup({}, Title);
            this.GroupID = GroupID;
            this.Description = Description;
        end
        
        % Add properties to this InspectorGroup
        function addProperties(this, varargin)
            this.PropertyList = [this.PropertyList  varargin];
        end
        
        % Remove properties from this InspectorGroup
        function removeProperties(this, propertiesToRemove)
            if ~iscell(propertiesToRemove)
                propertiesToRemove = {propertiesToRemove};
            end
            idx = cellfun(@(x) ~ismember(x, propertiesToRemove), ...
                this.PropertyList);
            this.PropertyList = this.PropertyList(idx);
        end
    end
end