Main Content

FactoryGroup

Group of factory settings and factory subgroup objects

Description

AFactoryGroupis an object within the factory settings tree. At the top of the tree is the rootFactoryGroup. EachFactoryGroupcan contain a collection of otherFactoryGroupandFactorySettingobjects. For more information about creating a factory settings tree, seeCreate Factory Settings for Toolboxes.

Creation

Create theFactoryGrouproot object using thematlab.settings.FactoryGroup.createToolboxGroupfunction. 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 astrueorfalse.

When set totrue, 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

addGroup Add new factory settings group
addSetting Add new factory setting
matlab.settings.FactoryGroup.createToolboxGroup CreateFactoryGrouproot object for toolbox

Examples

collapse all

Create the factory settings tree for the toolboxmytoolbox.

Create the root factory groupmytoolbox.

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

Add thefontgroup 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);
Introduced in R2019b