From 2927ffafd43c72abcf9a854590ed94e104934ae5 Mon Sep 17 00:00:00 2001 From: Giancarlo Panichi Date: Thu, 17 Apr 2014 10:49:08 +0000 Subject: [PATCH] Minor Update git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-portlet@94964 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../user/td/client/TabularDataController.java | 2 +- .../user/td/client/ribbon/FileToolBar.java | 42 ++++++++++--------- 2 files changed, 24 insertions(+), 20 deletions(-) diff --git a/src/main/java/org/gcube/portlets/user/td/client/TabularDataController.java b/src/main/java/org/gcube/portlets/user/td/client/TabularDataController.java index 0e4a197..308a776 100644 --- a/src/main/java/org/gcube/portlets/user/td/client/TabularDataController.java +++ b/src/main/java/org/gcube/portlets/user/td/client/TabularDataController.java @@ -399,7 +399,7 @@ public class TabularDataController { break; case HISTORY: break; - case DISCARD: + case UNDO: callDiscard(); break; case DISCARDALL: diff --git a/src/main/java/org/gcube/portlets/user/td/client/ribbon/FileToolBar.java b/src/main/java/org/gcube/portlets/user/td/client/ribbon/FileToolBar.java index c4a7c61..1248ae4 100644 --- a/src/main/java/org/gcube/portlets/user/td/client/ribbon/FileToolBar.java +++ b/src/main/java/org/gcube/portlets/user/td/client/ribbon/FileToolBar.java @@ -63,8 +63,8 @@ public class FileToolBar { // History protected TextButton historyButton; - protected TextButton discardButton; - protected TextButton discardAllButton; + protected TextButton undoButton; + //protected TextButton discardAllButton; protected TextButton helpButton; @@ -440,19 +440,23 @@ public class FileToolBar { historyLayout.setWidget(0, 0, historyButton); historyLayout.getFlexCellFormatter().setRowSpan(0, 0, 2); - discardButton = new TextButton("Discard", - TabularDataResources.INSTANCE.discard()); - discardButton.disable(); - discardButton.setToolTip("Discard the last operation"); - historyLayout.setWidget(0, 1, discardButton); - discardButton.addSelectHandler(new SelectHandler() { + undoButton = new TextButton("Undo", + TabularDataResources.INSTANCE.discard32()); + undoButton.disable(); + undoButton.setScale(ButtonScale.LARGE); + undoButton.setIconAlign(IconAlign.TOP); + undoButton.setToolTip("Discard last operation"); + undoButton.setArrowAlign(ButtonArrowAlign.BOTTOM); + undoButton.addSelectHandler(new SelectHandler() { public void onSelect(SelectEvent event) { - eventBus.fireEvent(new RibbonEvent(RibbonType.DISCARD)); + eventBus.fireEvent(new RibbonEvent(RibbonType.UNDO)); } }); + historyLayout.setWidget(0, 1, undoButton); + historyLayout.getFlexCellFormatter().setRowSpan(0, 1, 2); - discardAllButton = new TextButton("Discard All", + /*discardAllButton = new TextButton("Discard All", TabularDataResources.INSTANCE.discardAll()); discardAllButton.disable(); discardAllButton.setToolTip("Discard all unsaved operations"); @@ -462,7 +466,7 @@ public class FileToolBar { public void onSelect(SelectEvent event) { eventBus.fireEvent(new RibbonEvent(RibbonType.DISCARDALL)); } - }); + });*/ cleanCells(historyLayout.getElement()); @@ -538,8 +542,8 @@ public class FileToolBar { templateDeleteButton.enable(); timelineButton.disable(); historyButton.disable(); - discardButton.disable(); - discardAllButton.disable(); + undoButton.disable(); + //discardAllButton.disable(); break; case TR_CLOSE: case TR_READONLY: @@ -560,8 +564,8 @@ public class FileToolBar { templateDeleteButton.enable(); timelineButton.disable(); historyButton.disable(); - discardButton.disable(); - discardAllButton.disable(); + undoButton.disable(); + //discardAllButton.disable(); break; case TR_OPEN: case TABLEUPDATE: @@ -588,8 +592,8 @@ public class FileToolBar { templateDeleteButton.enable(); timelineButton.enable(); historyButton.enable(); - discardButton.enable(); - discardAllButton.disable(); + undoButton.enable(); + //discardAllButton.disable(); break; case WIZARD_OPEN: openButton.disable(); @@ -609,8 +613,8 @@ public class FileToolBar { templateDeleteButton.disable(); timelineButton.disable(); historyButton.disable(); - discardButton.disable(); - discardAllButton.disable(); + undoButton.disable(); + //discardAllButton.disable(); break; default: break;