Created attachment 120925 [details]
Start of a patch
Sometimes it is useful to display test failures from multiple builds with one gesture. Currently you have to select the menu item on each. I started implementing this but there is some more to do - in order for an action to be enabled on multiselections, it has to be a singleton and accept a context. Could probably use @ActionRegistration if the ctor takes a List<HudsonJobBuild> (but TBD how to handle HudsonMavenModuleBuild - common parent interface?), then use Actions.forID to find the singleton.
Created attachment 132163 [details]
Patch - Using NodeAction
I've tried to implement it using NodeAction. Seems to work fine. Is it OK, or are there any drawbacks? Thanks.
You can do it that way if it is easiest, probably using CookieAction rather than NodeAction; last I checked SystemAction was just semideprecated. The best replacement is in spi.actions which is unfortunately still only available to “friends”. Doing it the encouraged way means using @ActionRegistration(eager=true) to define the ContextAwareAction (cannot make it lazy in this case since it has to accept two kinds of cookies).
The overloads in UI.showFailuresAction are now misleading since the result is a singleton, hence my original patch to UI.java.
The other parts of my patch were to add the action to nodes even when there was not a failure, so that you could multiselect all the builds of a job (for example) and select Show Failures and see just the test results from unstable builds.
Created attachment 132269 [details]
Patch - Using ContextAwareAction with @ActionRegistration
Implementation that uses eager @ActionRegistration for a ContextAwareAction.
Needs more testing with maven module builds, but seems to work fine so far.
Created attachment 132270 [details]
Patch - Using ContextAwareAction (no @ActionRegistration)
Similar to attachment 132269 [details], but the action doesn't use @ActionRegistration.
Everything works correctly. There's no need to assign keyboard shortcut or to add the action to main menu, so I think this patch should suffice.
Created attachment 132280 [details]
Patch - Using ContextAwareAction (no @ActionRegistration) v2
Fixed method ShowFailures.getExtraModuleBuilds.
That looks right to me.
Thank you very much, Jesse, for your help and reviewing.
Integrated into 'main-golden', will be available in build *201303072300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
User: Jaroslav Havlin <firstname.lastname@example.org>
Log: #214300: Permit Show Failures to be enabled on multiple-node selections