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:
Giancarlo Panichi 2014-04-15 18:24:38 +00:00 committed by Giancarlo Panichi
parent 7181e800d2
commit 824b28ba26
2 changed files with 67 additions and 0 deletions

View File

@ -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;
@ -76,7 +78,18 @@ public class ToolBox extends TabPanel {
setActiveWidget(trProperties);
}
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) {
@ -154,7 +167,17 @@ 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;
@ -268,7 +295,26 @@ 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);

View File

@ -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();