From 3bc2717e28b37396fa65c6955c1e096cd94468e4 Mon Sep 17 00:00:00 2001 From: Giancarlo Panichi Date: Mon, 18 Nov 2013 13:07:24 +0000 Subject: [PATCH] Minor updated git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-csv-export-widget@85609 82a268e6-3cf1-43bd-a215-b396298e98cf --- pom.xml | 4 +- .../client/SourceSelectionCard.java | 138 ------------------ .../progress/CSVExportProgressUpdater.java | 10 +- .../csvexportwidget/CSVExportWizardTD.gwt.xml | 2 +- 4 files changed, 7 insertions(+), 147 deletions(-) delete mode 100644 src/main/java/org/gcube/portlets/user/td/csvexportwidget/client/SourceSelectionCard.java diff --git a/pom.xml b/pom.xml index 17bb29c..1b80a30 100644 --- a/pom.xml +++ b/pom.xml @@ -104,7 +104,7 @@ 3.0.1 - + @@ -117,7 +117,7 @@ org.gcube.portlets.user tabular-data-wizard-widget - 1.0.0-SNAPSHOT + [1.0.0-SNAPSHOT,2.0.0-SNAPSHOT) diff --git a/src/main/java/org/gcube/portlets/user/td/csvexportwidget/client/SourceSelectionCard.java b/src/main/java/org/gcube/portlets/user/td/csvexportwidget/client/SourceSelectionCard.java deleted file mode 100644 index e9d4db2..0000000 --- a/src/main/java/org/gcube/portlets/user/td/csvexportwidget/client/SourceSelectionCard.java +++ /dev/null @@ -1,138 +0,0 @@ -/** - * - */ -package org.gcube.portlets.user.td.csvexportwidget.client; - - - -import org.gcube.portlets.user.td.gwtservice.shared.csv.CSVImportSession; -import org.gcube.portlets.user.td.gwtservice.shared.source.FileSource; -import org.gcube.portlets.user.td.gwtservice.shared.source.WorkspaceSource; -import org.gcube.portlets.user.td.wizardwidget.client.WizardCard; - -import com.allen_sauer.gwt.log.client.Log; -import com.google.gwt.event.logical.shared.ValueChangeEvent; -import com.google.gwt.event.logical.shared.ValueChangeHandler; -import com.google.gwt.user.client.Command; -import com.google.gwt.user.client.ui.HasValue; -import com.google.gwt.user.client.ui.VerticalPanel; -import com.sencha.gxt.core.client.util.ToggleGroup; -import com.sencha.gxt.widget.core.client.form.Radio; - -/** - * - * @author "Giancarlo Panichi" g.panichi@isti.cnr.it - * - */ -public class SourceSelectionCard extends WizardCard { - - protected final CSVImportSession importSession; - - final FileSource fileSource = FileSource.INSTANCE; - final WorkspaceSource workspaceSource = WorkspaceSource.INSTANCE; - - public SourceSelectionCard(final CSVImportSession importSession) { - super("CSV source selection", ""); - - this.importSession = importSession; - // Default - importSession.setSource(fileSource); - - VerticalPanel sourceSelectionPanel = new VerticalPanel(); - sourceSelectionPanel.setStylePrimaryName(res.wizardCSS() - .getImportSelectionSources()); - - Radio radioFileSource = new Radio(); - radioFileSource.setBoxLabel("

" - + fileSource.getName() + "
" - + fileSource.getDescription() + "

"); - radioFileSource.setName(fileSource.getName()); - radioFileSource.setStylePrimaryName(res.wizardCSS() - .getImportSelectionSource()); - radioFileSource.setValue(true); - - Radio radioSDMXRegistrySource = new Radio(); - - Radio radioWorkspaceSource = new Radio(); - radioWorkspaceSource.setBoxLabel("

" - + workspaceSource.getName() + "
" - + workspaceSource.getDescription() + "

"); - radioWorkspaceSource.setName(workspaceSource.getName()); - radioWorkspaceSource.setStylePrimaryName(res.wizardCSS() - .getImportSelectionSource()); - radioWorkspaceSource.disable(); - - sourceSelectionPanel.add(radioFileSource); - sourceSelectionPanel.add(radioWorkspaceSource); - - // we can set name on radios or use toggle group - ToggleGroup toggle = new ToggleGroup(); - toggle.add(radioSDMXRegistrySource); - toggle.add(radioWorkspaceSource); - toggle.add(radioFileSource); - - toggle.addValueChangeHandler(new ValueChangeHandler>() { - - @Override - public void onValueChange(ValueChangeEvent> event) { - try { - ToggleGroup group = (ToggleGroup) event.getSource(); - Radio radio = (Radio) group.getValue(); - Log.info("Source Selected:" + radio.getName()); - if (radio.getName().compareTo(workspaceSource.getName()) == 0) { - importSession.setSource(workspaceSource); - } else { - if (radio.getName().compareTo(fileSource.getName()) == 0) { - importSession.setSource(fileSource); - } else { - - } - - } - - } catch (Exception e) { - Log.error("ToggleGroup: onValueChange " - + e.getLocalizedMessage()); - } - - } - }); - - setContent(sourceSelectionPanel); - - } - - @Override - public void setup() { - Command sayNextCard = new Command() { - public void execute() { - try { - String sourceId = importSession.getSource().getId(); - if (sourceId == null || sourceId.isEmpty()) { - Log.error("CSV Import Source Id: " + sourceId); - } else { - if (sourceId.compareTo("File") == 0) { - /* CSVUploadFileCard csvUploadFileCard = new CSVUploadFileCard( importSession); - getWizardWindow().addCard(csvUploadFileCard); - Log.info("NextCard CSVUploadFileCard"); - getWizardWindow().nextCard();*/ - } else { - if (sourceId.compareTo("Workspace") == 0) { - - } else { - - } - } - } - } catch (Exception e) { - Log.error("sayNextCard :" + e.getLocalizedMessage()); - } - } - }; - - getWizardWindow().setNextButtonCommand(sayNextCard); - - } - -} diff --git a/src/main/java/org/gcube/portlets/user/td/csvexportwidget/client/progress/CSVExportProgressUpdater.java b/src/main/java/org/gcube/portlets/user/td/csvexportwidget/client/progress/CSVExportProgressUpdater.java index 822ef1b..dc39ad3 100644 --- a/src/main/java/org/gcube/portlets/user/td/csvexportwidget/client/progress/CSVExportProgressUpdater.java +++ b/src/main/java/org/gcube/portlets/user/td/csvexportwidget/client/progress/CSVExportProgressUpdater.java @@ -17,14 +17,12 @@ import com.sencha.gxt.widget.core.client.event.HideEvent; import com.sencha.gxt.widget.core.client.event.HideEvent.HideHandler; /** - * This {@link Timer} retrieves {@link OperationProgress} from the specified - * {@link OperationProgressSource} with the scheduled interval. The retrieved - * information are spread to the subscribed {@link CSVExportProgressListener}. - * - * @author "Giancarlo Panichi" g.panichi@isti.cnr.it * + * @author "Giancarlo Panichi" + * g.panichi@isti.cnr.it + * */ + public class CSVExportProgressUpdater extends Timer { protected ArrayList listeners = new ArrayList(); diff --git a/src/main/resources/org/gcube/portlets/user/td/csvexportwidget/CSVExportWizardTD.gwt.xml b/src/main/resources/org/gcube/portlets/user/td/csvexportwidget/CSVExportWizardTD.gwt.xml index f975b25..e076f7e 100644 --- a/src/main/resources/org/gcube/portlets/user/td/csvexportwidget/CSVExportWizardTD.gwt.xml +++ b/src/main/resources/org/gcube/portlets/user/td/csvexportwidget/CSVExportWizardTD.gwt.xml @@ -18,7 +18,7 @@ - +