Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customizable Context Menu and multiple Factories in docker manager #676

Closed

Conversation

studiofuga
Copy link

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.

@githubuser0xFFFF
Copy link
Owner

Thank you for your pull request. I just merged everything into master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants