Updated Denormalize

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-toolbox-widget@98401 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-07-03 16:15:16 +00:00 committed by Giancarlo Panichi
parent 323d5999a7
commit 8b6df7b796
2 changed files with 71 additions and 1 deletions

View File

@ -7,6 +7,7 @@ import org.gcube.portlets.user.td.columnwidget.client.create.AddColumnPanel;
import org.gcube.portlets.user.td.informationwidget.client.TabularResourceProperties;
import org.gcube.portlets.user.td.tablewidget.client.ChangeTableTypePanel;
import org.gcube.portlets.user.td.tablewidget.client.history.HistoryPanel;
import org.gcube.portlets.user.td.tablewidget.client.normalize.DenormalizePanel;
import org.gcube.portlets.user.td.tablewidget.client.normalize.NormalizePanel;
import org.gcube.portlets.user.td.tablewidget.client.rows.DuplicatesRowsPanel;
import org.gcube.portlets.user.td.tablewidget.client.validation.ValidationsTablePanel;
@ -49,6 +50,7 @@ public class ToolBox extends TabPanel {
protected MergeColumnPanel mergeColumnPanel;
protected GroupByColumnPanel groupByPanel;
protected NormalizePanel normalizePanel;
protected DenormalizePanel denormalizePanel;
// protected TdTaskController tdTaskController;
// protected DialogBox tdTaskMainWindow;
@ -217,6 +219,17 @@ public class ToolBox extends TabPanel {
}
public void openDenormalizeTab(TRId trId) {
Log.debug("Open Denormalize Tab");
if (denormalizePanel == null) {
addDenormalizePanel(trId);
} else {
denormalizePanel.update(trId);
}
setActiveWidget(denormalizePanel);
}
public void openDuplicatesRowsTab(TRId trId) {
Log.debug("Open Duplicates Rows Tab");
@ -344,6 +357,14 @@ public class ToolBox extends TabPanel {
}
}
public void closeDenormalizePanel() {
Log.debug("Close DenormalizePanel Tab");
if (denormalizePanel != null) {
remove(denormalizePanel);
denormalizePanel = null;
}
}
public void updateTabs() {
Log.debug("Update ToolBox Tabs");
@ -413,6 +434,11 @@ public class ToolBox extends TabPanel {
remove(normalizePanel);
normalizePanel = null;
}
if (denormalizePanel != null) {
remove(denormalizePanel);
denormalizePanel = null;
}
}
@ -719,6 +745,27 @@ public class ToolBox extends TabPanel {
});
};
protected void addDenormalizePanel(TRId trId) {
TabItemConfig denormalizeItemConf = new TabItemConfig("Denormalize",
true);
denormalizePanel = new DenormalizePanel(trId, eventBus);
add(denormalizePanel, denormalizeItemConf);
addBeforeCloseHandler(new BeforeCloseHandler<Widget>() {
public void onBeforeClose(BeforeCloseEvent<Widget> event) {
if (denormalizePanel == event.getItem()) {
remove(denormalizePanel);
denormalizePanel = null;
}
}
});
};
protected void addTdTaskPanel() {

View File

@ -156,9 +156,12 @@ public class ToolBoxPanel extends ContentPanel {
case VALIDATIONSTASKSPANEL:
doValidationsTasksTab(event);
break;
case NORAMLIZEPANEL:
case NORMALIZEPANEL:
doNormalizeTab(event);
break;
case DENORMALIZEPANEL:
doDenormalizeTab(event);
break;
default:
break;
@ -420,6 +423,25 @@ public class ToolBoxPanel extends ContentPanel {
}
}
protected void doDenormalizeTab(WidgetRequestEvent event){
Log.debug("WidgetRequestEvent.DenoramlizePanel : ["+event.getTrId()+"]");
if (uiStateType == UIStateType.TR_OPEN
|| uiStateType == UIStateType.TABLECURATION
|| uiStateType == UIStateType.TABLEUPDATE) {
if (state == ToolBoxPanelState.OPENED) {
toolBox.openDenormalizeTab(event.getTrId());
Log.debug("ToolBoxPanelSTate.OPENED Denormalize Tab");
} else {
enable();
expand();
state = ToolBoxPanelState.OPENED;
toolBox.openDenormalizeTab(event.getTrId());
}
} else {
Log.debug("ToolBoxPanel No table open");
}
}
protected void doPropertiesOpenTab(){
if (uiStateType == UIStateType.TR_OPEN
@ -470,6 +492,7 @@ public class ToolBoxPanel extends ContentPanel {
toolBox.closeValidationsTablePanel();
toolBox.closeValidationsTasksPanel();
toolBox.closeNormalizePanel();
toolBox.closeDenormalizePanel();
Log.debug("ToolBoxPanel Closed");
}