mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-06 03:50:02 +02:00
GT-2925 - Key Bindings - Support Window Menu Provider Key Bindings -
test and review fixes
This commit is contained in:
parent
6015650079
commit
a88ecfe6b5
40 changed files with 499 additions and 392 deletions
|
@ -1092,6 +1092,26 @@ public abstract class AbstractGenericTest extends AbstractGTest {
|
|||
runSwing(runnable, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Call this version of {@link #runSwing(Runnable)} when you expect your runnable to throw
|
||||
* an exception
|
||||
* @param runnable the runnable
|
||||
* @param wait true signals to wait for the Swing operation to finish
|
||||
* @throws Throwable any excption that is thrown on the Swing thread
|
||||
*/
|
||||
public static void runSwingWithExceptions(Runnable runnable, boolean wait) throws Throwable {
|
||||
|
||||
if (Swing.isSwingThread()) {
|
||||
throw new AssertException("Unexpectedly called from the Swing thread");
|
||||
}
|
||||
|
||||
ExceptionHandlingRunner exceptionHandlingRunner = new ExceptionHandlingRunner(runnable);
|
||||
Throwable throwable = exceptionHandlingRunner.getException();
|
||||
if (throwable != null) {
|
||||
throw throwable;
|
||||
}
|
||||
}
|
||||
|
||||
public static void runSwing(Runnable runnable, boolean wait) {
|
||||
if (SwingUtilities.isEventDispatchThread()) {
|
||||
runnable.run();
|
||||
|
@ -1115,7 +1135,6 @@ public abstract class AbstractGenericTest extends AbstractGTest {
|
|||
};
|
||||
|
||||
SwingUtilities.invokeLater(swingExceptionCatcher);
|
||||
|
||||
}
|
||||
|
||||
protected static class ExceptionHandlingRunner {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue