diff --git a/src/main/java/org/gcube/portlets/user/td/openwidget/client/dataresource/ResourceBundle.java b/src/main/java/org/gcube/portlets/user/td/openwidget/client/dataresource/ResourceBundle.java deleted file mode 100644 index a9e8b92..0000000 --- a/src/main/java/org/gcube/portlets/user/td/openwidget/client/dataresource/ResourceBundle.java +++ /dev/null @@ -1,31 +0,0 @@ -package org.gcube.portlets.user.td.openwidget.client.dataresource; - - -import com.google.gwt.core.client.GWT; -import com.google.gwt.resources.client.ClientBundle; -import com.google.gwt.resources.client.ImageResource; - -/** - * - * @author "Giancarlo Panichi" - * g.panichi@isti.cnr.it - * - */ -public interface ResourceBundle extends ClientBundle { - - public static final ResourceBundle IMPL=GWT.create(ResourceBundle.class); - - @Source("resources/TDOpen.css") - TDOpenCSS tdOpenCss(); - - @Source("resources/arrow-refresh.png") - ImageResource refresh(); - - @Source("resources/arrow-refresh_16.png") - ImageResource refresh16(); - - - @Source("resources/arrow-refresh_32.png") - ImageResource refresh32(); -} - \ No newline at end of file diff --git a/src/main/java/org/gcube/portlets/user/td/openwidget/client/dataresource/TDOpenCSS.java b/src/main/java/org/gcube/portlets/user/td/openwidget/client/dataresource/TDOpenCSS.java deleted file mode 100644 index ae7850e..0000000 --- a/src/main/java/org/gcube/portlets/user/td/openwidget/client/dataresource/TDOpenCSS.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * - */ -package org.gcube.portlets.user.td.openwidget.client.dataresource; - -import com.google.gwt.resources.client.CssResource; - -/** - * - * @author "Giancarlo Panichi" - * g.panichi@isti.cnr.it - * - */ -public interface TDOpenCSS extends CssResource { - - @ClassName("wizard-title") - public String getWizardTitle(); - - @ClassName("wizard-footer") - public String getWizardFooter(); - - @ClassName("source-selection-hover") - public String getSourceSelectionHover(); - -// @ClassName("column-excluded") -// public String getColumnExcluded(); - - @ClassName("importSelection-sources") - public String getImportSelectionSources(); - - @ClassName("importSelection-source") - public String getImportSelectionSource(); - - @ClassName("sdmxRegistryUrlStyle") - public String getSDMXRegistryUrlStyle(); - - @ClassName("sdmxRegistryUrlInputStyle") - public String getSDMXRegistryUrlInputStyle(); - - -} diff --git a/src/main/java/org/gcube/portlets/user/td/openwidget/client/general/SimpleWizardCard.java b/src/main/java/org/gcube/portlets/user/td/openwidget/client/general/SimpleWizardCard.java deleted file mode 100644 index b6d2921..0000000 --- a/src/main/java/org/gcube/portlets/user/td/openwidget/client/general/SimpleWizardCard.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * - */ -package org.gcube.portlets.user.td.openwidget.client.general; - -import com.google.gwt.user.client.ui.HTML; -import com.sencha.gxt.widget.core.client.ContentPanel; - -/** - * A simple wizard card. - * @author Federico De Faveri defaveri@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/openwidget/client/general/WizardCard.java b/src/main/java/org/gcube/portlets/user/td/openwidget/client/general/WizardCard.java deleted file mode 100644 index 2159992..0000000 --- a/src/main/java/org/gcube/portlets/user/td/openwidget/client/general/WizardCard.java +++ /dev/null @@ -1,272 +0,0 @@ -/** - * - */ -package org.gcube.portlets.user.td.openwidget.client.general; - -import org.gcube.portlets.user.td.openwidget.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; - -/** - * Represents a Wizard Card. - */ -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.IMPL; - - /** - * 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.tdOpenCss().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.tdOpenCss().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.tdOpenCss().getWizardFooter()); - footerPanel.add(footerHtml); - - setSouthWidget(footerPanel, new BorderLayoutData(30)); - - } - - - /** - * {@inheritDoc} - */ - public void setTitle(String title) - { - titleHtml.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 enabletrue
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/openwidget/client/general/WizardListener.java b/src/main/java/org/gcube/portlets/user/td/openwidget/client/general/WizardListener.java
deleted file mode 100644
index 8e363f6..0000000
--- a/src/main/java/org/gcube/portlets/user/td/openwidget/client/general/WizardListener.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/**
- *
- */
-package org.gcube.portlets.user.td.openwidget.client.general;
-
-import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
-
-
-
-/**
- *
- * @author "Giancarlo Panichi"
- * g.panichi@isti.cnr.it
- *
- */
-public interface WizardListener {
-
- /**
- * Called when the wizard is completed without errors
- * and return TableId
- */
- public void completed(TRId trId);
-
- /**
- * 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/openwidget/client/general/WizardWindow.java b/src/main/java/org/gcube/portlets/user/td/openwidget/client/general/WizardWindow.java
deleted file mode 100644
index 84c6fdb..0000000
--- a/src/main/java/org/gcube/portlets/user/td/openwidget/client/general/WizardWindow.java
+++ /dev/null
@@ -1,491 +0,0 @@
-/**
- *
- */
-package org.gcube.portlets.user.td.openwidget.client.general;
-
-import java.util.ArrayList;
-
-import org.gcube.portlets.user.td.openwidget.client.util.ErrorMessageBox;
-import org.gcube.portlets.user.td.widgetcommonevent.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 String WIZARDWIDTH="640px";
- protected String WIZARDHEIGHT="480px";
- protected boolean WIZARRESIZABLE=false;
- protected boolean WIZARDCOLLAPSIBLE = true;
- protected String BUTTONBACKLABEL="Back";
- protected String BUTTONNEXTLABEL="Open";
- protected String BUTTONFINISHLABEL="Finish";
-
-
- protected ArrayListtrue
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