Customizable Context Menu and multiple Factories in docker manager #676
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Customizable Context Menu and multiple Factories in docker manager
Description
This pull request introduces two significant enhancements to the ADS repository:
Customizable Context Menu for Docker Tabs:
The context menu of the tabs within the docker widgets can now be customized.
An example customization includes adding the list of perspectives of the Docker inside the docker widget.
Support for multiple factories on per manager basis (instead of singleton)
Refactored the Factory to be a subobject of the Docker Manager.
This allows for different components to be created based on the Docker Manager context.
Ensures retrocompatibility by introducing a new constructor for the docker widget to pass the factory.
Added a creator method in the Docker Manager to facilitate component creation instead of direct instantiation.
Key Changes
Context Menu Customization:
Enabled the addition of custom items to the context menu of docker widget tabs.
The context menu building has been extracted as a virtual function from the context menu handling function, so that any derived class can override it and adds additional items on it before desplaying
Refactoring:
Moved the Factory to be a subobject of the Docker Manager.
Modified the Docker Widget constructor to accept a factory parameter.
Added a creator method in Docker Manager for creating components.
Benefits
Flexibility: Allows for a more flexible and customizable UI experience.
Modularity: Enhances modularity by decoupling the creation logic from direct instantiation.
Retrocompatibility: Maintains compatibility with existing implementations while offering new features.
Testing
Some example has been adapted to use the new factory method and functions. In that example, the tab component of the docker has been subclassed to include some additional function in the popup menu.