IButton revertButton = new EnhancedIButton(MSG.view_bundle_revert(), ButtonColor.RED);
//revertButton.setIcon(IconEnum.BUNDLE_REVERT.getIcon16x16Path());
revertButton.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent clickEvent) {
SC.ask(MSG.view_bundle_dest_revertConfirm(), new BooleanCallback() {
@Override
public void execute(Boolean aBoolean) {
if (aBoolean) {
new BundleRevertWizard(destination).startWizard();
}
}
});
}
});
actionLayout.addMember(revertButton);
IButton purgeButton = new EnhancedIButton(MSG.view_bundle_purge(), ButtonColor.RED);
//purgeButton.setIcon(IconEnum.BUNDLE_DESTINATION_PURGE.getIcon16x16Path());
purgeButton.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent clickEvent) {
SC.ask(MSG.view_bundle_dest_purgeConfirm(), new BooleanCallback() {
@Override
public void execute(Boolean aBoolean) {
if (aBoolean) {
BundleGWTServiceAsync bundleService = GWTServiceLookup.getBundleService(600000); // 10m should be enough right?
bundleService.purgeBundleDestination(destination.getId(), new AsyncCallback<Void>() {
@Override
public void onFailure(Throwable caught) {
getErrorHandler().handleError(
MSG.view_bundle_dest_purgeFailure(destination.getName()), caught);
}
@Override
public void onSuccess(Void result) {
getMessageCenter().notify(
new Message(MSG.view_bundle_dest_purgeSuccessful(destination.getName()),
Message.Severity.Info));
// Bundle destination is purged, go back to bundle destination view
goToView(LinkManager.getBundleDestinationLink(bundle.getId(), destination.getId()),
true);
}
});
}
}
});
}
});
checkIfDisabled(purgeButton);
actionLayout.addMember(purgeButton);
IButton deleteButton = new EnhancedIButton(MSG.common_button_delete(), ButtonColor.RED);
//deleteButton.setIcon(IconEnum.BUNDLE_DESTINATION_DELETE.getIcon16x16Path());
deleteButton.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
SC.ask(MSG.view_bundle_dest_deleteConfirm(), new BooleanCallback() {
@Override
public void execute(Boolean confirmed) {
if (confirmed) {
doDeleteBundleDestination();
}