if (_or) {
final Location location = ((Location) model);
final String uri = location.getUri();
TargetPlatformActivator _instance = TargetPlatformActivator.getInstance();
IWorkbench _workbench = _instance.getWorkbench();
final IWorkbenchWindow window = _workbench.getActiveWorkbenchWindow();
final IRunnableWithProgress _function = new IRunnableWithProgress() {
public void run(final IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
Shell _shell = window.getShell();
Display _display = _shell.getDisplay();
ReadAndDispatchProgressMonitorWrapper _readAndDispatchProgressMonitorWrapper = new ReadAndDispatchProgressMonitorWrapper(monitor, _display);
final SubMonitor wpm = SubMonitor.convert(_readAndDispatchProgressMonitorWrapper, ("Creating content assist for " + uri), 100);
try {
Object _service = TargetPlatformProposalProvider.this.provisioningAgent.getService(IMetadataRepositoryManager.SERVICE_NAME);
final IMetadataRepositoryManager repositoryManager = ((IMetadataRepositoryManager) _service);
URI _uRI = new URI(uri);
SubMonitor _newChild = wpm.newChild(90);
final IMetadataRepository metadataRepository = repositoryManager.loadRepository(_uRI, _newChild);
IQuery<IInstallableUnit> _iUAssistQuery = TargetPlatformProposalProvider.this.getIUAssistQuery();
SubMonitor _newChild_1 = wpm.newChild(5);
IQueryResult<IInstallableUnit> _query = metadataRepository.query(_iUAssistQuery, _newChild_1);
final Set<IInstallableUnit> results = _query.toUnmodifiableSet();
final Function1<IInstallableUnit, Boolean> _function = new Function1<IInstallableUnit, Boolean>() {
public Boolean apply(final IInstallableUnit it) {
EList<IU> _ius = location.getIus();
final Function1<IU, String> _function = new Function1<IU, String>() {
public String apply(final IU it) {
return it.getID();
}
};
List<String> _map = ListExtensions.<IU, String>map(_ius, _function);
String _id = it.getId();
boolean _contains = _map.contains(_id);
return Boolean.valueOf((!_contains));
}
};
Iterable<IInstallableUnit> _filter = IterableExtensions.<IInstallableUnit>filter(results, _function);
final Procedure1<IInstallableUnit> _function_1 = new Procedure1<IInstallableUnit>() {
public void apply(final IInstallableUnit it) {
String _id = it.getId();
IQuery<IInstallableUnit> _createIUQuery = QueryUtil.createIUQuery(_id);
SubMonitor _newChild = wpm.newChild(5);
final IQueryResult<IInstallableUnit> allVersions = metadataRepository.query(_createIUQuery, _newChild);
String _id_1 = it.getId();
Iterator<IInstallableUnit> _iterator = allVersions.iterator();
final Function1<IInstallableUnit, String> _function = new Function1<IInstallableUnit, String>() {
public String apply(final IInstallableUnit it) {
Version _version = it.getVersion();
return _version.toString();
}
};
Iterator<String> _map = IteratorExtensions.<IInstallableUnit, String>map(_iterator, _function);
String _join = IteratorExtensions.join(_map, ", ");
ICompletionProposal _createCompletionProposal = TargetPlatformProposalProvider.this.createCompletionProposal(_id_1, _join, TargetPlatformProposalProvider.IU, 0, context);
acceptor.accept(_createCompletionProposal);
}
};
IterableExtensions.<IInstallableUnit>forEach(_filter, _function_1);
} catch (final Throwable _t) {
if (_t instanceof Exception) {
final Exception e = (Exception)_t;
} else {
throw Exceptions.sneakyThrow(_t);
}
}
}
};
final IRunnableWithProgress op = _function;
window.run(false, true, op);
}
} catch (Throwable _e) {
throw Exceptions.sneakyThrow(_e);
}
}