Minor Update
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-toolbox-widget@94863 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
7181e800d2
commit
824b28ba26
|
@ -5,6 +5,7 @@ import org.gcube.portlets.user.td.columnwidget.client.DeleteColumnPanel;
|
|||
import org.gcube.portlets.user.td.columnwidget.client.LabelColumnPanel;
|
||||
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.rows.DuplicatesRowsPanel;
|
||||
import org.gcube.portlets.user.td.tablewidget.client.validation.ValidationsTablePanel;
|
||||
import org.gcube.portlets.user.td.toolboxwidget.client.help.HelpPanel;
|
||||
|
@ -35,6 +36,7 @@ public class ToolBox extends TabPanel {
|
|||
protected ChangeTableTypePanel changeTableTypePanel;
|
||||
protected ValidationsTablePanel validationsTablePanel;
|
||||
protected DuplicatesRowsPanel duplicatesRowsPanel;
|
||||
protected HistoryPanel historyPanel;
|
||||
|
||||
// protected TdTaskController tdTaskController;
|
||||
// protected DialogBox tdTaskMainWindow;
|
||||
|
@ -77,6 +79,17 @@ public class ToolBox extends TabPanel {
|
|||
|
||||
}
|
||||
|
||||
public void openHistoryTab() {
|
||||
Log.debug("Open History Tab");
|
||||
if (historyPanel == null) {
|
||||
addHistoryPanel();
|
||||
} else {
|
||||
historyPanel.update();
|
||||
}
|
||||
setActiveWidget(historyPanel);
|
||||
|
||||
}
|
||||
|
||||
public void openColumnTypeChangeTab(TRId trId, String columnName) {
|
||||
Log.debug("Open Column Type Change Tab");
|
||||
if (changeColumnTypePanel == null) {
|
||||
|
@ -155,6 +168,16 @@ public class ToolBox extends TabPanel {
|
|||
|
||||
}
|
||||
|
||||
public void closeHistoryPanel() {
|
||||
Log.debug("Close History Tab");
|
||||
if (historyPanel != null) {
|
||||
remove(historyPanel);
|
||||
historyPanel = null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void closeChangeColumnTypePanel() {
|
||||
Log.debug("Close ChangeColumnTypePanel Tab");
|
||||
if (changeColumnTypePanel != null) {
|
||||
|
@ -211,6 +234,10 @@ public class ToolBox extends TabPanel {
|
|||
if (trProperties != null) {
|
||||
trProperties.update();
|
||||
}
|
||||
if (historyPanel != null) {
|
||||
historyPanel.update();
|
||||
}
|
||||
|
||||
if (changeColumnTypePanel != null) {
|
||||
remove(changeColumnTypePanel);
|
||||
changeColumnTypePanel = null;
|
||||
|
@ -269,6 +296,25 @@ public class ToolBox extends TabPanel {
|
|||
});
|
||||
};
|
||||
|
||||
protected void addHistoryPanel() {
|
||||
TabItemConfig historyPanelItemConf = new TabItemConfig("History", true);
|
||||
|
||||
historyPanel = new HistoryPanel(eventBus);
|
||||
add(historyPanel, historyPanelItemConf);
|
||||
|
||||
addBeforeCloseHandler(new BeforeCloseHandler<Widget>() {
|
||||
|
||||
public void onBeforeClose(BeforeCloseEvent<Widget> event) {
|
||||
if (historyPanel == event.getItem()) {
|
||||
remove(historyPanel);
|
||||
historyPanel = null;
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
protected void addChangeColumnTypePanel(TRId trId, String columnName) {
|
||||
TabItemConfig changeColumnTypeItemConf = new TabItemConfig(
|
||||
"Column Type", true);
|
||||
|
|
|
@ -80,6 +80,10 @@ public class ToolBoxPanel extends ContentPanel {
|
|||
break;
|
||||
case HELP:
|
||||
doHelpTab();
|
||||
break;
|
||||
case HISTORY:
|
||||
doHistoryTab();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -136,6 +140,22 @@ public class ToolBoxPanel extends ContentPanel {
|
|||
}
|
||||
}
|
||||
|
||||
protected void doHistoryTab(){
|
||||
if (uiStateType == UIStateType.TR_OPEN) {
|
||||
if (state == ToolBoxPanelState.OPENED) {
|
||||
toolBox.openHistoryTab();
|
||||
Log.debug("ToolBoxPanelSTate.OPENED Add Tabs");
|
||||
} else {
|
||||
enable();
|
||||
expand();
|
||||
state = ToolBoxPanelState.OPENED;
|
||||
toolBox.openHistoryTab();
|
||||
}
|
||||
} else {
|
||||
Log.debug("ToolBoxPanel No table open");
|
||||
}
|
||||
}
|
||||
|
||||
protected void doColumnTypeChangeTab(WidgetRequestEvent event){
|
||||
Log.debug("WidgetRequestEvent.CHANGECOLUMNTYPEPANEL : ["+event.getTrId()+" ,columnName: "+event.getColumnName()+"]");
|
||||
if (uiStateType == UIStateType.TR_OPEN) {
|
||||
|
@ -276,6 +296,7 @@ public class ToolBoxPanel extends ContentPanel {
|
|||
|
||||
public void closePanel(){
|
||||
toolBox.closePropertiesTabs();
|
||||
toolBox.closeHistoryPanel();
|
||||
toolBox.closeChangeColumnTypePanel();
|
||||
toolBox.closeDeleteColumnPanel();
|
||||
toolBox.closeLabelColumnPanel();
|
||||
|
|
Loading…
Reference in New Issue