mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 19:42:36 +02:00
GT-2376: added new task monitor service
This commit is contained in:
parent
538cbc1226
commit
f57af0b730
28 changed files with 1363 additions and 558 deletions
|
@ -15,10 +15,7 @@
|
|||
*/
|
||||
package ghidra.framework.data;
|
||||
|
||||
import ghidra.util.Issue;
|
||||
import ghidra.util.SystemUtilities;
|
||||
import ghidra.util.datastruct.WeakDataStructureFactory;
|
||||
import ghidra.util.datastruct.WeakSet;
|
||||
import ghidra.util.exception.CancelledException;
|
||||
import ghidra.util.task.*;
|
||||
|
||||
|
@ -35,7 +32,6 @@ class LockingTaskMonitor implements TaskMonitor {
|
|||
private boolean showProgressValue = true;
|
||||
private String msg;
|
||||
private MyTaskDialog taskDialog;
|
||||
private WeakSet<IssueListener> issueListeners;
|
||||
|
||||
/**
|
||||
* Constructs a locking task handler for a locked dobj. The setCompleted() method must be
|
||||
|
@ -263,28 +259,4 @@ class LockingTaskMonitor implements TaskMonitor {
|
|||
public void removeCancelledListener(CancelledListener listener) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addIssueListener(IssueListener listener) {
|
||||
if (issueListeners == null) {
|
||||
issueListeners = WeakDataStructureFactory.createCopyOnWriteWeakSet();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeIssueListener(IssueListener listener) {
|
||||
if (issueListeners != null) {
|
||||
issueListeners.remove(listener);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reportIssue(Issue issue) {
|
||||
if (issueListeners != null) {
|
||||
for (IssueListener listener : issueListeners) {
|
||||
listener.issueReported(issue);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,9 +16,9 @@
|
|||
package ghidra.framework.task;
|
||||
|
||||
import ghidra.framework.task.gui.GProgressBar;
|
||||
import ghidra.util.Issue;
|
||||
import ghidra.util.exception.CancelledException;
|
||||
import ghidra.util.task.*;
|
||||
import ghidra.util.task.CancelledListener;
|
||||
import ghidra.util.task.TaskMonitor;
|
||||
|
||||
/**
|
||||
* Implementation of a TaskMontor that can be "attached" to a GProgressBar.
|
||||
|
@ -123,11 +123,6 @@ public class GTaskMonitor implements TaskMonitor, CancelledListener {
|
|||
return progress;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reportIssue(Issue issue) {
|
||||
// do nothing for now;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancel() {
|
||||
if (cancelEnabled) {
|
||||
|
@ -145,16 +140,6 @@ public class GTaskMonitor implements TaskMonitor, CancelledListener {
|
|||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addIssueListener(IssueListener listener) {
|
||||
// not currently supported
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeIssueListener(IssueListener listener) {
|
||||
// not currently supported
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelEnabled(boolean enable) {
|
||||
cancelEnabled = enable;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue