IButton purgeButton = new EnhancedIButton(MSG.view_bundle_purge(), ButtonColor.RED);
//purgeButton.setIcon("subsystems/bundle/BundleDestinationAction_Purge_16.png");
purgeButton.addClickHandler(new com.smartgwt.client.widgets.events.ClickHandler() {
@Override
public void onClick(com.smartgwt.client.widgets.events.ClickEvent clickEvent) {
SC.ask(MSG.view_bundle_dest_purgeConfirm(), new BooleanCallback() {
@Override
public void execute(Boolean aBoolean) {
if (aBoolean) {
final int destinationId = deployment.getDestination().getId();
final String destinationName = deployment.getDestination().getName();
BundleGWTServiceAsync bundleService = GWTServiceLookup.getBundleService(600000); // 10m should be enough right?
bundleService.purgeBundleDestination(destinationId, new AsyncCallback<Void>() {
@Override
public void onFailure(Throwable caught) {
getErrorHandler().handleError(
MSG.view_bundle_dest_purgeFailure(destinationName), caught);
}
@Override
public void onSuccess(Void result) {
getMessageCenter().notify(
new Message(MSG.view_bundle_dest_purgeSuccessful(destinationName),
Message.Severity.Info));
// Bundle destination is purged, go back to bundle deployment view - it is not live anymore
goToView(
LinkManager.getBundleDeploymentLink(bundle.getId(), deployment.getId()),
true);
}
});
}
}
});
}
});
actionLayout.addMember(purgeButton);
if (!canDeploy) {
revertButton.setDisabled(true);
purgeButton.setDisabled(true);
}
}
IButton deleteButton = new EnhancedIButton(MSG.common_button_delete(), ButtonColor.RED);
//deleteButton.setIcon("subsystems/bundle/BundleDeploymentAction_Delete_16.png");
deleteButton.addClickHandler(new com.smartgwt.client.widgets.events.ClickHandler() {
@Override
public void onClick(com.smartgwt.client.widgets.events.ClickEvent event) {
SC.ask(MSG.view_bundle_deploy_deleteConfirm(), new BooleanCallback() {
@Override
public void execute(Boolean confirmed) {
if (confirmed) {
doDeleteBundleDeployment();
}