Hiding a Component in CDE

This post is for the geeks of us: the ones writing Processor Expert components with CDE (Components Development Environment). The problem is the following: In the Components Library view I have all my components listed, such as the USB stack components:

USB Stack Components

USB Stack Components

But the USB class components (the device or host ones) only make sense as sub-component (inherited) inside the FSL_USB_Stack:

FSL_USB_CDC_Device as inherited sub-component of FSL_USB_Stack

FSL_USB_CDC_Device as inherited sub-component of FSL_USB_Stack

So it does not make sense to add one of the device or host components to a project as the ‘root’ component: It only makes sense to add the FSL_USB_Stack component and then select the needed device or host sub-(inherited)-component. So how to hide the components?

The answer is to check a box in the CDE:

Only for inheritance sharing

Only for inheritance sharing

This will add the following to the .bean file:

 <OnlyForInheritanceSharing>true

With this knowledge, I can simply add that line to the .bean files with a text editor:

OnlyForInheritanceSharing set to true in bean file

OnlyForInheritanceSharing set to true in bean file

With this, I can successfully filter the components which are used as sub-components only:

Subcomponents not visible any more

Subcomponents not visible any more

Summary

With adding an extra setting to the .bean file of a component, I can hide it. That way I avoid users of the components to add components which then will not work, as they are only designed to be as a sub-component. So in my next component release you will get a cleaned up list of components :-).

❗ Unfortunately, this setting gets lost if the component gets loaded with the classic BeanWizard 😦

Happy Hiding πŸ™‚

What do you think?

This site uses Akismet to reduce spam. Learn how your comment data is processed.