Updated Rule

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-portlet@114021 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2015-04-14 12:46:21 +00:00
parent 6b80005f53
commit a0891c2e3b
3 changed files with 24 additions and 22 deletions

View File

@ -38,7 +38,7 @@ public class RuleToolBar {
//Rules //Rules
private TextButton ruleNewButton; private TextButton ruleNewButton;
private TextButton ruleEditButton; private TextButton ruleOpenButton;
private TextButton ruleDeleteButton; private TextButton ruleDeleteButton;
private TextButton ruleApplyButton; private TextButton ruleApplyButton;
private TextButton ruleShareButton; private TextButton ruleShareButton;
@ -72,7 +72,7 @@ public class RuleToolBar {
rulesGroup.add(templateLayout); rulesGroup.add(templateLayout);
ruleNewButton = new TextButton(msgs.ruleNewButton(), ruleNewButton = new TextButton(msgs.ruleNewButton(),
TabularDataResources.INSTANCE.templateAdd32()); TabularDataResources.INSTANCE.ruleAdd32());
ruleNewButton.enable(); ruleNewButton.enable();
ruleNewButton.setToolTip(msgs.ruleNewButtonToolTip()); ruleNewButton.setToolTip(msgs.ruleNewButtonToolTip());
ruleNewButton.setScale(ButtonScale.LARGE); ruleNewButton.setScale(ButtonScale.LARGE);
@ -89,14 +89,14 @@ public class RuleToolBar {
templateLayout.setWidget(0, 0, ruleNewButton); templateLayout.setWidget(0, 0, ruleNewButton);
templateLayout.getFlexCellFormatter().setRowSpan(0, 0, 2); templateLayout.getFlexCellFormatter().setRowSpan(0, 0, 2);
ruleEditButton = new TextButton(msgs.ruleEditButton(), ruleOpenButton = new TextButton(msgs.ruleOpenButton(),
TabularDataResources.INSTANCE.templateEdit32()); TabularDataResources.INSTANCE.ruleEdit32());
ruleEditButton.enable(); ruleOpenButton.enable();
ruleEditButton.setToolTip(msgs.ruleEditButtonToolTip()); ruleOpenButton.setToolTip(msgs.ruleOpenButtonToolTip());
ruleEditButton.setScale(ButtonScale.LARGE); ruleOpenButton.setScale(ButtonScale.LARGE);
ruleEditButton.setIconAlign(IconAlign.TOP); ruleOpenButton.setIconAlign(IconAlign.TOP);
ruleEditButton.setArrowAlign(ButtonArrowAlign.BOTTOM); ruleOpenButton.setArrowAlign(ButtonArrowAlign.BOTTOM);
ruleEditButton.addSelectHandler(new SelectHandler() { ruleOpenButton.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) { public void onSelect(SelectEvent event) {
eventBus.fireEvent(new RibbonEvent( 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); templateLayout.getFlexCellFormatter().setRowSpan(0, 1, 2);
ruleDeleteButton = new TextButton(msgs.ruleDeleteButton(), ruleDeleteButton = new TextButton(msgs.ruleDeleteButton(),
TabularDataResources.INSTANCE.templateDelete32()); TabularDataResources.INSTANCE.ruleDelete32());
ruleDeleteButton.enable(); ruleDeleteButton.enable();
ruleDeleteButton.setToolTip(msgs.ruleDeleteButtonToolTip()); ruleDeleteButton.setToolTip(msgs.ruleDeleteButtonToolTip());
ruleDeleteButton.setScale(ButtonScale.LARGE); ruleDeleteButton.setScale(ButtonScale.LARGE);
@ -128,7 +128,7 @@ public class RuleToolBar {
ruleApplyButton = new TextButton(msgs.ruleApplyButton(), ruleApplyButton = new TextButton(msgs.ruleApplyButton(),
TabularDataResources.INSTANCE.templateApply32()); TabularDataResources.INSTANCE.ruleApply32());
ruleApplyButton.disable(); ruleApplyButton.disable();
ruleApplyButton.setScale(ButtonScale.LARGE); ruleApplyButton.setScale(ButtonScale.LARGE);
ruleApplyButton.setIconAlign(IconAlign.TOP); ruleApplyButton.setIconAlign(IconAlign.TOP);
@ -146,7 +146,7 @@ public class RuleToolBar {
ruleShareButton = new TextButton(msgs.ruleShareButton(), ruleShareButton = new TextButton(msgs.ruleShareButton(),
TabularDataResources.INSTANCE.templateShare32()); TabularDataResources.INSTANCE.ruleShare32());
ruleShareButton.enable(); ruleShareButton.enable();
ruleShareButton.setScale(ButtonScale.LARGE); ruleShareButton.setScale(ButtonScale.LARGE);
ruleShareButton.setIconAlign(IconAlign.TOP); ruleShareButton.setIconAlign(IconAlign.TOP);
@ -191,7 +191,7 @@ public class RuleToolBar {
try { try {
switch (uiStateType) { switch (uiStateType) {
case START: case START:
ruleEditButton.enable(); ruleOpenButton.enable();
ruleNewButton.enable(); ruleNewButton.enable();
ruleDeleteButton.enable(); ruleDeleteButton.enable();
ruleApplyButton.disable(); ruleApplyButton.disable();
@ -199,7 +199,7 @@ public class RuleToolBar {
break; break;
case TR_CLOSE: case TR_CLOSE:
case TR_READONLY: case TR_READONLY:
ruleEditButton.enable(); ruleOpenButton.enable();
ruleNewButton.enable(); ruleNewButton.enable();
ruleDeleteButton.enable(); ruleDeleteButton.enable();
ruleApplyButton.disable(); ruleApplyButton.disable();
@ -208,14 +208,14 @@ public class RuleToolBar {
case TR_OPEN: case TR_OPEN:
case TABLEUPDATE: case TABLEUPDATE:
case TABLECURATION: case TABLECURATION:
ruleEditButton.enable(); ruleOpenButton.enable();
ruleNewButton.enable(); ruleNewButton.enable();
ruleDeleteButton.enable(); ruleDeleteButton.enable();
ruleApplyButton.enable(); ruleApplyButton.enable();
ruleShareButton.enable(); ruleShareButton.enable();
break; break;
case WIZARD_OPEN: case WIZARD_OPEN:
ruleEditButton.disable(); ruleOpenButton.disable();
ruleNewButton.disable(); ruleNewButton.disable();
ruleDeleteButton.disable(); ruleDeleteButton.disable();
ruleApplyButton.disable(); ruleApplyButton.disable();

View File

@ -19,11 +19,11 @@ public interface RuleToolBarMessages extends Messages {
@DefaultMessage("New") @DefaultMessage("New")
String ruleNewButtonToolTip(); String ruleNewButtonToolTip();
@DefaultMessage("Edit") @DefaultMessage("Open")
String ruleEditButton(); String ruleOpenButton();
@DefaultMessage("Edit") @DefaultMessage("Open")
String ruleEditButtonToolTip(); String ruleOpenButtonToolTip();
@DefaultMessage("Delete") @DefaultMessage("Delete")
String ruleDeleteButton(); String ruleDeleteButton();

View File

@ -58,11 +58,13 @@ public class TabularDataRibbon {
con.add(modifyToolBar.getToolBar(), vldata); con.add(modifyToolBar.getToolBar(), vldata);
ribbon.add(con, msgs.modify()); ribbon.add(con, msgs.modify());
ruleToolBar = new RuleToolBar(eventBus); ruleToolBar = new RuleToolBar(eventBus);
con = new VerticalLayoutContainer(); con = new VerticalLayoutContainer();
con.add(ruleToolBar.getToolBar(), vldata); con.add(ruleToolBar.getToolBar(), vldata);
ribbon.add(con, msgs.rule()); ribbon.add(con, msgs.rule());
templateToolBar = new TemplateToolBar(eventBus); templateToolBar = new TemplateToolBar(eventBus);
con = new VerticalLayoutContainer(); con = new VerticalLayoutContainer();
con.add(templateToolBar.getToolBar(), vldata); con.add(templateToolBar.getToolBar(), vldata);