Merge remote-tracking branch

'origin/GP-5474-dragonmacher-symbol-tree-events--SQUASHED'
(Closes #7889, Closes #7891)
This commit is contained in:
Ryan Kurtz 2025-03-26 09:08:13 -04:00
commit f2e8afff9c
21 changed files with 1053 additions and 157 deletions

View file

@ -4,9 +4,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -15,7 +15,7 @@
*/
package generic.timer;
import java.util.Objects;
import java.util.*;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.function.*;
@ -32,6 +32,8 @@ import utility.function.Dummy;
*/
public class ExpiringSwingTimer extends GhidraSwingTimer {
private static Set<ExpiringSwingTimer> instances = new HashSet<>();
private long startMs = System.currentTimeMillis();
private int expireMs;
private BooleanSupplier isReady;
@ -130,9 +132,16 @@ public class ExpiringSwingTimer extends GhidraSwingTimer {
return;
}
instances.add(this);
super.start();
}
@Override
public void stop() {
super.stop();
instances.remove(this);
}
/**
* Returns true the initial expiration period has passed
* @return true if expired