use of org.jowidgets.api.threads.IUiThreadAccess in project jo-client-platform by jo-source.
the class PasteLinkCommand method linkBeans.
private void linkBeans(final IExecutionContext executionContext, final List<IBeanProxy<SOURCE_BEAN_TYPE>> selection) {
final IExecutionTask executionTask = CapUiToolkit.executionTaskFactory().create(executionContext);
final IUiThreadAccess uiThreadAccess = Toolkit.getUiThreadAccess();
executionTask.addExecutionCallbackListener(new IExecutionCallbackListener() {
@Override
public void canceled() {
uiThreadAccess.invokeLater(new Runnable() {
@Override
public void run() {
for (final IBeanProxy<SOURCE_BEAN_TYPE> bean : selection) {
bean.setExecutionTask(null);
}
executionObservable.fireAfterExecutionCanceled(executionContext);
}
});
}
});
final Collection<ILinkCreation> linkCreations = linkProvider.get();
executionObservable.fireAfterExecutionPrepared(executionContext);
linkCreatorService.create(createResultCallback(selection, executionContext), linkCreations, executionTask);
}
Aggregations