diff --git a/.settings/org.eclipse.wst.common.component b/.settings/org.eclipse.wst.common.component index d6549d6..74340e8 100644 --- a/.settings/org.eclipse.wst.common.component +++ b/.settings/org.eclipse.wst.common.component @@ -19,10 +19,10 @@ uses - + uses - + uses diff --git a/src/main/java/org/gcube/portlets/user/td/client/TabularDataController.java b/src/main/java/org/gcube/portlets/user/td/client/TabularDataController.java index 4502466..ec38da3 100644 --- a/src/main/java/org/gcube/portlets/user/td/client/TabularDataController.java +++ b/src/main/java/org/gcube/portlets/user/td/client/TabularDataController.java @@ -33,7 +33,9 @@ import com.google.gwt.user.client.rpc.AsyncCallback; import com.google.web.bindery.event.shared.EventBus; import com.google.web.bindery.event.shared.SimpleEventBus; import com.sencha.gxt.widget.core.client.ContentPanel; +import com.sencha.gxt.widget.core.client.Dialog.PredefinedButton; import com.sencha.gxt.widget.core.client.box.AlertMessageBox; +import com.sencha.gxt.widget.core.client.box.ConfirmMessageBox; import com.sencha.gxt.widget.core.client.container.BorderLayoutContainer.BorderLayoutData; import com.sencha.gxt.widget.core.client.event.HideEvent; import com.sencha.gxt.widget.core.client.event.HideEvent.HideHandler; @@ -201,20 +203,39 @@ public class TabularDataController { } protected void deleteTabularResource() { - Log.debug("Remove TR:" + trId); - TDGWTServiceAsync.INSTANCE.removeTabularResource(trId, - new AsyncCallback() { - public void onFailure(Throwable caught) { - alertMessage("Error", "Error on remove TabResource: " - + caught.getLocalizedMessage()); - } + final ConfirmMessageBox mb = new ConfirmMessageBox( + "Confirm", "Are you sure you want to delete the taular resource?"); + mb.addHideHandler(new HideHandler() { + public void onHide(HideEvent event) { + if (mb.getHideButton() == mb.getButtonById(PredefinedButton.YES + .name())) { + Log.debug("Remove TR:" + trId); + TDGWTServiceAsync.INSTANCE.removeTabularResource(trId, + new AsyncCallback() { - public void onSuccess(Void result) { - closeTabularResource(); - } + public void onFailure(Throwable caught) { + alertMessage( + "Error", + "Error on remove TabResource: " + + caught.getLocalizedMessage()); + } - }); + public void onSuccess(Void result) { + closeTabularResource(); + } + + }); + + mb.hide(); + } else if (mb.getHideButton() == mb + .getButtonById(PredefinedButton.NO.name())) { + mb.hide(); + } + } + }); + mb.setWidth(300); + mb.show(); } @@ -583,8 +604,8 @@ public class TabularDataController { protected void openColumnTYPE() { openColumnTYPE(null); } - - protected void openColumnTYPE(String columnName){ + + protected void openColumnTYPE(String columnName) { Log.debug("Request Open Change Column Tab"); if (trId != null) { WidgetRequestEvent e = new WidgetRequestEvent( @@ -594,7 +615,6 @@ public class TabularDataController { eventBus.fireEvent(e); } } - protected void doGridHeaderColumnMenuCommand( GridHeaderColumnMenuItemEvent event) {