hallvard / plantuml

Embed UML diagrams in files and view them in Eclipse
http://plantuml.sourceforge.net/
209 stars 57 forks source link

[WIP] Selections in views can now trigger diagram generation (issue #84) #89

Closed steghoja closed 4 years ago

steghoja commented 5 years ago

This commit generalises how PlantUml handles diagram generation. It now attaches the DiagramTextChangedListener not only to editors but also to views. This allows generating diagrams also when elements in, e.g., the Project Explorer are selected. Since the generation is still handled by DiagramTextProvider instances, this should have no impact on existing code but allows more flexibility for new use cases. The code also somewhat simplifies the handling of the parts internally, but this needs to be further tested.

hallvard commented 5 years ago

I've looked through the commit and it seems very reasonable. What's troubling me is backwards compatibility, others that may have implemented DiagramTextProvider shouldn't have to change anything. So I'll try making a similar change, without affecting existing code. But thanks for the PR, I'll use it as a reference!