use of bndtools.tasks.BndFileCapReqLoader in project bndtools by bndtools.
the class BundleCalculatedImportsPart method refresh.
@Override
public void refresh() {
super.refresh();
IFile file = getEditorFile();
if (file == null)
return;
IPath location = file.getLocation();
if (location == null)
return;
Set<BndFileCapReqLoader> loaders = Collections.singleton(new BndFileCapReqLoader(location.toFile()));
final AnalyseBundleResolutionJob job = new AnalyseBundleResolutionJob(Messages.BundleCalculatedImportsPart_jobAnalyse, loaders);
final Display display = tree.getDisplay();
job.addJobChangeListener(new JobChangeAdapter() {
@Override
public void done(IJobChangeEvent event) {
if (job.getResult().isOK()) {
display.asyncExec(new Runnable() {
@Override
public void run() {
if (tree != null && !tree.isDisposed())
viewer.setInput(job.getRequirements());
}
});
}
}
});
job.schedule();
}
Aggregations