I'm working on the notes plugin some more and have run into a problem with
ProgressMonitor. I am able to make a PleaseWaitProgressMonitor pop up on
the screen and even update the text being shown to the user. But when I
call finishTask the dialog does not close. It just stays on the screen
indefinitely. For testing I have simplified my function down to the
following which matches the suggested use in the ProgressMonitor interface:

    public List<Note> searchNotes(<other params>, ProgressMonitor monitor) {
        if(monitor == null) {
            monitor = NullProgressMonitor.INSTANCE;
        }
        monitor.beginTask("Searching", 1);
        monitor.worked(1);
        monitor.finishTask();

I am passing in a PleaseWaitProgressMonitor that is created with the
default constructor. This happens in code that is already in GitHub:
https://github.com/iandees/josm-notes/blob/search-progress-bar/src/org/openstreetmap/josm/plugins/notes/gui/action/SearchAction.java#L146

Any tips as to what could be going on here?

Thanks,
Toby
_______________________________________________
josm-dev mailing list
josm-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/josm-dev

Reply via email to