From a0891c2e3b8a6bf4af4dfb90ca4f603c428fbcea Mon Sep 17 00:00:00 2001 From: Giancarlo Panichi Date: Tue, 14 Apr 2015 12:46:21 +0000 Subject: [PATCH] Updated Rule git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-portlet@114021 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../user/td/client/ribbon/RuleToolBar.java | 36 +++++++++---------- .../td/client/ribbon/RuleToolBarMessages.java | 8 ++--- .../td/client/ribbon/TabularDataRibbon.java | 2 ++ 3 files changed, 24 insertions(+), 22 deletions(-) diff --git a/src/main/java/org/gcube/portlets/user/td/client/ribbon/RuleToolBar.java b/src/main/java/org/gcube/portlets/user/td/client/ribbon/RuleToolBar.java index b48451b..2ba2a31 100644 --- a/src/main/java/org/gcube/portlets/user/td/client/ribbon/RuleToolBar.java +++ b/src/main/java/org/gcube/portlets/user/td/client/ribbon/RuleToolBar.java @@ -38,7 +38,7 @@ public class RuleToolBar { //Rules private TextButton ruleNewButton; - private TextButton ruleEditButton; + private TextButton ruleOpenButton; private TextButton ruleDeleteButton; private TextButton ruleApplyButton; private TextButton ruleShareButton; @@ -72,7 +72,7 @@ public class RuleToolBar { rulesGroup.add(templateLayout); ruleNewButton = new TextButton(msgs.ruleNewButton(), - TabularDataResources.INSTANCE.templateAdd32()); + TabularDataResources.INSTANCE.ruleAdd32()); ruleNewButton.enable(); ruleNewButton.setToolTip(msgs.ruleNewButtonToolTip()); ruleNewButton.setScale(ButtonScale.LARGE); @@ -89,14 +89,14 @@ public class RuleToolBar { templateLayout.setWidget(0, 0, ruleNewButton); templateLayout.getFlexCellFormatter().setRowSpan(0, 0, 2); - ruleEditButton = new TextButton(msgs.ruleEditButton(), - TabularDataResources.INSTANCE.templateEdit32()); - ruleEditButton.enable(); - ruleEditButton.setToolTip(msgs.ruleEditButtonToolTip()); - ruleEditButton.setScale(ButtonScale.LARGE); - ruleEditButton.setIconAlign(IconAlign.TOP); - ruleEditButton.setArrowAlign(ButtonArrowAlign.BOTTOM); - ruleEditButton.addSelectHandler(new SelectHandler() { + ruleOpenButton = new TextButton(msgs.ruleOpenButton(), + TabularDataResources.INSTANCE.ruleEdit32()); + ruleOpenButton.enable(); + ruleOpenButton.setToolTip(msgs.ruleOpenButtonToolTip()); + ruleOpenButton.setScale(ButtonScale.LARGE); + ruleOpenButton.setIconAlign(IconAlign.TOP); + ruleOpenButton.setArrowAlign(ButtonArrowAlign.BOTTOM); + ruleOpenButton.addSelectHandler(new SelectHandler() { public void onSelect(SelectEvent event) { eventBus.fireEvent(new RibbonEvent( @@ -104,12 +104,12 @@ public class RuleToolBar { } }); - templateLayout.setWidget(0, 1, ruleEditButton); + templateLayout.setWidget(0, 1, ruleOpenButton); templateLayout.getFlexCellFormatter().setRowSpan(0, 1, 2); ruleDeleteButton = new TextButton(msgs.ruleDeleteButton(), - TabularDataResources.INSTANCE.templateDelete32()); + TabularDataResources.INSTANCE.ruleDelete32()); ruleDeleteButton.enable(); ruleDeleteButton.setToolTip(msgs.ruleDeleteButtonToolTip()); ruleDeleteButton.setScale(ButtonScale.LARGE); @@ -128,7 +128,7 @@ public class RuleToolBar { ruleApplyButton = new TextButton(msgs.ruleApplyButton(), - TabularDataResources.INSTANCE.templateApply32()); + TabularDataResources.INSTANCE.ruleApply32()); ruleApplyButton.disable(); ruleApplyButton.setScale(ButtonScale.LARGE); ruleApplyButton.setIconAlign(IconAlign.TOP); @@ -146,7 +146,7 @@ public class RuleToolBar { ruleShareButton = new TextButton(msgs.ruleShareButton(), - TabularDataResources.INSTANCE.templateShare32()); + TabularDataResources.INSTANCE.ruleShare32()); ruleShareButton.enable(); ruleShareButton.setScale(ButtonScale.LARGE); ruleShareButton.setIconAlign(IconAlign.TOP); @@ -191,7 +191,7 @@ public class RuleToolBar { try { switch (uiStateType) { case START: - ruleEditButton.enable(); + ruleOpenButton.enable(); ruleNewButton.enable(); ruleDeleteButton.enable(); ruleApplyButton.disable(); @@ -199,7 +199,7 @@ public class RuleToolBar { break; case TR_CLOSE: case TR_READONLY: - ruleEditButton.enable(); + ruleOpenButton.enable(); ruleNewButton.enable(); ruleDeleteButton.enable(); ruleApplyButton.disable(); @@ -208,14 +208,14 @@ public class RuleToolBar { case TR_OPEN: case TABLEUPDATE: case TABLECURATION: - ruleEditButton.enable(); + ruleOpenButton.enable(); ruleNewButton.enable(); ruleDeleteButton.enable(); ruleApplyButton.enable(); ruleShareButton.enable(); break; case WIZARD_OPEN: - ruleEditButton.disable(); + ruleOpenButton.disable(); ruleNewButton.disable(); ruleDeleteButton.disable(); ruleApplyButton.disable(); diff --git a/src/main/java/org/gcube/portlets/user/td/client/ribbon/RuleToolBarMessages.java b/src/main/java/org/gcube/portlets/user/td/client/ribbon/RuleToolBarMessages.java index 2cc8fdb..3652d54 100644 --- a/src/main/java/org/gcube/portlets/user/td/client/ribbon/RuleToolBarMessages.java +++ b/src/main/java/org/gcube/portlets/user/td/client/ribbon/RuleToolBarMessages.java @@ -19,11 +19,11 @@ public interface RuleToolBarMessages extends Messages { @DefaultMessage("New") String ruleNewButtonToolTip(); - @DefaultMessage("Edit") - String ruleEditButton(); + @DefaultMessage("Open") + String ruleOpenButton(); - @DefaultMessage("Edit") - String ruleEditButtonToolTip(); + @DefaultMessage("Open") + String ruleOpenButtonToolTip(); @DefaultMessage("Delete") String ruleDeleteButton(); diff --git a/src/main/java/org/gcube/portlets/user/td/client/ribbon/TabularDataRibbon.java b/src/main/java/org/gcube/portlets/user/td/client/ribbon/TabularDataRibbon.java index d92c616..77df75b 100644 --- a/src/main/java/org/gcube/portlets/user/td/client/ribbon/TabularDataRibbon.java +++ b/src/main/java/org/gcube/portlets/user/td/client/ribbon/TabularDataRibbon.java @@ -58,11 +58,13 @@ public class TabularDataRibbon { con.add(modifyToolBar.getToolBar(), vldata); ribbon.add(con, msgs.modify()); + ruleToolBar = new RuleToolBar(eventBus); con = new VerticalLayoutContainer(); con.add(ruleToolBar.getToolBar(), vldata); ribbon.add(con, msgs.rule()); + templateToolBar = new TemplateToolBar(eventBus); con = new VerticalLayoutContainer(); con.add(templateToolBar.getToolBar(), vldata);