A search bar for ImageJ

command-finder
search
imagej2
imagej
Tags: #<Tag:0x00007fd6a079e360> #<Tag:0x00007fd6a079d6e0> #<Tag:0x00007fd6a079d5a0> #<Tag:0x00007fd6a079c858>

#21

There is a way in SearchAction to set this behavior for each button, e.g. “Help” does not close the search results after execution. To do the same for the “Run” button, this line needs to look like this:

return new DefaultSearchAction("Run", false, //

Since the CommandFinder is doing the same, I don’t think it’s a big deal to change that?


#22

With the Command Finder, it is configurable. I am heavily biased toward pressing L every time and typing what I want (because I type quickly), so that’s how I made the new search bar behave. However, to accommodate the other workflow, we could add a toggle to the Search options that would globally override the behavior such that all actions keep the search results pane open, and only when you press Esc or click the X does it go away. @oburri Does that sound good?


#23

Sounds great to me! Thanks for the update and suggestion!


#24

Shame that it closes after ‘run’. I always keep the command finder open. That is most useful.


#25

I am back from vacation, now revisiting this issue. Before I code something, a quick question for those who like the search results window to remain open (@oburri @gabriel + anyone): do you want that pressing the enter key also keeps the window open? Or would it suffice for clicking the Run button to leave it open?

If it is sufficient for clicking the button to leave it open, then I propose a simpler solution here: pressing enter performs the default action and closes the window, whereas clicking any button on the right keeps it open. Then we can deprecate the action-specific closesSearch flag.

If you want pressing enter to leave it open, then I can indeed add the option to the Search options dialog box. But we could nonetheless remove the closesSearch action flag… is there ever a case where you wouldn’t want clicking an action button to leave the window open?


#26

Maybe having an option to leave it open after clicking a command or pressing Enter (and which gets remembered) would do it for me. If there is overwhelming support to do it otherwise that is fine.


#27

I’d vote for: clicking the buttons keeps the results open; behavior of enter should be configurable with the default “keep results open” (to be somewhat consistent with how the Command Finder behaves).

And thanks everyone for working on this awesome feature!


#28

Seeing as Enter triggers the “run” command, I would definitely vote for the search window remaining open upon Enter.
Splitting the clicking / Enter behaviour doesn’t make much difference (sense) to me at this point.

Also, welcome back


#29

I guess I disagree on that point but that’s really personal preference: if I am using enter I usually know what I want to do, while I am usually in exploration mode when I use the mouse.


#30

Personally, I can’t think of a situation where I would want the search results window to close.

And I know this might conflict with the simpler programming solution, but I think it would make sense if pressing Enter had the same behavior as clicking Run, especially since Run is the highlighted button.

Thanks again for adding this feature. It is already saving time and effort for me and my users. :slight_smile:


#31

First of all, thanks for this amazing feature!

I noticed that the macro recorder do not record when the search bar “run” button is used. Is that easily fixable ? (The same commands are well recorded when executed from ImageJ menu)

Thanks!


#32

I noticed that as well. I also noticed that double-clicking a result does not perform the default action. I’ll work on fixing all of this.