diff --git a/WizardTest-dev.launch b/WizardTest-dev.launch
new file mode 100644
index 0000000..a1c44df
--- /dev/null
+++ b/WizardTest-dev.launch
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/WizardTest-prod.launch b/WizardTest-prod.launch
new file mode 100644
index 0000000..c896829
--- /dev/null
+++ b/WizardTest-prod.launch
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..0c1528c
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,287 @@
+
+
+
+
+ maven-parent
+ org.gcube.tools
+ 1.0.0
+
+
+
+
+
+ 4.0.0
+ org.gcube.portlets.user
+ tabular-data-wizard-widget
+ 1.0.0-SNAPSHOT
+
+ tabular-data-wizard-widget
+ tabular-data-wizard-widget allows the creation of wizard for tabular data portlet
+
+
+ https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-wizard-widget
+
+
+
+
+ Giancarlo Panichi
+ g.panichi@isti.cnr.it
+ CNR Pisa, Istituto di Scienza e Tecnologie dell'Informazione "A. Faedo"
+
+ architect
+ developer
+
+
+
+
+
+
+ ${project.basedir}/distro
+ ${project.build.directory}/${project.build.finalName}
+ 2013-10-18
+ templates
+ distro
+ config
+
+
+ 2.5.1
+
+ ${env.GLOBUS_LOCATION}
+
+ UTF-8
+ UTF-8
+
+
+
+
+ localRun
+
+
+ org.slf4j
+ slf4j-api
+ compile
+
+
+ ch.qos.logback
+ logback-classic
+ 1.0.1
+ runtime
+
+
+
+
+
+
+
+ com.google.gwt
+ gwt-servlet
+
+
+ com.google.gwt
+ gwt-user
+
+
+
+ javax.validation
+ validation-api
+ 1.0.0.GA
+ test
+
+
+ javax.validation
+ validation-api
+ 1.0.0.GA
+ sources
+ test
+
+
+
+ com.sencha.gxt
+ gxt
+ 3.0.1
+
+
+
+
+
+ org.gcube.portlets.user
+ tabular-data-gwt-service
+ 1.0.0-SNAPSHOT
+
+
+
+
+
+
+ com.allen-sauer.gwt.log
+ gwt-log
+
+
+
+ org.slf4j
+ slf4j-api
+
+
+
+
+
+ junit
+ junit
+ 4.8.1
+ test
+
+
+
+
+
+
+
+
+
+ ${webappDirectory}/WEB-INF/classes
+
+
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+ 2.16
+
+ true
+
+
+
+
+ org.apache.maven.surefire
+ surefire-junit47
+ 2.16
+
+
+
+
+
+
+ org.codehaus.mojo
+ gwt-maven-plugin
+ ${gwtVersion}
+
+
+
+ resources
+
+
+
+
+ Wizard.html
+ ${webappDirectory}
+ org.gcube.portlets.user.td.wizardwidget.Wizard
+
+
+
+
+
+ maven-resources-plugin
+ 2.6
+
+
+ copy-profile
+ process-resources
+
+ copy-resources
+
+
+ ${configDirectory}
+
+
+ ${templatesDirectory}
+
+ profile.xml
+
+ true
+
+
+
+
+
+ copy-distro-resources
+ process-resources
+
+ copy-resources
+
+
+ ${distroDirectory}
+
+
+ ${templatesDirectory}
+
+ profile.xml
+ descriptor.xml
+
+ true
+
+
+
+
+
+
+
+ maven-clean-plugin
+ 2.5
+
+
+
+ ${distroDirectory}
+
+ **
+
+ false
+
+
+ ${configDirectory}
+
+ **
+
+ false
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-assembly-plugin
+ 2.2
+
+
+ ${templatesDirectory}/descriptor.xml
+
+
+
+
+ servicearchive
+ package
+
+ single
+
+
+
+
+
+
+
+
+
+
+
+
+ org.gcube.distribution
+ maven-portal-bom
+ LATEST
+ pom
+ import
+
+
+
+
+
diff --git a/src/main/java/org/gcube/portlets/user/td/wizardwidget/client/SimpleWizardCard.java b/src/main/java/org/gcube/portlets/user/td/wizardwidget/client/SimpleWizardCard.java
new file mode 100644
index 0000000..fb9811d
--- /dev/null
+++ b/src/main/java/org/gcube/portlets/user/td/wizardwidget/client/SimpleWizardCard.java
@@ -0,0 +1,35 @@
+/**
+ *
+ */
+package org.gcube.portlets.user.td.wizardwidget.client;
+
+import com.google.gwt.user.client.ui.HTML;
+import com.sencha.gxt.widget.core.client.ContentPanel;
+
+/**
+ *
+ * @author "Giancarlo Panichi"
+ * g.panichi@isti.cnr.it
+ *
+ */
+public class SimpleWizardCard extends WizardCard {
+
+ /**
+ * Create a new simple wizard card.
+ * @param title the card title.
+ * @param footer the card footer.
+ * @param content the card content.
+ */
+ public SimpleWizardCard(String title, String footer, String content) {
+ super(title, footer);
+
+ ContentPanel contentPanel = new ContentPanel();
+ contentPanel.setHeaderVisible(false);
+ HTML htmlContent = new HTML(content);
+ htmlContent.setStyleName("wizard-simple-content");
+ contentPanel.add(htmlContent);
+
+ setContent(contentPanel);
+ }
+
+}
diff --git a/src/main/java/org/gcube/portlets/user/td/wizardwidget/client/WizardCard.java b/src/main/java/org/gcube/portlets/user/td/wizardwidget/client/WizardCard.java
new file mode 100644
index 0000000..72d19aa
--- /dev/null
+++ b/src/main/java/org/gcube/portlets/user/td/wizardwidget/client/WizardCard.java
@@ -0,0 +1,275 @@
+/**
+ *
+ */
+package org.gcube.portlets.user.td.wizardwidget.client;
+
+import org.gcube.portlets.user.td.wizardwidget.client.dataresource.ResourceBundle;
+
+import com.allen_sauer.gwt.log.client.Log;
+
+import com.google.gwt.user.client.ui.HTML;
+import com.sencha.gxt.widget.core.client.Component;
+import com.sencha.gxt.widget.core.client.ContentPanel;
+import com.sencha.gxt.widget.core.client.container.BorderLayoutContainer;
+import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
+
+/**
+ *
+ * @author "Giancarlo Panichi"
+ * g.panichi@isti.cnr.it
+ *
+ */
+public class WizardCard extends BorderLayoutContainer {
+
+ private WizardWindow wizardWindow;
+ protected ContentPanel titlePanel;
+ protected ContentPanel footerPanel;
+ protected boolean calculateFooter = false;
+ protected HTML titleHtml;
+ protected HTML footerHtml;
+
+ final protected ResourceBundle res=ResourceBundle.INSTANCE;
+
+ /**
+ * Creates a new wizard card.
+ * The footer is automatically calculated.
+ * @param title the card title.
+ */
+ public WizardCard(String title) {
+ this(title,"");
+ calculateFooter = true;
+ }
+
+ /**
+ * Creates a new wizard card.
+ * @param title the card title.
+ * @param footer the card footer.
+ */
+ public WizardCard(String title, String footer) {
+ Log.info(title);
+ res.wizardCSS().ensureInjected();
+
+ //add the title panel
+ titlePanel = new ContentPanel();
+ titlePanel.setHeight(30);
+ titlePanel.setBodyStyle("background-color:#C3D9FF");
+ titlePanel.setHeaderVisible(false);
+
+ titleHtml = new HTML(title);
+ titleHtml.setStylePrimaryName(res.wizardCSS().getWizardTitle());
+ titlePanel.add(titleHtml);
+
+ setNorthWidget(titlePanel, new BorderLayoutData(30));
+
+ //add the footer panel
+ footerPanel = new ContentPanel();
+ footerPanel.setHeight(30);
+ footerPanel.setBodyStyle("background-color:#CDEB8B");
+ footerPanel.setHeaderVisible(false);
+
+ footerHtml = new HTML(footer);
+ footerHtml.setStylePrimaryName(res.wizardCSS().getWizardFooter());
+ footerPanel.add(footerHtml);
+
+ setSouthWidget(footerPanel, new BorderLayoutData(30));
+
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setTitle(String title)
+ {
+ titleHtml.setHTML("
"+title+"
");
+ }
+
+ /**
+ * Sets the card footer.
+ * @param footer the footer.
+ */
+ public void setFooter(String footer)
+ {
+ footerHtml.setHTML(""+footer+"
");
+ }
+
+ /**
+ * Sets the card content.
+ * @param content the card content.
+ */
+ public void setContent(Component content)
+ {
+ setCenterWidget(content);
+ }
+
+ /**
+ * Sets the card content.
+ * @param content the card content.
+ */
+ public void setContent(com.google.gwt.user.client.ui.Panel content)
+ {
+ setCenterWidget(content);
+ }
+
+ /**
+ * Enables the next button.
+ * @param enable true
to enable it, false
otherwise.
+ */
+ public void setEnableNextButton(boolean enable)
+ {
+ if (wizardWindow!=null){
+ wizardWindow.setEnableNextButton(enable);
+ }
+ }
+
+ /**
+ * Enables the back button.
+ * @param enable true
to enable the button, false
otherwise.
+ */
+ public void setEnableBackButton(boolean enable)
+ {
+ if (wizardWindow!=null){
+ wizardWindow.setEnableBackButton(enable);
+ }
+ }
+
+ /**
+ * Sets the next button label.
+ * @param text the button label.
+ */
+ public void setNextButtonText(String text)
+ {
+ if (wizardWindow!=null){
+ wizardWindow.setNextButtonText(text);
+ }
+ }
+
+ /**
+ * Sets the back button label.
+ * @param text the button label.
+ */
+
+ public void setBackButtonText(String text)
+ {
+ if (wizardWindow!=null){
+ wizardWindow.setBackButtonText(text);
+ }
+ }
+
+
+ /**
+ * Visible the next button.
+ * @param visible true
to show the button, false
otherwise.
+ */
+ public void setNextButtonVisible(boolean visible)
+ {
+ if (wizardWindow!=null){
+ wizardWindow.setNextButtonVisible(visible);
+ }
+ }
+
+ /**
+ * Visible the back button.
+ * @param visible true
to show the button, false
otherwise.
+ */
+ public void setBackButtonVisible(boolean visible)
+ {
+ if (wizardWindow!=null){
+ wizardWindow.setBackButtonVisible(visible);
+ }
+ }
+
+
+ public void setNextButtonToFinish()
+ {
+ if (wizardWindow!=null){
+ wizardWindow.setNextButtonToFinish();
+ }
+ }
+
+ /**
+ * Sets the WizardWindow for this import card.
+ * @param wizardWindow the WizardWindow.
+ */
+ protected void setWizardWindow(WizardWindow wizardWindow)
+ {
+ this.wizardWindow = wizardWindow;
+ if (calculateFooter) {
+ StringBuilder footer = new StringBuilder();
+ footer.append("Step ");
+ footer.append(getCardPosition());
+ footer.append(" of ");
+ footer.append(getCardSize());
+ setFooter(footer.toString());
+ }
+ }
+
+ /**
+ * Returns the current wizard window.
+ * @return the wizard window.
+ */
+ protected WizardWindow getWizardWindow()
+ {
+ if (wizardWindow==null) throw new IllegalStateException("No Wizard Window setup");
+ return wizardWindow;
+ }
+
+ public void addToWindowTitle(String toAdd)
+ {
+ wizardWindow.setTitle(wizardWindow.getOriginalTitle()+toAdd);
+ }
+
+ /**
+ * Called before the card is showed.
+ */
+ public void setup()
+ {
+ }
+
+ /**
+ * Called when the card is disposed.
+ */
+ public void dispose()
+ {}
+
+ /**
+ * Add a listener to the next button.
+ * @param listener the listener to add.
+ */
+ public void addNextButtonListener(SelectHandler listener)
+ {
+ if (wizardWindow!=null){
+ wizardWindow.addNextButtonListener(listener);
+ }
+ }
+
+ /**
+ * Gets the number of cards in the wizard window.
+ * @return the number of cards.
+ */
+ public int getCardSize()
+ {
+ return getWizardWindow().getCardStackSize();
+ }
+
+ /**
+ * Returns this card position on card list.
+ * @return the card position on the card stack.
+ */
+ public int getCardPosition()
+ {
+ int indexPosition = getWizardWindow().getCardStack().indexOf(this);
+ return (indexPosition>=0)?indexPosition+1:indexPosition;
+ }
+
+ public void showErrorAndHide(String title, final String failureReason, final String failureDetails, final Throwable throwable)
+ {
+ wizardWindow.showErrorAndHide(title, failureReason, failureDetails, throwable);
+ }
+
+ public void hideWindow()
+ {
+ wizardWindow.hide();
+ }
+
+}
diff --git a/src/main/java/org/gcube/portlets/user/td/wizardwidget/client/WizardEntry.java b/src/main/java/org/gcube/portlets/user/td/wizardwidget/client/WizardEntry.java
new file mode 100644
index 0000000..854c369
--- /dev/null
+++ b/src/main/java/org/gcube/portlets/user/td/wizardwidget/client/WizardEntry.java
@@ -0,0 +1,18 @@
+package org.gcube.portlets.user.td.wizardwidget.client;
+
+import com.allen_sauer.gwt.log.client.Log;
+import com.google.gwt.core.client.EntryPoint;
+
+
+public class WizardEntry implements EntryPoint {
+
+ @Override
+ public void onModuleLoad() {
+
+
+ WizardWindow wizardWindow = new WizardWindow("TestWindow");
+
+ Log.info("Window Id: " + wizardWindow.getId());
+
+ }
+}
diff --git a/src/main/java/org/gcube/portlets/user/td/wizardwidget/client/WizardListener.java b/src/main/java/org/gcube/portlets/user/td/wizardwidget/client/WizardListener.java
new file mode 100644
index 0000000..aea2077
--- /dev/null
+++ b/src/main/java/org/gcube/portlets/user/td/wizardwidget/client/WizardListener.java
@@ -0,0 +1,35 @@
+/**
+ *
+ */
+package org.gcube.portlets.user.td.wizardwidget.client;
+
+import org.gcube.portlets.user.td.gwtservice.shared.TRId;
+
+
+/**
+ *
+ * @author "Giancarlo Panichi"
+ * g.panichi@isti.cnr.it
+ *
+ */
+public interface WizardListener {
+
+ /**
+ * Called when the wizard is completed without errors
+ */
+ public void completed(TRId id);
+
+ /**
+ * Called when the wizard has been aborted by the user.
+ */
+ public void aborted();
+
+ /**
+ * Called when the something in the wizard is failed.
+ * @param throwable the exception or null
.
+ * @param reason the failure reason or null
.
+ * @param details the failure details or null
.
+ */
+ public void failed(Throwable throwable, String reason, String details);
+
+}
diff --git a/src/main/java/org/gcube/portlets/user/td/wizardwidget/client/WizardWindow.java b/src/main/java/org/gcube/portlets/user/td/wizardwidget/client/WizardWindow.java
new file mode 100644
index 0000000..a16e752
--- /dev/null
+++ b/src/main/java/org/gcube/portlets/user/td/wizardwidget/client/WizardWindow.java
@@ -0,0 +1,458 @@
+/**
+ *
+ */
+package org.gcube.portlets.user.td.wizardwidget.client;
+
+import java.util.ArrayList;
+
+import org.gcube.portlets.user.td.wizardwidget.client.util.ErrorMessageBox;
+import org.gcube.portlets.user.td.gwtservice.shared.TRId;
+
+import com.allen_sauer.gwt.log.client.Log;
+import com.google.gwt.core.client.Callback;
+import com.google.gwt.user.client.Command;
+import com.google.gwt.user.client.ui.Widget;
+import com.google.web.bindery.event.shared.SimpleEventBus;
+import com.sencha.gxt.core.client.resources.ThemeStyles;
+import com.sencha.gxt.widget.core.client.Dialog;
+import com.sencha.gxt.widget.core.client.Window;
+import com.sencha.gxt.widget.core.client.button.TextButton;
+import com.sencha.gxt.widget.core.client.container.CardLayoutContainer;
+import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer;
+import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.VerticalLayoutData;
+import com.sencha.gxt.widget.core.client.event.SelectEvent;
+import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
+import com.sencha.gxt.widget.core.client.toolbar.FillToolItem;
+import com.sencha.gxt.widget.core.client.toolbar.ToolBar;
+
+/**
+ *
+ * @author "Giancarlo Panichi" g.panichi@isti.cnr.it
+ *
+ */
+public class WizardWindow extends Window {
+
+ protected final String WIZARDWIDTH = "640px";
+ protected final String WIZARDHEIGHT = "480px";
+ protected final boolean WIZARRESIZABLE = false;
+ protected final boolean WIZARDCOLLAPSIBLE = true;
+ protected final String BUTTONBACKLABEL="Back";
+ protected final String BUTTONNEXTLABEL="Next";
+ protected final String BUTTONFINISHLABEL="Finish";
+
+
+ protected ArrayList cardStack = new ArrayList();
+
+ protected TextButton backButton;
+
+ protected TextButton nextButton;
+
+ protected String originalTitle;
+
+ protected boolean checkBeforeClose = true;
+
+ protected boolean nextCardFinish = false;
+
+ protected Command nextButtonAction = null;
+
+ protected Command previousButtonAction = null;
+
+ protected CardLayoutContainer cardContainer;
+
+ protected ArrayList listeners;
+
+ protected SimpleEventBus eventBus;
+
+ /**
+ * Create a new Wizard Window with the specified title.
+ *
+ * @param title
+ * the wizard window title.
+ */
+ public WizardWindow(String title) {
+ super();
+ this.eventBus = new SimpleEventBus();
+ Log.info(title);
+ // setModal(true);
+ setResizable(WIZARRESIZABLE);
+ setCollapsible(WIZARDCOLLAPSIBLE);
+ setWidth(WIZARDWIDTH);
+ setHeight(WIZARDHEIGHT);
+
+ listeners = new ArrayList();
+
+ setHeadingText(title);
+ this.originalTitle = title;
+
+ VerticalLayoutContainer container = new VerticalLayoutContainer();
+
+ cardContainer = new CardLayoutContainer();
+ container.add(cardContainer, new VerticalLayoutData(1, 1));
+
+ ToolBar toolbar = new ToolBar();
+ toolbar.addStyleName(ThemeStyles.getStyle().borderTop());
+
+ backButton = new TextButton(BUTTONBACKLABEL);
+ backButton.setEnabled(false);
+ backButton.setTabIndex(1001);
+ toolbar.add(backButton);
+ toolbar.add(new FillToolItem());
+
+ nextButton = new TextButton(BUTTONNEXTLABEL);
+ nextButton.setTabIndex(1000);
+ toolbar.add(nextButton);
+
+ toolbar.setLayoutData(new VerticalLayoutData(1, -1));
+ container.add(toolbar);
+
+ SelectHandler selectionHandler = new SelectHandler() {
+
+ @Override
+ public void onSelect(SelectEvent event) {
+ TextButton button = (TextButton) event.getSource();
+ String btnID = button.getId();
+
+ if (btnID.equals(backButton.getId())) {
+
+ if (previousButtonAction != null)
+ previousButtonAction.execute();
+ else
+ previousCard();
+ } else {
+
+ if (nextButtonAction != null)
+ nextButtonAction.execute();
+ else
+ nextCard();
+ }
+
+ }
+ };
+
+ backButton.addSelectHandler(selectionHandler);
+ nextButton.addSelectHandler(selectionHandler);
+
+ setWidget(container);
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void initTools() {
+ super.initTools();
+
+ closeBtn.addSelectHandler(new SelectHandler() {
+
+ @Override
+ public void onSelect(SelectEvent event) {
+ fireAborted();
+ hide();
+ }
+ });
+
+ }
+
+ public void addListener(WizardListener listener) {
+ listeners.add(listener);
+ }
+
+ public void removeListener(WizardListener listener) {
+ listeners.remove(listener);
+ }
+
+ /**
+ * Shows the next available card.
+ */
+ public void nextCard() {
+
+ Widget activeItem = cardContainer.getActiveWidget();
+
+ if (activeItem instanceof WizardCard)
+ ((WizardCard) activeItem).dispose();
+
+ int cardPos = cardStack.indexOf(activeItem);
+
+ // NEXT ->
+
+ nextButton.setEnabled(true);
+ backButton.setEnabled(true);
+
+ int newPos = cardPos + 1;
+
+ if (newPos == 0) {
+ // we are moving forward from the first card
+ backButton.setEnabled(false);
+ }
+
+ nextButtonAction = null;
+ previousButtonAction = null;
+ Log.info("cardStack size:" + cardStack.size());
+ WizardCard card = cardStack.get(newPos);
+ cardContainer.setActiveWidget(card);
+ doLayout();
+ if (card instanceof WizardCard)
+ ((WizardCard) card).setup();
+ }
+
+ /**
+ * Shows the previous available card.
+ */
+ public void previousCard() {
+ Widget activeItem = cardContainer.getActiveWidget();
+
+ if (activeItem instanceof WizardCard)
+ ((WizardCard) activeItem).dispose();
+
+ int cardPos = cardStack.indexOf(activeItem);
+
+ // BACK <-
+
+ nextButton.setEnabled(true);
+ backButton.setEnabled(true);
+
+ int newPos = cardPos - 1;
+
+ if (newPos == 0) {
+ backButton.setEnabled(false);
+ }
+
+ nextButtonAction = null;
+ previousButtonAction = null;
+
+ WizardCard card = cardStack.get(newPos);
+ cardContainer.setActiveWidget(card);
+ doLayout();
+ if (card instanceof WizardCard)
+ ((WizardCard) card).setup();
+ }
+
+ /**
+ * Returns the number of available cards.
+ *
+ * @return
+ */
+ public int getCardStackSize() {
+ return cardStack.size();
+ }
+
+ /**
+ * Returns the current active card.
+ *
+ * @return
+ */
+ public int getCurrentCard() {
+ return cardStack.indexOf(cardContainer.getActiveWidget());
+ }
+
+ public boolean checkBeforeClose() {
+ return true;
+ }
+
+ public void close(boolean check) {
+ checkBeforeClose = check;
+ hide();
+ }
+
+ /**
+ * Sets the label of next button to "Finish" value and add a close command
+ * to it.
+ */
+ public void setNextButtonToFinish() {
+ nextButton.setText(BUTTONFINISHLABEL);
+ nextButtonAction = new Command() {
+
+ public void execute() {
+ close(false);
+ }
+ };
+ }
+
+ /**
+ * Set the command for the next button.
+ *
+ * @param command
+ * the command to execute.
+ */
+ public void setNextButtonCommand(Command command) {
+ nextButtonAction = command;
+ }
+
+ /**
+ * Set the command for the previous button.
+ *
+ * @param command
+ * the command to execute.
+ */
+ public void setPreviousButtonCommand(Command command) {
+ previousButtonAction = command;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void show() {
+ super.show();
+
+ Widget activeItem = cardContainer.getActiveWidget();
+
+ if (activeItem instanceof WizardCard)
+ ((WizardCard) activeItem).setup();
+ }
+
+ /**
+ * Set the card list.
+ *
+ * @param cards
+ */
+ public void setCards(ArrayList cards) {
+ for (WizardCard card : cards) {
+ addCard(card);
+ }
+ }
+
+ /**
+ * Adds a card to this wizard.
+ *
+ * @param card
+ * the card to add.
+ */
+ public void addCard(WizardCard card) {
+ card.setWizardWindow(this);
+ cardContainer.add(card);
+ cardStack.add(card);
+ }
+
+ /**
+ * Remove a card to this wizard.
+ *
+ * @param card
+ * the card to add.
+ */
+ public void removeCard(WizardCard card) {
+ cardContainer.remove(card);
+ cardStack.remove(card);
+ }
+
+ /**
+ * Enables the next button on the wizard.
+ *
+ * @param enable
+ * true
to enable the next button,
+ * false
otherwise.
+ */
+ public void setEnableNextButton(boolean enable) {
+ nextButton.setEnabled(enable);
+ }
+
+ /**
+ * Enables the back button on the wizard.
+ *
+ * @param enable
+ * true
to enable the back button,
+ * false
otherwise.
+ */
+ public void setEnableBackButton(boolean enable) {
+ backButton.setEnabled(enable);
+ }
+
+ /**
+ * Sets the next button label.
+ *
+ * @param text
+ * the button label.
+ */
+ protected void setNextButtonText(String text) {
+ nextButton.setText(text);
+
+ }
+
+ /**
+ * Sets the back button label.
+ *
+ * @param text
+ * the button label.
+ */
+ protected void setBackButtonText(String text) {
+ backButton.setText(text);
+ }
+
+ /**
+ * Sets visible next button.
+ *
+ * @param visible
+ */
+ protected void setNextButtonVisible(boolean visible) {
+ nextButton.setVisible(visible);
+ }
+
+ /**
+ * Sets visible back button.
+ *
+ * @param visible
+ */
+ protected void setBackButtonVisible(boolean visible) {
+ backButton.setVisible(visible);
+ }
+
+ /**
+ * Add a listener to the next button.
+ *
+ * @param listener
+ * the listener to add.
+ */
+ protected void addNextButtonListener(SelectHandler listener) {
+ nextButton.addSelectHandler(listener);
+ }
+
+ /**
+ * @return the originalTitle
+ */
+ public String getOriginalTitle() {
+ return originalTitle;
+ }
+
+ /**
+ * Returns the card list.
+ *
+ * @return teh card list.
+ */
+ public ArrayList getCardStack() {
+ return cardStack;
+ }
+
+ public void showErrorAndHide(String title, final String failureReason,
+ final String failureDetails, final Throwable throwable) {
+ ErrorMessageBox.showError(title, failureReason, failureDetails,
+ new Callback