use of org.jowidgets.cap.ui.api.widgets.IExecutionTaskDialog in project jo-client-platform by jo-source.
the class CsvExportExecutor method execute.
@Override
public void execute(final IExecutionContext executionContext, final List<IBeanProxy<BEAN_TYPE>> beans, final ICsvExportParameter parameter) throws Exception {
final IExecutionTask executionTask = CapUiToolkit.executionTaskFactory().create(executionContext);
final IExecutionTaskDialog executionTaskDialog = createExecutionTaskDialog(executionContext, executionTask);
final IResultCallback<String> resultCallback = new ResultCallback(executionTaskDialog);
final Runnable exportRunnable;
if (parameter.getExportType() == ExportType.SELECTION) {
final List<IBeanDto> beanDtos = createBeanDtos(beans, model.getPropertyNames());
exportRunnable = new CsvExportSelectedRunnable(model, resultCallback, parameter, beanDtos, executionTask);
} else {
final List<IBeanDto> addedData = createBeanDtos(model.getAddedData(), model.getPropertyNames());
exportRunnable = new CsvExportTableRunnable(model, addedData, resultCallback, parameter, executionTask);
}
executionTaskDialog.setVisible(true);
executor.execute(exportRunnable);
}
Aggregations