use of org.bndtools.core.resolve.ResolveCancelledException in project bndtools by bndtools.
the class ResolutionChoiceInteractCallback method processCandidates.
public void processCandidates(final Requirement requirement, Set<Capability> wired, final List<Capability> candidates) {
if (wired.size() > 0 || candidates.size() < 2)
return;
final Display display = PlatformUI.getWorkbench().getDisplay();
final AtomicInteger resultRef = new AtomicInteger();
Runnable runnable = new Runnable() {
public void run() {
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
if (!shell.isDisposed()) {
ResolutionChoiceSelectionDialog dialog = new ResolutionChoiceSelectionDialog(shell, requirement, candidates);
resultRef.set(dialog.open());
} else {
resultRef.set(IDialogConstants.CANCEL_ID);
}
}
};
display.syncExec(runnable);
int result = resultRef.get();
if (result == IDialogConstants.CANCEL_ID)
throw new ResolveCancelledException();
}
Aggregations