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

Removing a module from the collection returned by getModules() should also close and remove the module from the openModules collection as accessing them will throw an exception. #612

Open
balazsvero opened this issue May 19, 2023 · 0 comments

Comments

@balazsvero
Copy link

To reproduce:

Create a toolbarButton that removes all the modules from the workbench.
Start the app, open some modules.
Activate the button.
Click on the tab of the modules.
IllegalArgumentException: Module has not been loaded yet is thrown

Possible solutions:

  • never return the internal lists but add functions to manage them (add/remove) and take care of syncing them
  • create a listener for the modules list and call close() on the module if it was open
  • remove the openModules list property from the Workbench and add a booleanProperty to the WorkbenchModule class. getOpenModules could then return the modules list filtered for this boolean indicating open status.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant