Main Content

FactoryGroup

Group of factory settings and factory subgroup objects

Since R2019b

Description

A FactoryGroup is an object within the factory settings tree. At the top of the tree is the root FactoryGroup. Each FactoryGroup can contain a collection of other FactoryGroup and FactorySetting objects. For more information about creating a factory settings tree, see Create Factory Settings for Toolboxes.

Creation

Create the FactoryGroup root object using the matlab.settings.FactoryGroup.createToolboxGroup function. For example:

myToolboxSettings = matlab.settings.FactoryGroup.createToolboxGroup('mytoolbox','Hidden',false);

Properties

expand all

Name of factory group, specified as a character vector or string.

Hidden state, specified as true or false.

When set to true, the factory group, including all factory groups and factory settings within the group, do not display in the Command Window or as part of tab completion, although they remain accessible.

Function to validate factory settings in group, specified as a function handle. When specified, the function is used to validate the values of all factory settings within the group, except for settings that specify their own validation functions. This includes settings in subgroups, as long as the subgroup or settings do not specify their own validation functions.

Object Functions

addGroupAdd new factory settings group
addSettingAdd new factory setting
matlab.settings.FactoryGroup.createToolboxGroupCreate FactoryGroup root object for toolbox

Examples

collapse all

Create the factory settings tree for the toolbox mytoolbox.

Create the root factory group mytoolbox.

myToolboxFactoryTree = matlab.settings.FactoryGroup.createToolboxGroup('mytoolbox', ...
    'Hidden',false);

Add the font group to the tree and add two settings, font size and font color.

toolboxFontGroup = addGroup(myToolboxFactoryTree,'font','Hidden',false);
addSetting(toolboxFontGroup,'FontSize','FactoryValue',11,'Hidden',false, ...
    'ValidationFcn',@matlab.settings.mustBeNumericScalar);
addSetting(toolboxFontGroup,'FontColor','FactoryValue','Black', ...
    'Hidden',false,'ValidationFcn',@matlab.settings.mustBeStringScalar);

Version History

Introduced in R2019b