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:
parent
cc3899928a
commit
124d542a74
|
@ -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.rows.DuplicateRowsDeletePanel;
|
||||
import org.gcube.portlets.user.td.toolboxwidget.client.help.HelpPanel;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
|
||||
|
||||
|
@ -31,6 +32,7 @@ public class ToolBox extends TabPanel {
|
|||
protected DeleteColumnPanel deleteColumnPanel;
|
||||
protected LabelColumnPanel labelColumnPanel;
|
||||
protected ChangeTableTypePanel changeTableTypePanel;
|
||||
protected DuplicateRowsDeletePanel duplicateRowsDeletePanel;
|
||||
|
||||
// protected TdTaskController tdTaskController;
|
||||
// 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() {
|
||||
|
@ -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() {
|
||||
Log.debug("Update ToolBox Tabs");
|
||||
|
@ -182,6 +204,10 @@ public class ToolBox extends TabPanel {
|
|||
remove(changeTableTypePanel);
|
||||
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;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -125,6 +125,9 @@ public class ToolBoxPanel extends ContentPanel {
|
|||
case CHANGETABLETYPEPANEL:
|
||||
doChangeTableTypeTab(event);
|
||||
break;
|
||||
case DUPLICATEROWSDELETEPANEL:
|
||||
doDuplicateRowsDeleteTab(event);
|
||||
break;
|
||||
default:
|
||||
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(){
|
||||
if (uiStateType == UIStateType.TR_OPEN) {
|
||||
|
@ -240,6 +261,7 @@ public class ToolBoxPanel extends ContentPanel {
|
|||
toolBox.closeDeleteColumnPanel();
|
||||
toolBox.closeLabelColumnPanel();
|
||||
toolBox.closeChangeTableTypePanel();
|
||||
toolBox.closeDuplicateRowsDeletePanel();
|
||||
Log.debug("ToolBoxPanel Closed");
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue