Minor Updated

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-toolbox-widget@92801 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-03-07 09:41:49 +00:00 committed by Giancarlo Panichi
parent cc3899928a
commit 124d542a74
2 changed files with 71 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.columnwidget.client.LabelColumnPanel;
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.rows.DuplicateRowsDeletePanel;
import org.gcube.portlets.user.td.toolboxwidget.client.help.HelpPanel; import org.gcube.portlets.user.td.toolboxwidget.client.help.HelpPanel;
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId; import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
@ -31,6 +32,7 @@ public class ToolBox extends TabPanel {
protected DeleteColumnPanel deleteColumnPanel; protected DeleteColumnPanel deleteColumnPanel;
protected LabelColumnPanel labelColumnPanel; protected LabelColumnPanel labelColumnPanel;
protected ChangeTableTypePanel changeTableTypePanel; protected ChangeTableTypePanel changeTableTypePanel;
protected DuplicateRowsDeletePanel duplicateRowsDeletePanel;
// protected TdTaskController tdTaskController; // protected TdTaskController tdTaskController;
// protected DialogBox tdTaskMainWindow; // protected DialogBox tdTaskMainWindow;
@ -117,6 +119,17 @@ public class ToolBox extends TabPanel {
} }
public void openDuplicateRowsDeleteTab(TRId trId) {
Log.debug("Open Duplicate Rows Delete Tab");
if (duplicateRowsDeletePanel == null) {
addDuplicateRowsDeletePanel(trId);
} else {
duplicateRowsDeletePanel.update(trId);
}
setActiveWidget(duplicateRowsDeletePanel);
}
public void closePropertiesTabs() { public void closePropertiesTabs() {
@ -160,6 +173,15 @@ public class ToolBox extends TabPanel {
} }
} }
public void closeDuplicateRowsDeletePanel() {
Log.debug("Close DuplicateRowsDeletePanel Tab");
if (duplicateRowsDeletePanel != null) {
remove(duplicateRowsDeletePanel);
duplicateRowsDeletePanel = null;
}
}
public void updateTabs() { public void updateTabs() {
Log.debug("Update ToolBox Tabs"); Log.debug("Update ToolBox Tabs");
@ -182,6 +204,10 @@ public class ToolBox extends TabPanel {
remove(changeTableTypePanel); remove(changeTableTypePanel);
changeTableTypePanel = null; changeTableTypePanel = null;
} }
if (duplicateRowsDeletePanel != null) {
remove(duplicateRowsDeletePanel);
duplicateRowsDeletePanel = null;
}
@ -306,6 +332,29 @@ public class ToolBox extends TabPanel {
}; };
protected void addDuplicateRowsDeletePanel(TRId trId) {
TabItemConfig duplicateRowsDeleteItemConf = new TabItemConfig(
"Duplicate Delete", true);
duplicateRowsDeletePanel = new DuplicateRowsDeletePanel(trId,
eventBus);
add(duplicateRowsDeletePanel, duplicateRowsDeleteItemConf);
addBeforeCloseHandler(new BeforeCloseHandler<Widget>() {
public void onBeforeClose(BeforeCloseEvent<Widget> event) {
if (duplicateRowsDeletePanel == event.getItem()) {
remove(duplicateRowsDeletePanel);
duplicateRowsDeletePanel = null;
}
}
});
};

View File

@ -125,6 +125,9 @@ public class ToolBoxPanel extends ContentPanel {
case CHANGETABLETYPEPANEL: case CHANGETABLETYPEPANEL:
doChangeTableTypeTab(event); doChangeTableTypeTab(event);
break; break;
case DUPLICATEROWSDELETEPANEL:
doDuplicateRowsDeleteTab(event);
break;
default: default:
break; break;
@ -201,6 +204,24 @@ public class ToolBoxPanel extends ContentPanel {
} }
protected void doDuplicateRowsDeleteTab(WidgetRequestEvent event){
Log.debug("WidgetRequestEvent.DuplicateRowsDeletePanel : ["+event.getTrId()+"]");
if (uiStateType == UIStateType.TR_OPEN) {
if (state == ToolBoxPanelState.OPENED) {
toolBox.openDuplicateRowsDeleteTab(event.getTrId());
Log.debug("ToolBoxPanelSTate.OPENED Add Tabs");
} else {
enable();
expand();
state = ToolBoxPanelState.OPENED;
toolBox.openDuplicateRowsDeleteTab(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) {
@ -240,6 +261,7 @@ public class ToolBoxPanel extends ContentPanel {
toolBox.closeDeleteColumnPanel(); toolBox.closeDeleteColumnPanel();
toolBox.closeLabelColumnPanel(); toolBox.closeLabelColumnPanel();
toolBox.closeChangeTableTypePanel(); toolBox.closeChangeTableTypePanel();
toolBox.closeDuplicateRowsDeletePanel();
Log.debug("ToolBoxPanel Closed"); Log.debug("ToolBoxPanel Closed");
} }