@Override
public void populateItem(final Item<ICellPopulator<PolicyTO>> cellItem, final String componentId,
final IModel<PolicyTO> model) {
final PolicyTO accountPolicyTO = model.getObject();
final ActionLinksPanel panel = new ActionLinksPanel(componentId, model, pageRef);
panel.add(new ActionLink() {
private static final long serialVersionUID = -3722207913631435501L;
@Override
public void onClick(final AjaxRequestTarget target) {
mwindow.setPageCreator(new ModalWindow.PageCreator() {
private static final long serialVersionUID = -7834632442532690940L;
@Override
public Page createPage() {
return new PolicyModalPage(mwindow, accountPolicyTO, pageRef);
}
});
mwindow.show(target);
}
}, ActionLink.ActionType.EDIT, "Policies");
panel.add(new ActionLink() {
private static final long serialVersionUID = -3722207913631435501L;
@Override
public void onClick(final AjaxRequestTarget target) {
try {
policyRestClient.delete(accountPolicyTO.getId(), accountPolicyTO.getClass());
info(getString("operation_succeeded"));
} catch (SyncopeClientCompositeErrorException e) {
error(getString("operation_error"));
LOG.error("While deleting resource {}({})", new Object[]{accountPolicyTO.getId(),
accountPolicyTO.getDescription()}, e);
}
target.add(container);
target.add(getPage().get("feedback"));
}