diff --git a/src/main/java/org/gcube/portlets/user/td/csvimportwidget/client/CSVOperationInProgressCard.java b/src/main/java/org/gcube/portlets/user/td/csvimportwidget/client/CSVOperationInProgressCard.java index 35edb65..17f3e87 100644 --- a/src/main/java/org/gcube/portlets/user/td/csvimportwidget/client/CSVOperationInProgressCard.java +++ b/src/main/java/org/gcube/portlets/user/td/csvimportwidget/client/CSVOperationInProgressCard.java @@ -19,6 +19,7 @@ import com.google.gwt.user.client.Command; import com.google.gwt.user.client.rpc.AsyncCallback; import com.google.gwt.user.client.ui.FlexTable; import com.sencha.gxt.core.client.util.Margins; +import com.sencha.gxt.widget.core.client.AutoProgressBar; import com.sencha.gxt.widget.core.client.FramedPanel; import com.sencha.gxt.widget.core.client.container.BoxLayoutContainer.BoxLayoutData; import com.sencha.gxt.widget.core.client.container.HtmlLayoutContainer; @@ -35,10 +36,12 @@ import com.sencha.gxt.widget.core.client.container.VBoxLayoutContainer.VBoxLayou public class CSVOperationInProgressCard extends WizardCard implements MonitorDialogListener { - protected CSVOperationInProgressCard thisCard; - protected CSVImportSession importSession; - protected TRId newTrId; - protected HtmlLayoutContainer resultField; + @SuppressWarnings("unused") + private CSVOperationInProgressCard thisCard; + private CSVImportSession importSession; + private TRId newTrId; + private HtmlLayoutContainer resultField; + private AutoProgressBar storageLoading; public CSVOperationInProgressCard(final CSVImportSession importSession) { super("Operation In Progress", ""); @@ -74,27 +77,46 @@ public class CSVOperationInProgressCard extends WizardCard implements summary.add(description); operationInProgressPanel.add(summary, new BoxLayoutData(new Margins(20, 5, 10, 5))); + + + storageLoading=new AutoProgressBar(); + operationInProgressPanel.add(storageLoading, new BoxLayoutData( + new Margins(10, 5, 10, 5))); + resultField = new HtmlLayoutContainer("
"); operationInProgressPanel.add(resultField, new BoxLayoutData( new Margins(10, 5, 10, 5))); setCenterWidget(operationInProgressPanel, new MarginData(0)); + storageLoading.setVisible(false); resultField.setVisible(false); + } public void importCSV() { + //mask("Loading on Storage..."); + storageLoading.setVisible(true); + forceLayout(); + storageLoading.updateText("Loading on Storage..."); + storageLoading.redraw(); + storageLoading.auto(); + TDGWTServiceAsync.INSTANCE.startCSVImport(importSession, new AsyncCallback() { - + public void onSuccess(String taskId) { + storageLoading.setVisible(false); + forceLayout(); openMonitorDialog(taskId); - + } public void onFailure(Throwable caught) { + storageLoading.setVisible(false); + forceLayout(); if (caught instanceof TDGWTSessionExpiredException) { getEventBus() .fireEvent(