Added Time Aggregation Operation

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-portlet@101099 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-10-28 17:08:15 +00:00
parent ca9269fc21
commit 7e688ebd6e
7 changed files with 58 additions and 5 deletions

View File

@ -786,6 +786,9 @@ public class TabularDataController {
case TABLEGROUPBY:
openGroupBy();
break;
case TABLETIMEAGGREGATE:
openTimeAggregate();
break;
case TABLEAGGREAGETE:
break;
case ROWADD:
@ -1687,6 +1690,25 @@ public class TabularDataController {
UtilsGXT3.alert("Error", "No tabular resource present");
}
}
protected void openTimeAggregate() {
openTimeAggregate(null);
}
protected void openTimeAggregate(String columnName) {
Log.debug("Request Time Aggregate Tab");
if (trId != null) {
WidgetRequestEvent e = new WidgetRequestEvent(
WidgetRequestType.TIMEAGGREGATIONPANEL);
e.setTrId(trId);
e.setColumnName(columnName);
eventBus.fireEvent(e);
} else {
Log.error("TRId is null");
UtilsGXT3.alert("Error", "No tabular resource present");
}
}
protected void openColumnLabel() {
openColumnLabel(null);

View File

@ -146,6 +146,12 @@ public interface TabularDataResources extends ClientBundle {
@Source("table-aggregate_32.png")
ImageResource aggregate32();
@Source("table-time-aggregate.png")
ImageResource timeAggregate();
@Source("table-time-aggregate_32.png")
ImageResource timeAggregate32();
@Source("history_32.png")
ImageResource history32();

Binary file not shown.

After

Width:  |  Height:  |  Size: 969 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@ -37,7 +37,8 @@ public class ModifyToolBar {
protected TextButton filterButton;
protected TextButton unionButton;
protected TextButton groupbyButton;
protected TextButton aggregateButton;
//protected TextButton aggregateButton;
protected TextButton timeAggregationButton;
protected TextButton addRowButton;
protected TextButton deleteRowButton;
protected TextButton deleteDuplicateButton;
@ -125,6 +126,7 @@ public class ModifyToolBar {
tableLayout.setWidget(0, 2, groupbyButton);
tableLayout.getFlexCellFormatter().setRowSpan(0, 2, 2);
/*
aggregateButton = new TextButton("Aggregate",
TabularDataResources.INSTANCE.aggregate32());
aggregateButton.disable();
@ -141,6 +143,25 @@ public class ModifyToolBar {
tableLayout.setWidget(0, 3, aggregateButton);
tableLayout.getFlexCellFormatter().setRowSpan(0, 3, 2);
*/
timeAggregationButton = new TextButton("Time Aggregation",
TabularDataResources.INSTANCE.timeAggregate32());
timeAggregationButton.disable();
timeAggregationButton.setScale(ButtonScale.LARGE);
timeAggregationButton.setIconAlign(IconAlign.TOP);
timeAggregationButton.setToolTip("Performs time aggregation");
timeAggregationButton.setArrowAlign(ButtonArrowAlign.BOTTOM);
timeAggregationButton.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) {
eventBus.fireEvent(new RibbonEvent(RibbonType.TABLETIMEAGGREGATE));
}
});
tableLayout.setWidget(0, 3, timeAggregationButton);
tableLayout.getFlexCellFormatter().setRowSpan(0, 3, 2);
addRowButton = new TextButton("Add Row",
TabularDataResources.INSTANCE.rowInsert32());
@ -300,7 +321,8 @@ public class ModifyToolBar {
filterButton.disable();
unionButton.disable();
groupbyButton.disable();
aggregateButton.disable();
timeAggregationButton.disable();
//aggregateButton.disable();
addRowButton.disable();
deleteRowButton.disable();
deleteDuplicateButton.disable();
@ -315,7 +337,8 @@ public class ModifyToolBar {
filterButton.disable();
unionButton.disable();
groupbyButton.disable();
aggregateButton.disable();
timeAggregationButton.disable();
//aggregateButton.disable();
addRowButton.disable();
deleteRowButton.disable();
deleteDuplicateButton.disable();
@ -331,7 +354,8 @@ public class ModifyToolBar {
filterButton.disable();
unionButton.enable();
groupbyButton.enable();
aggregateButton.disable();
timeAggregationButton.enable();
//aggregateButton.disable();
addRowButton.enable();
deleteRowButton.enable();
deleteDuplicateButton.enable();
@ -345,7 +369,8 @@ public class ModifyToolBar {
filterButton.disable();
unionButton.disable();
groupbyButton.disable();
aggregateButton.disable();
timeAggregationButton.disable();
//aggregateButton.disable();
addRowButton.disable();
deleteRowButton.disable();
deleteDuplicateButton.disable();

Binary file not shown.

After

Width:  |  Height:  |  Size: 969 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB