81: Allow the creation and use of expressions on multi column in TDM portlet
Task-Url: https://support.d4science.org/issues/81 Added Rule On Table to Ribbon git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-portlet@114902 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
312131245d
commit
c35ff062c1
|
@ -37,6 +37,7 @@ import org.gcube.portlets.user.td.rulewidget.client.RuleApplyDialog;
|
|||
import org.gcube.portlets.user.td.rulewidget.client.RuleDeleteDialog;
|
||||
import org.gcube.portlets.user.td.rulewidget.client.RuleOpenDialog;
|
||||
import org.gcube.portlets.user.td.rulewidget.client.RuleShareDialog;
|
||||
import org.gcube.portlets.user.td.rulewidget.client.multicolumn.RuleOnTableNewWizard;
|
||||
import org.gcube.portlets.user.td.sdmxexportwidget.client.SDMXExportWizardTD;
|
||||
import org.gcube.portlets.user.td.sdmximportwidget.client.SDMXImportWizardTD;
|
||||
import org.gcube.portlets.user.td.sharewidget.client.TRShare;
|
||||
|
@ -894,24 +895,30 @@ public class TabularDataController {
|
|||
break;
|
||||
case COLUMN_BATCH_REPLACE:
|
||||
break;
|
||||
case RULE_NEW:
|
||||
openNewRule();
|
||||
break;
|
||||
case RULE_MODIFY:
|
||||
openModifyRule();
|
||||
break;
|
||||
case RULE_DELETE:
|
||||
openDeleteRule();
|
||||
break;
|
||||
case RULE_APPLY:
|
||||
openApplyRule();
|
||||
break;
|
||||
case RULES_ACTIVE:
|
||||
openRulesAppliedOnTabularResource();
|
||||
openRulesActiveOnTabularResource();
|
||||
break;
|
||||
case RULE_SHARE:
|
||||
openShareRule();
|
||||
break;
|
||||
case RULE_ON_COLUMN_NEW:
|
||||
openOnColumnNewRule();
|
||||
break;
|
||||
case RULE_ON_COLUMN_APPLY:
|
||||
openOnColumnApplyRule();
|
||||
break;
|
||||
case RULE_ON_TABLE_NEW:
|
||||
openOnTableNewRule();
|
||||
break;
|
||||
case RULE_ON_TABLE_APPLY:
|
||||
openOnTableApplyRule();
|
||||
break;
|
||||
case TEMPLATE_OPEN:
|
||||
openTemplateOpen();
|
||||
break;
|
||||
|
@ -1712,12 +1719,7 @@ public class TabularDataController {
|
|||
});
|
||||
}
|
||||
|
||||
private void openNewRule() {
|
||||
Log.debug("Request Open New Rule Dialog");
|
||||
RuleOnColumnCreateDialog cfDialog = new RuleOnColumnCreateDialog(eventBus);
|
||||
cfDialog.show();
|
||||
|
||||
}
|
||||
|
||||
private void openModifyRule() {
|
||||
Log.debug("Request Open Modify Rule Dialog");
|
||||
|
@ -1726,6 +1728,8 @@ public class TabularDataController {
|
|||
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void openDeleteRule() {
|
||||
Log.debug("Request Open Delete Rule Dialog");
|
||||
RuleDeleteDialog cfDialog = new RuleDeleteDialog(eventBus);
|
||||
|
@ -1733,10 +1737,11 @@ public class TabularDataController {
|
|||
|
||||
}
|
||||
|
||||
private void openApplyRule() {
|
||||
Log.debug("Request Open Apply Rule Dialog");
|
||||
|
||||
private void openRulesActiveOnTabularResource() {
|
||||
Log.debug("Request Open Rules Active on TabularResource Dialog");
|
||||
if (trId != null) {
|
||||
RuleApplyDialog raDialog = new RuleApplyDialog(
|
||||
RuleActiveDialog raDialog = new RuleActiveDialog(
|
||||
trId, eventBus);
|
||||
raDialog.show();
|
||||
} else {
|
||||
|
@ -1755,10 +1760,19 @@ public class TabularDataController {
|
|||
|
||||
}
|
||||
|
||||
private void openRulesAppliedOnTabularResource() {
|
||||
Log.debug("Request Open Rules Applied on TabularResource Dialog");
|
||||
|
||||
|
||||
private void openOnColumnNewRule() {
|
||||
Log.debug("Request Open On Column New Rule Dialog");
|
||||
RuleOnColumnCreateDialog cfDialog = new RuleOnColumnCreateDialog(eventBus);
|
||||
cfDialog.show();
|
||||
|
||||
}
|
||||
|
||||
private void openOnColumnApplyRule() {
|
||||
Log.debug("Request Open On Column Apply Rule Dialog");
|
||||
if (trId != null) {
|
||||
RuleActiveDialog raDialog = new RuleActiveDialog(
|
||||
RuleApplyDialog raDialog = new RuleApplyDialog(
|
||||
trId, eventBus);
|
||||
raDialog.show();
|
||||
} else {
|
||||
|
@ -1770,6 +1784,64 @@ public class TabularDataController {
|
|||
|
||||
}
|
||||
|
||||
private void openOnTableNewRule() {
|
||||
Log.debug("Request Open On Table New Rule Dialog");
|
||||
GWT.runAsync(new RunAsyncCallback() {
|
||||
|
||||
public void onSuccess() {
|
||||
openWizard();
|
||||
RuleOnTableNewWizard ruleOnTableNewWizard = new RuleOnTableNewWizard(eventBus);
|
||||
|
||||
ruleOnTableNewWizard.addListener(new WizardListener() {
|
||||
public void failed(String title, String message,
|
||||
String details, Throwable throwable) {
|
||||
UtilsGXT3.alert(title, message + " " + details);
|
||||
resumeUIState();
|
||||
}
|
||||
|
||||
public void completed(TRId id) {
|
||||
resumeUIState();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void putInBackground() {
|
||||
Log.debug("PutInBakground");
|
||||
resumeUIState();
|
||||
}
|
||||
|
||||
public void aborted() {
|
||||
resumeUIState();
|
||||
}
|
||||
});
|
||||
|
||||
ruleOnTableNewWizard.show();
|
||||
}
|
||||
|
||||
public void onFailure(Throwable reason) {
|
||||
asyncCodeLoadingFailed(reason);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void openOnTableApplyRule() {
|
||||
Log.debug("Request Open On Table Apply Rule Dialog");
|
||||
/*if (trId != null) {
|
||||
RuleApplyDialog raDialog = new RuleApplyDialog(
|
||||
trId, eventBus);
|
||||
raDialog.show();
|
||||
} else {
|
||||
Log.error("TRId is null");
|
||||
UtilsGXT3.alert("Error",
|
||||
"No current tabular resource present");
|
||||
}*/
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private void callDiscard() {
|
||||
|
|
|
@ -46,6 +46,10 @@ public class RuleToolBar {
|
|||
private TextButton ruleOnColumnNewButton;
|
||||
private TextButton ruleOnColumnApplyButton;
|
||||
|
||||
// On Table
|
||||
private TextButton ruleOnTableNewButton;
|
||||
private TextButton ruleOnTableApplyButton;
|
||||
|
||||
public RuleToolBar(EventBus eventBus) {
|
||||
this.eventBus = eventBus;
|
||||
build();
|
||||
|
@ -107,20 +111,17 @@ public class RuleToolBar {
|
|||
ruleLayout.setWidget(0, 1, ruleDeleteButton);
|
||||
ruleLayout.getFlexCellFormatter().setRowSpan(0, 1, 2);
|
||||
|
||||
ruleActiveButton = new TextButton(
|
||||
msgs.ruleActiveButton(),
|
||||
ruleActiveButton = new TextButton(msgs.ruleActiveButton(),
|
||||
TabularDataResources.INSTANCE.ruleActive32());
|
||||
ruleActiveButton.disable();
|
||||
ruleActiveButton.setScale(ButtonScale.LARGE);
|
||||
ruleActiveButton.setIconAlign(IconAlign.TOP);
|
||||
ruleActiveButton.setToolTip(msgs
|
||||
.ruleActiveButtonToolTip());
|
||||
ruleActiveButton.setToolTip(msgs.ruleActiveButtonToolTip());
|
||||
ruleActiveButton.setArrowAlign(ButtonArrowAlign.BOTTOM);
|
||||
ruleActiveButton.addSelectHandler(new SelectHandler() {
|
||||
|
||||
public void onSelect(SelectEvent event) {
|
||||
eventBus.fireEvent(new RibbonEvent(
|
||||
RibbonType.RULES_ACTIVE));
|
||||
eventBus.fireEvent(new RibbonEvent(RibbonType.RULES_ACTIVE));
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -157,34 +158,34 @@ public class RuleToolBar {
|
|||
FlexTable ruleOnColumnLayout = new FlexTable();
|
||||
ruleOnColumnGroup.add(ruleOnColumnLayout);
|
||||
|
||||
ruleOnColumnNewButton = new TextButton(msgs.ruleNewButton(),
|
||||
ruleOnColumnNewButton = new TextButton(msgs.ruleOnColumnNewButton(),
|
||||
TabularDataResources.INSTANCE.ruleColumnAdd32());
|
||||
ruleOnColumnNewButton.enable();
|
||||
ruleOnColumnNewButton.setToolTip(msgs.ruleNewButtonToolTip());
|
||||
ruleOnColumnNewButton.setToolTip(msgs.ruleOnColumnNewButtonToolTip());
|
||||
ruleOnColumnNewButton.setScale(ButtonScale.LARGE);
|
||||
ruleOnColumnNewButton.setIconAlign(IconAlign.TOP);
|
||||
ruleOnColumnNewButton.setArrowAlign(ButtonArrowAlign.BOTTOM);
|
||||
ruleOnColumnNewButton.addSelectHandler(new SelectHandler() {
|
||||
|
||||
public void onSelect(SelectEvent event) {
|
||||
eventBus.fireEvent(new RibbonEvent(RibbonType.RULE_NEW));
|
||||
eventBus.fireEvent(new RibbonEvent(RibbonType.RULE_ON_COLUMN_NEW));
|
||||
}
|
||||
});
|
||||
|
||||
ruleOnColumnLayout.setWidget(0, 0, ruleOnColumnNewButton);
|
||||
ruleOnColumnLayout.getFlexCellFormatter().setRowSpan(0, 0, 2);
|
||||
|
||||
ruleOnColumnApplyButton = new TextButton(msgs.ruleApplyButton(),
|
||||
ruleOnColumnApplyButton = new TextButton(msgs.ruleOnColumnApplyButton(),
|
||||
TabularDataResources.INSTANCE.ruleColumnApply32());
|
||||
ruleOnColumnApplyButton.disable();
|
||||
ruleOnColumnApplyButton.setScale(ButtonScale.LARGE);
|
||||
ruleOnColumnApplyButton.setIconAlign(IconAlign.TOP);
|
||||
ruleOnColumnApplyButton.setToolTip(msgs.ruleApplyButtonToolTip());
|
||||
ruleOnColumnApplyButton.setToolTip(msgs.ruleOnColumnApplyButtonToolTip());
|
||||
ruleOnColumnApplyButton.setArrowAlign(ButtonArrowAlign.BOTTOM);
|
||||
ruleOnColumnApplyButton.addSelectHandler(new SelectHandler() {
|
||||
|
||||
public void onSelect(SelectEvent event) {
|
||||
eventBus.fireEvent(new RibbonEvent(RibbonType.RULE_APPLY));
|
||||
eventBus.fireEvent(new RibbonEvent(RibbonType.RULE_ON_COLUMN_APPLY));
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -193,6 +194,53 @@ public class RuleToolBar {
|
|||
|
||||
cleanCells(ruleLayout.getElement());
|
||||
|
||||
// Table Rules
|
||||
ButtonGroup ruleOnTableGroup = new ButtonGroup();
|
||||
ruleOnTableGroup.setId("On Table");
|
||||
ruleOnTableGroup.setStyleName("ribbon");
|
||||
ruleOnTableGroup.setHeadingText(msgs.ruleOnTableGroupHeadingText());
|
||||
|
||||
toolBar.add(ruleOnTableGroup);
|
||||
|
||||
FlexTable ruleOnTableLayout = new FlexTable();
|
||||
ruleOnTableGroup.add(ruleOnTableLayout);
|
||||
|
||||
ruleOnTableNewButton = new TextButton(msgs.ruleOnTableNewButton(),
|
||||
TabularDataResources.INSTANCE.ruleTableAdd32());
|
||||
ruleOnTableNewButton.enable();
|
||||
ruleOnTableNewButton.setToolTip(msgs.ruleOnTableNewButtonToolTip());
|
||||
ruleOnTableNewButton.setScale(ButtonScale.LARGE);
|
||||
ruleOnTableNewButton.setIconAlign(IconAlign.TOP);
|
||||
ruleOnTableNewButton.setArrowAlign(ButtonArrowAlign.BOTTOM);
|
||||
ruleOnTableNewButton.addSelectHandler(new SelectHandler() {
|
||||
|
||||
public void onSelect(SelectEvent event) {
|
||||
eventBus.fireEvent(new RibbonEvent(RibbonType.RULE_ON_TABLE_NEW));
|
||||
}
|
||||
});
|
||||
|
||||
ruleOnTableLayout.setWidget(0, 0, ruleOnTableNewButton);
|
||||
ruleOnTableLayout.getFlexCellFormatter().setRowSpan(0, 0, 2);
|
||||
|
||||
ruleOnTableApplyButton = new TextButton(msgs.ruleOnTableApplyButton(),
|
||||
TabularDataResources.INSTANCE.ruleTableApply32());
|
||||
ruleOnTableApplyButton.disable();
|
||||
ruleOnTableApplyButton.setScale(ButtonScale.LARGE);
|
||||
ruleOnTableApplyButton.setIconAlign(IconAlign.TOP);
|
||||
ruleOnTableApplyButton.setToolTip(msgs.ruleOnTableApplyButtonToolTip());
|
||||
ruleOnTableApplyButton.setArrowAlign(ButtonArrowAlign.BOTTOM);
|
||||
ruleOnTableApplyButton.addSelectHandler(new SelectHandler() {
|
||||
|
||||
public void onSelect(SelectEvent event) {
|
||||
eventBus.fireEvent(new RibbonEvent(RibbonType.RULE_ON_TABLE_APPLY));
|
||||
}
|
||||
});
|
||||
|
||||
ruleOnTableLayout.setWidget(0, 1, ruleOnTableApplyButton);
|
||||
ruleOnTableLayout.getFlexCellFormatter().setRowSpan(0, 1, 2);
|
||||
|
||||
cleanCells(ruleLayout.getElement());
|
||||
|
||||
eventBus.addHandler(UIStateEvent.TYPE,
|
||||
new UIStateEvent.UIStateHandler() {
|
||||
|
||||
|
@ -226,6 +274,8 @@ public class RuleToolBar {
|
|||
ruleShareButton.enable();
|
||||
ruleOnColumnNewButton.enable();
|
||||
ruleOnColumnApplyButton.disable();
|
||||
ruleOnTableNewButton.enable();
|
||||
ruleOnTableApplyButton.disable();
|
||||
break;
|
||||
case TR_CLOSE:
|
||||
case TR_READONLY:
|
||||
|
@ -235,7 +285,8 @@ public class RuleToolBar {
|
|||
ruleShareButton.enable();
|
||||
ruleOnColumnNewButton.enable();
|
||||
ruleOnColumnApplyButton.disable();
|
||||
|
||||
ruleOnTableNewButton.enable();
|
||||
ruleOnTableApplyButton.disable();
|
||||
break;
|
||||
case TR_OPEN:
|
||||
case TABLEUPDATE:
|
||||
|
@ -245,8 +296,9 @@ public class RuleToolBar {
|
|||
ruleActiveButton.enable();
|
||||
ruleShareButton.enable();
|
||||
ruleOnColumnNewButton.enable();
|
||||
ruleOnColumnApplyButton.enable();
|
||||
|
||||
ruleOnColumnApplyButton.enable();
|
||||
ruleOnTableNewButton.enable();
|
||||
ruleOnTableApplyButton.enable();
|
||||
break;
|
||||
case WIZARD_OPEN:
|
||||
ruleOpenButton.disable();
|
||||
|
@ -255,6 +307,8 @@ public class RuleToolBar {
|
|||
ruleShareButton.disable();
|
||||
ruleOnColumnNewButton.disable();
|
||||
ruleOnColumnApplyButton.disable();
|
||||
ruleOnTableNewButton.disable();
|
||||
ruleOnTableApplyButton.disable();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
|
@ -42,18 +42,32 @@ public interface RuleToolBarMessages extends Messages {
|
|||
String ruleOnColumnGroupHeadingText();
|
||||
|
||||
@DefaultMessage("New")
|
||||
String ruleNewButton();
|
||||
String ruleOnColumnNewButton();
|
||||
|
||||
@DefaultMessage("New")
|
||||
String ruleNewButtonToolTip();
|
||||
String ruleOnColumnNewButtonToolTip();
|
||||
|
||||
@DefaultMessage("Apply")
|
||||
String ruleApplyButton();
|
||||
String ruleOnColumnApplyButton();
|
||||
|
||||
@DefaultMessage("Apply")
|
||||
String ruleApplyButtonToolTip();
|
||||
String ruleOnColumnApplyButtonToolTip();
|
||||
|
||||
@DefaultMessage("On Table")
|
||||
String ruleOnTableGroupHeadingText();
|
||||
|
||||
@DefaultMessage("New")
|
||||
String ruleOnTableNewButton();
|
||||
|
||||
@DefaultMessage("New")
|
||||
String ruleOnTableNewButtonToolTip();
|
||||
|
||||
@DefaultMessage("Apply")
|
||||
String ruleOnTableApplyButton();
|
||||
|
||||
@DefaultMessage("Apply")
|
||||
String ruleOnTableApplyButtonToolTip();
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -8,7 +8,13 @@ ruleShareButtonToolTip = Share
|
|||
ruleActiveButton = Active
|
||||
ruleActiveButtonToolTip = Active
|
||||
ruleOnColumnGroupHeadingText = On Column
|
||||
ruleNewButton = New
|
||||
ruleNewButtonToolTip = New
|
||||
ruleApplyButton = Apply
|
||||
ruleApplyButtonToolTip = Apply
|
||||
ruleOnColumnNewButton = New
|
||||
ruleOnColumnNewButtonToolTip = New
|
||||
ruleOnColumnApplyButton = Apply
|
||||
ruleOnColumnApplyButtonToolTip = Apply
|
||||
ruleOnTableGroupHeadingText = On Table
|
||||
ruleOnTableNewButton = New
|
||||
ruleOnTableNewButtonToolTip = New
|
||||
ruleOnTableApplyButton = Apply
|
||||
ruleOnTableApplyButtonToolTip = Apply
|
||||
|
||||
|
|
|
@ -8,7 +8,12 @@ ruleShareButtonToolTip = Cuota
|
|||
ruleActiveButton = Activo
|
||||
ruleActiveToolTip = Activo
|
||||
ruleOnColumnGroupHeadingText = On Columna
|
||||
ruleNewButton = Nuevo
|
||||
ruleNewButtonToolTip = Nuevo
|
||||
ruleApplyButton = Aplicar
|
||||
ruleApplyButtonToolTip = Aplicar
|
||||
ruleOnColumnNewButton = Nuevo
|
||||
ruleOnColumnNewButtonToolTip = Nuevo
|
||||
ruleOnColumnApplyButton = Aplicar
|
||||
ruleOnColumnApplyButtonToolTip = Aplicar
|
||||
ruleOnTableGroupHeadingText = On Tabla
|
||||
ruleOnTableNewButton = Nuevo
|
||||
ruleOnTableNewButtonToolTip = Nuevo
|
||||
ruleOnTableApplyButton = Aplicar
|
||||
ruleOnTableApplyButtonToolTip = Aplicar
|
|
@ -8,7 +8,12 @@ ruleShareButtonToolTip = Condividi
|
|||
ruleActiveButton = Attive
|
||||
ruleActiveButtonToolTip = Attive
|
||||
ruleOnColumnGroupHeadingText = Su Colonna
|
||||
ruleNewButton = Nuova
|
||||
ruleNewButtonToolTip = Nuova
|
||||
ruleApplyButton = Applica
|
||||
ruleApplyButtonToolTip = Applica
|
||||
ruleOnColumnNewButton = Nuova
|
||||
ruleOnColumnNewButtonToolTip = Nuova
|
||||
ruleOnColumnApplyButton = Applica
|
||||
ruleOnColumnApplyButtonToolTip = Applica
|
||||
ruleOnTableGroupHeadingText = Su Tabella
|
||||
ruleOnTableNewButton = Nuova
|
||||
ruleOnTableNewButtonToolTip = Nuova
|
||||
ruleOnTableApplyButton = Applica
|
||||
ruleOnTableApplyButtonToolTip = Applica
|
|
@ -99,11 +99,11 @@
|
|||
<set-property name="log_ConsoleLogger" value="ENABLED" />
|
||||
<set-property name="log_DivLogger" value="ENABLED" />
|
||||
<set-property name="log_GWTLogger" value="ENABLED" />
|
||||
<set-property name="log_SystemLogger" value="ENABLED" /> -->
|
||||
<set-property name="log_SystemLogger" value="ENABLED" /> -->
|
||||
<!-- Not in GWT 2.6 <set-property name="log_FirebugLogger" value="ENABLED"
|
||||
/> -->
|
||||
|
||||
|
||||
|
||||
<set-property name="log_ConsoleLogger" value="DISABLED" />
|
||||
<set-property name="log_DivLogger" value="DISABLED" />
|
||||
<set-property name="log_GWTLogger" value="DISABLED" />
|
||||
|
|
Loading…
Reference in New Issue