private Button getDeleteButton(final String snapshotName, final String moduleName) { Button btn = new Button(Constants.INSTANCE.Delete()); btn.addClickHandler( new ClickHandler() { public void onClick(ClickEvent event) { if (Window.confirm( Constants.INSTANCE.SnapshotDeleteConfirm(snapshotName, moduleName))) { ModuleServiceAsync moduleService = GWT.create(ModuleService.class); moduleService.copyOrRemoveSnapshot( moduleName, snapshotName, true, null, new GenericCallback<java.lang.Void>() { public void onSuccess(Void v) { Window.alert(Constants.INSTANCE.SnapshotWasDeleted()); eventBus.fireEvent(getCloseEvent(moduleName)); } }); } } }); return btn; }