Main Content

appdesigner.customcomponent.configureMetadata

Configure custom UI component for use in App Designer

    Description

    example

    appdesigner.customcomponent.configureMetadata(classfile)opens a dialog to configure App Designer metadata for the UI component class specified byclassfile。此元数据使组件能够出现在应用程序设计器中Component Libraryand be used interactively in the canvas.

    The function generates a folder namedresourcesthat contains the metadata. Share this folder when you share your UI component.

    Examples

    collapse all

    Use the App Designer Custom UI Component Metadata dialog to configure an existing UI component class for use in App Designer.

    Assume you created a subclass of thematlab.ui.componentcontainer.ComponentContainerbase class and saved the class file asIPAddressComponent.min the folderC:\MyComponents。Launch a dialog to configure theIPAddressComponentfor use in App Designer.

    appdesigner.customcomponent.configureMetadata('C:\MyComponents\IPAddressComponent.m')

    填写表格,然后selectOK。The function generates a folder namedresourceswith the specified metadata in theC:\MyComponentsfolder. AddC:\MyComponentsto the MATLAB®path and open an app in App Designer to see your component in theComponent Library

    Input Arguments

    collapse all

    Path to the UI component class file, specified as a character vector or string scalar.classfilecan be an absolute or relative path.

    Example:'C:\MyComponents\IPAddressComponent.m'

    Example:"IPAddressComponent.m"

    More About

    collapse all

    Dialog Options

    This table gives a summary of each of the options in the App Designer Custom UI Component Metadata dialog.

    Option 概括
    Name The name of the component as it appears in the App DesignerComponent Library
    Category The category of theComponent Librarythat the component appears in. Choose an existing category from the drop-down or create a new category by entering a name for it.
    Icon The icon that appears above the component name in theComponent Library。Choose a。gif,。jpeg,。jpg, or。pngfile on your computer.
    Description The description that the user sees when hovering over the component in theComponent Library
    Version The component version, specified asMajor.Minor。The default value is1.0。Increment the number after the decimal point after making minor changes to the component, and increment the number before the decimal point after making major changes.
    Author's Name The name of the component author that the user sees when hovering over the component in theComponent Library
    Author's Email The email address of the component author that the user sees when hovering over the component in theComponent Library

    Version History

    Introduced in R2021a