/** * */ package org.gcube.portlets.user.td.codelistmappingimportwidget.client; import org.gcube.portlets.user.td.wizardwidget.client.WizardCard; import org.gcube.portlets.user.td.gwtservice.shared.csv.CSVImportSession; import com.allen_sauer.gwt.log.client.Log; import com.google.gwt.user.client.Command; /** * * @author "Giancarlo Panichi" g.panichi@isti.cnr.it * */ public class CodelistMappingUploadFileCard extends WizardCard { protected CSVImportSession importSession; protected CodelistMappingFileUploadPanel fileUploadPanel; protected CodelistMappingUploadFileCard thisCard; public CodelistMappingUploadFileCard(final CSVImportSession importSession) { super("Codelist Mapping Import File Upload", ""); this.thisCard = this; this.importSession = importSession; this.fileUploadPanel = new CodelistMappingFileUploadPanel(res, thisCard,importSession); setContent(fileUploadPanel); } @Override public void setup() { Command sayNextCard = new Command() { public void execute() { CodelistMappingTableDetailCard detailsCard = new CodelistMappingTableDetailCard(importSession); getWizardWindow().addCard(detailsCard); Log.info("NextCard CodelistMappingTableDetailCard"); getWizardWindow().nextCard(); } }; getWizardWindow().setNextButtonCommand(sayNextCard); Command sayPreviousCard = new Command() { public void execute() { try { getWizardWindow().previousCard(); getWizardWindow().removeCard(thisCard); Log.info("Remove CSVUploadFileCard"); } catch (Exception e) { Log.error("sayPreviousCard :" + e.getLocalizedMessage()); } } }; getWizardWindow().setPreviousButtonCommand(sayPreviousCard); getWizardWindow().setEnableNextButton(false); } }