Closed greenwoodma closed 5 years ago
Daft question, do we need a new method or would getting NameBearerHandle
to call setTarget()
after reInit()
be just as good a solution? In most cases all we would be doing would be to call setTarget()
anyway and this would fix any broken VRs without requiring a code change (would still need to fix those that currently do this via progressFinished()
instead).
Turns out it fixes it but is very inefficient, because I'm an idiot!
Currently a VR isn't automatically notified when it's associated PR is re-initialised even though it may need to update it's display. Some viewers (jape and groovy) listen for
progressFinished
events and then callsetTarget
. While this works it also means that this happens after each document is processed through the VR which is clearly inefficient. Other VRs (such as the gazetteer) listen for custom events on the PR to know when to reload.A more sensible option would be to add a method to VisualResource
targetReinitialized()
(or similar) which would be called byNameBearerHandle
after it's calledreInit
on the PR. This would decouple progress reporting from reinitialization and allow PRs to report incremental progress while being initialized without causing the VRs to reload during execution.