@Override
public void start(final OtpErlangObject msg) {
if (fSearchResult != null) {
fSearchResult.removeAll();
}
final OtpErlangLong progressMaxL = (OtpErlangLong) msg;
int progressMax;
try {
progressMax = progressMaxL.intValue();
} catch (final OtpErlangRangeException e) {
progressMax = 10;
}
monitor.beginTask("Searching", progressMax);
}
@Override
public void stop(final OtpErlangObject msg) {
monitor.done();
stopped = true;
synchronized (locker) {
locker.notifyAll();
}
}
@Override
public void progress(final OtpErlangObject msg) {
final OtpErlangTuple t = (OtpErlangTuple) msg;
final OtpErlangPid backgroundSearchPid = (OtpErlangPid) t.elementAt(0);
final OtpErlangLong progressL = (OtpErlangLong) t.elementAt(1);
final OtpErlangObject resultO = t.elementAt(2);
int progress = 1;
try {
progress = progressL.intValue();
final List<ModuleLineFunctionArityRef> result = Lists.newArrayList();
SearchUtil.addSearchResult(result, resultO);
addMatches(result);
} catch (final OtpErlangRangeException e) {
}