Added Tasks Validations
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-toolbox-widget@95437 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
9b8b2cbd9c
commit
dc2675ccb2
|
@ -8,6 +8,7 @@ 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.rows.DuplicatesRowsPanel;
|
||||
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.toolboxwidget.client.help.HelpPanel;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
|
||||
|
||||
|
@ -35,6 +36,7 @@ public class ToolBox extends TabPanel {
|
|||
protected LabelColumnPanel labelColumnPanel;
|
||||
protected ChangeTableTypePanel changeTableTypePanel;
|
||||
protected ValidationsTablePanel validationsTablePanel;
|
||||
protected ValidationsTasksPanel validationsTasksPanel;
|
||||
protected DuplicatesRowsPanel duplicatesRowsPanel;
|
||||
protected HistoryPanel historyPanel;
|
||||
|
||||
|
@ -141,6 +143,14 @@ public class ToolBox extends TabPanel {
|
|||
|
||||
}
|
||||
|
||||
public void openValidationsTasksTab(TRId trId) {
|
||||
Log.debug("Open Validations Tasks Tab: "+trId);
|
||||
if (validationsTasksPanel == null) {
|
||||
addValidationsTasksPanel(trId);
|
||||
}
|
||||
setActiveWidget(validationsTasksPanel);
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void openDuplicatesRowsTab(TRId trId) {
|
||||
|
@ -217,6 +227,14 @@ public class ToolBox extends TabPanel {
|
|||
}
|
||||
}
|
||||
|
||||
public void closeValidationsTasksPanel() {
|
||||
Log.debug("Close Validations Tasks Panel Tab");
|
||||
if (validationsTasksPanel != null) {
|
||||
remove(validationsTasksPanel);
|
||||
validationsTasksPanel = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void closeDuplicatesRowsPanel() {
|
||||
Log.debug("Close DuplicatesRowsPanel Tab");
|
||||
|
@ -241,6 +259,10 @@ public class ToolBox extends TabPanel {
|
|||
validationsTablePanel.update();
|
||||
}
|
||||
|
||||
if (validationsTasksPanel != null) {
|
||||
validationsTasksPanel.update();
|
||||
}
|
||||
|
||||
if (changeColumnTypePanel != null) {
|
||||
remove(changeColumnTypePanel);
|
||||
changeColumnTypePanel = null;
|
||||
|
@ -426,6 +448,29 @@ public class ToolBox extends TabPanel {
|
|||
});
|
||||
};
|
||||
|
||||
protected void addValidationsTasksPanel(TRId trId) {
|
||||
TabItemConfig validationsTasksItemConf = new TabItemConfig(
|
||||
"Validations", true);
|
||||
|
||||
validationsTasksPanel = new ValidationsTasksPanel(trId,
|
||||
eventBus);
|
||||
add(validationsTasksPanel, validationsTasksItemConf);
|
||||
|
||||
addBeforeCloseHandler(new BeforeCloseHandler<Widget>() {
|
||||
|
||||
public void onBeforeClose(BeforeCloseEvent<Widget> event) {
|
||||
if (validationsTasksPanel == event.getItem()) {
|
||||
remove(validationsTasksPanel);
|
||||
validationsTasksPanel = null;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
protected void addDuplicatesRowsPanel(TRId trId) {
|
||||
TabItemConfig duplicatesRowsDeleteItemConf = new TabItemConfig(
|
||||
|
|
|
@ -140,8 +140,8 @@ public class ToolBoxPanel extends ContentPanel {
|
|||
case DUPLICATESROWSPANEL:
|
||||
doDuplicatesRowsTab(event);
|
||||
break;
|
||||
case VALIDATIONSTABLEPANEL:
|
||||
doValidationsTableTab(event);
|
||||
case VALIDATIONSTASKPANEL:
|
||||
doValidationsTasksTab(event);
|
||||
default:
|
||||
break;
|
||||
|
||||
|
@ -283,6 +283,26 @@ public class ToolBoxPanel extends ContentPanel {
|
|||
}
|
||||
|
||||
|
||||
protected void doValidationsTasksTab(WidgetRequestEvent event){
|
||||
Log.debug("WidgetRequestEvent.ValidationsTasksPanel : ["+event.getTrId()+"]");
|
||||
if (uiStateType == UIStateType.TR_OPEN
|
||||
|| uiStateType == UIStateType.TABLECURATION
|
||||
|| uiStateType == UIStateType.TABLEUPDATE) {
|
||||
if (state == ToolBoxPanelState.OPENED) {
|
||||
toolBox.openValidationsTasksTab(event.getTrId());
|
||||
Log.debug("ToolBoxPanelSTate.OPENED Add Tabs");
|
||||
} else {
|
||||
enable();
|
||||
expand();
|
||||
state = ToolBoxPanelState.OPENED;
|
||||
toolBox.openValidationsTasksTab(event.getTrId());
|
||||
}
|
||||
} else {
|
||||
Log.debug("ToolBoxPanel No table open");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected void doPropertiesOpenTab(){
|
||||
if (uiStateType == UIStateType.TR_OPEN
|
||||
|
@ -327,6 +347,7 @@ public class ToolBoxPanel extends ContentPanel {
|
|||
toolBox.closeChangeTableTypePanel();
|
||||
toolBox.closeDuplicatesRowsPanel();
|
||||
toolBox.closeValidationsTablePanel();
|
||||
toolBox.closeValidationsTasksPanel();
|
||||
Log.debug("ToolBoxPanel Closed");
|
||||
}
|
||||
|
||||
|
@ -364,14 +385,14 @@ public class ToolBoxPanel extends ContentPanel {
|
|||
public void updateForCurationPanel(TRId trId){
|
||||
if (state == ToolBoxPanelState.OPENED) {
|
||||
toolBox.updateTabs();
|
||||
toolBox.openValidationsTableTab(trId);
|
||||
toolBox.openValidationsTasksTab(trId);
|
||||
Log.debug("ToolBoxPanel Updated For Curation");
|
||||
} else {
|
||||
enable();
|
||||
expand();
|
||||
state = ToolBoxPanelState.OPENED;
|
||||
toolBox.updateTabs();
|
||||
toolBox.openValidationsTableTab(trId);
|
||||
toolBox.openValidationsTasksTab(trId);
|
||||
Log.debug("ToolBoxPanel Updated For Curation");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue