Skip to content

Conversation

Sethur
Copy link

@Sethur Sethur commented Feb 15, 2023

I added a flag for ignoring all subsequent status line and progress bar updates in IJ.java.

The motivation was that currently, when calling/running any plugin A from within another plugin B, and A writes its own updates to the status line or progress bar, there can be the following issues:

  • If B wants to call A in parallel, the status updates of A will mess up the progress bar and status line completely.
  • If B wants to display a total status of some task that involves repeatedly calling A, the progress bar and status line display of A will get in the way, even if B does not employ parallelization.

I tried "protecting" the status bar by posting messages beginning with !, but this will get deactivated across threads. When it comes to the progress bar, I tried to call the setBatchMode(...) method of the main ProgressBar instance manually, but this will get deactivated if any thread was calling IJ.showProgress(int currentIndex, int lastIndex) with currentIndex == lastIndex.

As a conclusion, there really is no good method of preventing other plugins from cluttering the progress bar and status line, so I thought it would be cleaner to introduce this flag.

Added flag for ignoring all subsequent status line and progress bar updates. Useful for calling plugins from other plugins.
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

Successfully merging this pull request may close these issues.

1 participant