resourceManager.deleteResources(resourceIds, new AsyncCallback<List<DeleteResourceHistory>>() {
public void onFailure(Throwable caught) {
if (caught instanceof CannotConnectToAgentException) {
CoreGUI.getMessageCenter().notify(
new Message(MSG.view_inventory_resources_deleteFailed2(), Severity.Warning));
} else {
CoreGUI.getErrorHandler().handleError(MSG.view_inventory_resources_deleteFailed(),
caught);
}
}
public void onSuccess(List<DeleteResourceHistory> result) {
CoreGUI.getMessageCenter().notify(
new Message(MSG.view_inventory_resources_deleteSuccessful(), Severity.Info));
refresh(true);
// refresh the entire gui so it encompasses any relevant tree view. Don't just call this.refresh(),
// because CoreGUI.refresh is more comprehensive.
CoreGUI.refresh();