Added Time Aggregation Operation

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-toolbox-widget@101107 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-10-28 17:21:58 +00:00 committed by Giancarlo Panichi
parent 68e546c39c
commit 4081813640
3 changed files with 80 additions and 0 deletions

View File

@ -16,6 +16,7 @@ import org.gcube.portlets.user.td.tablewidget.client.validation.ValidationsTable
import org.gcube.portlets.user.td.tablewidget.client.validation.ValidationsTasksPanel;
import org.gcube.portlets.user.td.toolboxwidget.client.help.HelpPanel;
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
import org.gcube.portlets.user.tdcolumnoperation.client.AggregateByTimeColumnPanel;
import org.gcube.portlets.user.tdcolumnoperation.client.GroupByColumnPanel;
import org.gcube.portlets.user.tdcolumnoperation.client.MergeColumnPanel;
import org.gcube.portlets.user.tdcolumnoperation.client.SplitColumnPanel;
@ -51,6 +52,7 @@ public class ToolBox extends TabPanel {
protected SplitColumnPanel splitColumnPanel;
protected MergeColumnPanel mergeColumnPanel;
protected GroupByColumnPanel groupByPanel;
protected AggregateByTimeColumnPanel timeAggregationPanel;
protected NormalizePanel normalizePanel;
protected DenormalizePanel denormalizePanel;
protected MonitorBackgroundPanel monitorBackgroundPanel;
@ -182,6 +184,18 @@ public class ToolBox extends TabPanel {
setActiveWidget(groupByPanel);
}
public void openTimeAggregationTab(TRId trId, String columnName) {
Log.debug("Open Time Aggregation Tab");
if (timeAggregationPanel == null) {
addTimeAggregationPanel(trId, columnName);
} else {
timeAggregationPanel.update(trId, columnName);
}
setActiveWidget(timeAggregationPanel);
}
public void openLabelColumnTab(TRId trId, String columnName) {
Log.debug("Open Label Column Tab");
@ -333,6 +347,14 @@ public class ToolBox extends TabPanel {
groupByPanel = null;
}
}
public void closeTimeAggregationPanel() {
Log.debug("Close TimeAggreagationPanel Tab");
if (timeAggregationPanel != null) {
remove(timeAggregationPanel);
timeAggregationPanel = null;
}
}
public void closeAddColumnPanel() {
Log.debug("Close AddColumnPanel Tab");
@ -464,6 +486,12 @@ public class ToolBox extends TabPanel {
remove(groupByPanel);
groupByPanel = null;
}
if (timeAggregationPanel != null) {
remove(timeAggregationPanel);
timeAggregationPanel = null;
}
if (addColumnPanel != null) {
remove(addColumnPanel);
@ -695,6 +723,34 @@ public class ToolBox extends TabPanel {
});
};
protected void addTimeAggregationPanel(TRId trId, String columnName) {
TabItemConfig timeAggregationItemConf = new TabItemConfig("Time Aggregation", true);
try {
timeAggregationPanel = new AggregateByTimeColumnPanel(trId, columnName, eventBus);
} catch (Throwable e) {
Log.error("Error Creating Time Aggregation Panel:" + e.getLocalizedMessage());
e.printStackTrace();
return;
}
add(timeAggregationPanel, timeAggregationItemConf);
addBeforeCloseHandler(new BeforeCloseHandler<Widget>() {
public void onBeforeClose(BeforeCloseEvent<Widget> event) {
if (timeAggregationPanel == event.getItem()) {
remove(timeAggregationPanel);
timeAggregationPanel = null;
}
}
});
};
protected void addLabelColumnPanel(TRId trId, String columnName) {
TabItemConfig labelColumnItemConf = new TabItemConfig("Column Label",

View File

@ -139,6 +139,9 @@ public class ToolBoxPanel extends ContentPanel {
case GROUPBYPANEL:
doGroupByTab(event);
break;
case TIMEAGGREGATIONPANEL:
doTimeAggregateTab(event);
break;
case LABELCOLUNPANEL:
doLabelColumnTab(event);
break;
@ -314,6 +317,25 @@ public class ToolBoxPanel extends ContentPanel {
Log.debug("ToolBoxPanel No table open");
}
}
protected void doTimeAggregateTab(WidgetRequestEvent event) {
Log.debug("WidgetRequestEvent.TimeAggregatePanel : [" + event.getTrId() + "]");
if (uiStateType == UIStateType.TR_OPEN
|| uiStateType == UIStateType.TABLECURATION
|| uiStateType == UIStateType.TABLEUPDATE) {
if (state == ToolBoxPanelState.OPENED) {
toolBox.openTimeAggregationTab(event.getTrId(), event.getColumnName());
Log.debug("ToolBoxPanelSTate.OPENED Add Tabs");
} else {
enable();
expand();
state = ToolBoxPanelState.OPENED;
toolBox.openTimeAggregationTab(event.getTrId(), event.getColumnName());
}
} else {
Log.debug("ToolBoxPanel No table open");
}
}
protected void doLabelColumnTab(WidgetRequestEvent event) {
Log.debug("WidgetRequestEvent.LabelColumnPanel : [" + event.getTrId()
@ -532,6 +554,7 @@ public class ToolBoxPanel extends ContentPanel {
toolBox.closeSplitColumnPanel();
toolBox.closeMergeColumnPanel();
toolBox.closeGroupByPanel();
toolBox.closeTimeAggregationPanel();
toolBox.closeLabelColumnPanel();
toolBox.closeChangeTableTypePanel();
toolBox.closeDuplicatesRowsPanel();

View File

@ -1,6 +1,7 @@
<ReleaseNotes>
<Changeset component="${groupId}.${artifactId}.1-5-0"
date="2014-10-31">
<Change>Added Time Aggregation</Change>
<Change>Added Resources</Change>
<Change>Fixed dependencies</Change>
</Changeset>