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:
parent
68a12d4727
commit
74272f83c9
|
@ -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.normalization.NormalizationPanel;
|
||||
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.ValidationsTasksPanel;
|
||||
|
@ -47,6 +48,7 @@ public class ToolBox extends TabPanel {
|
|||
protected SplitColumnPanel splitColumnPanel;
|
||||
protected MergeColumnPanel mergeColumnPanel;
|
||||
protected GroupByColumnPanel groupByPanel;
|
||||
protected NormalizationPanel normalizePanel;
|
||||
|
||||
// protected TdTaskController tdTaskController;
|
||||
// protected DialogBox tdTaskMainWindow;
|
||||
|
@ -203,6 +205,18 @@ public class ToolBox extends TabPanel {
|
|||
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) {
|
||||
Log.debug("Open Duplicates Rows Tab");
|
||||
|
@ -321,6 +335,15 @@ public class ToolBox extends TabPanel {
|
|||
duplicatesRowsPanel = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void closeNormalizePanel() {
|
||||
Log.debug("Close NormalizePanel Tab");
|
||||
if (normalizePanel != null) {
|
||||
remove(normalizePanel);
|
||||
normalizePanel = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void updateTabs() {
|
||||
Log.debug("Update ToolBox Tabs");
|
||||
|
@ -385,6 +408,11 @@ public class ToolBox extends TabPanel {
|
|||
remove(duplicatesRowsPanel);
|
||||
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() {
|
||||
// TODO
|
||||
|
|
|
@ -155,6 +155,8 @@ public class ToolBoxPanel extends ContentPanel {
|
|||
break;
|
||||
case VALIDATIONSTASKSPANEL:
|
||||
doValidationsTasksTab(event);
|
||||
case NORAMLIZEPANEL:
|
||||
doNormalizeTab(event);
|
||||
default:
|
||||
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(){
|
||||
if (uiStateType == UIStateType.TR_OPEN
|
||||
|
@ -446,6 +467,7 @@ public class ToolBoxPanel extends ContentPanel {
|
|||
toolBox.closeDuplicatesRowsPanel();
|
||||
toolBox.closeValidationsTablePanel();
|
||||
toolBox.closeValidationsTasksPanel();
|
||||
toolBox.closeNormalizePanel();
|
||||
Log.debug("ToolBoxPanel Closed");
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue