Added Normalize

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-toolbox-widget@98341 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-07-03 09:42:46 +00:00 committed by Giancarlo Panichi
parent 68a12d4727
commit 74272f83c9
2 changed files with 74 additions and 0 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.informationwidget.client.TabularResourceProperties;
import org.gcube.portlets.user.td.tablewidget.client.ChangeTableTypePanel; 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.history.HistoryPanel;
import org.gcube.portlets.user.td.tablewidget.client.normalization.NormalizationPanel;
import org.gcube.portlets.user.td.tablewidget.client.rows.DuplicatesRowsPanel; import org.gcube.portlets.user.td.tablewidget.client.rows.DuplicatesRowsPanel;
import org.gcube.portlets.user.td.tablewidget.client.validation.ValidationsTablePanel; import org.gcube.portlets.user.td.tablewidget.client.validation.ValidationsTablePanel;
import org.gcube.portlets.user.td.tablewidget.client.validation.ValidationsTasksPanel; import org.gcube.portlets.user.td.tablewidget.client.validation.ValidationsTasksPanel;
@ -47,6 +48,7 @@ public class ToolBox extends TabPanel {
protected SplitColumnPanel splitColumnPanel; protected SplitColumnPanel splitColumnPanel;
protected MergeColumnPanel mergeColumnPanel; protected MergeColumnPanel mergeColumnPanel;
protected GroupByColumnPanel groupByPanel; protected GroupByColumnPanel groupByPanel;
protected NormalizationPanel normalizePanel;
// protected TdTaskController tdTaskController; // protected TdTaskController tdTaskController;
// protected DialogBox tdTaskMainWindow; // protected DialogBox tdTaskMainWindow;
@ -203,6 +205,18 @@ public class ToolBox extends TabPanel {
setActiveWidget(validationsTasksPanel); setActiveWidget(validationsTasksPanel);
} }
public void openNormalizeTab(TRId trId) {
Log.debug("Open Normalize Tab");
if (normalizePanel == null) {
addNormalizePanel(trId);
} else {
normalizePanel.update(trId);
}
setActiveWidget(normalizePanel);
}
public void openDuplicatesRowsTab(TRId trId) { public void openDuplicatesRowsTab(TRId trId) {
Log.debug("Open Duplicates Rows Tab"); Log.debug("Open Duplicates Rows Tab");
@ -321,6 +335,15 @@ public class ToolBox extends TabPanel {
duplicatesRowsPanel = null; duplicatesRowsPanel = null;
} }
} }
public void closeNormalizePanel() {
Log.debug("Close NormalizePanel Tab");
if (normalizePanel != null) {
remove(normalizePanel);
normalizePanel = null;
}
}
public void updateTabs() { public void updateTabs() {
Log.debug("Update ToolBox Tabs"); Log.debug("Update ToolBox Tabs");
@ -385,6 +408,11 @@ public class ToolBox extends TabPanel {
remove(duplicatesRowsPanel); remove(duplicatesRowsPanel);
duplicatesRowsPanel = null; duplicatesRowsPanel = null;
} }
if (normalizePanel != null) {
remove(normalizePanel);
normalizePanel = null;
}
} }
@ -668,6 +696,30 @@ public class ToolBox extends TabPanel {
}); });
}; };
protected void addNormalizePanel(TRId trId) {
TabItemConfig normalizeItemConf = new TabItemConfig("Normalize",
true);
normalizePanel = new NormalizationPanel(trId, eventBus);
add(normalizePanel, normalizeItemConf);
addBeforeCloseHandler(new BeforeCloseHandler<Widget>() {
public void onBeforeClose(BeforeCloseEvent<Widget> event) {
if (normalizePanel == event.getItem()) {
remove(normalizePanel);
normalizePanel = null;
}
}
});
};
protected void addTdTaskPanel() { protected void addTdTaskPanel() {
// TODO // TODO

View File

@ -155,6 +155,8 @@ public class ToolBoxPanel extends ContentPanel {
break; break;
case VALIDATIONSTASKSPANEL: case VALIDATIONSTASKSPANEL:
doValidationsTasksTab(event); doValidationsTasksTab(event);
case NORAMLIZEPANEL:
doNormalizeTab(event);
default: default:
break; break;
@ -397,6 +399,25 @@ public class ToolBoxPanel extends ContentPanel {
} }
protected void doNormalizeTab(WidgetRequestEvent event){
Log.debug("WidgetRequestEvent.NoramlizePanel : ["+event.getTrId()+"]");
if (uiStateType == UIStateType.TR_OPEN
|| uiStateType == UIStateType.TABLECURATION
|| uiStateType == UIStateType.TABLEUPDATE) {
if (state == ToolBoxPanelState.OPENED) {
toolBox.openNormalizeTab(event.getTrId());
Log.debug("ToolBoxPanelSTate.OPENED Normalize Tab");
} else {
enable();
expand();
state = ToolBoxPanelState.OPENED;
toolBox.openNormalizeTab(event.getTrId());
}
} else {
Log.debug("ToolBoxPanel No table open");
}
}
protected void doPropertiesOpenTab(){ protected void doPropertiesOpenTab(){
if (uiStateType == UIStateType.TR_OPEN if (uiStateType == UIStateType.TR_OPEN
@ -446,6 +467,7 @@ public class ToolBoxPanel extends ContentPanel {
toolBox.closeDuplicatesRowsPanel(); toolBox.closeDuplicatesRowsPanel();
toolBox.closeValidationsTablePanel(); toolBox.closeValidationsTablePanel();
toolBox.closeValidationsTasksPanel(); toolBox.closeValidationsTasksPanel();
toolBox.closeNormalizePanel();
Log.debug("ToolBoxPanel Closed"); Log.debug("ToolBoxPanel Closed");
} }