if (address == null && returnToPage != null) {
setResponsePage(returnToPage);
return;
}
if (this.returnToPage != null) {
final ContentMenuEntryPanel back = new ContentMenuEntryPanel(getNewContentMenuChildId(), new Link<Object>("link") {
@Override
public void onClick()
{
setResponsePage(returnToPage);
};
}, getString("back"));
addContentMenuEntry(back);
}
{
final ContentMenuEntryPanel edit = new ContentMenuEntryPanel(getNewContentMenuChildId(), new Link<Object>("link") {
@Override
public void onClick()
{
final PageParameters params = new PageParameters();
params.add(AbstractEditPage.PARAMETER_KEY_ID, address.getId());
final AddressEditPage addressEditPage = new AddressEditPage(params);
addressEditPage.setReturnToPage(AddressViewPage.this);
setResponsePage(addressEditPage);
};
}, getString("edit"));
addContentMenuEntry(edit);
}
if (ConfigXml.getInstance().isTelephoneSystemUrlConfigured() == true) {
final ContentMenuEntryPanel menu = new ContentMenuEntryPanel(getNewContentMenuChildId(),
new Link<Void>(ContentMenuEntryPanel.LINK_ID) {
@Override
public void onClick()
{
final Integer addressId = address.getId();
final PageParameters params = new PageParameters();
params.add(PhoneCallPage.PARAMETER_KEY_ADDRESS_ID, addressId);
setResponsePage(new PhoneCallPage(params));
};
}, getString("address.directCall.call"));
addContentMenuEntry(menu);
}
if (ConfigXml.getInstance().isSmsConfigured() == true
&& StringHelper.isNotBlank(address.getMobilePhone(), address.getPrivateMobilePhone()) == true) {
final ContentMenuEntryPanel menu = new ContentMenuEntryPanel(getNewContentMenuChildId(),
new Link<Void>(ContentMenuEntryPanel.LINK_ID) {
@Override
public void onClick()
{
final Integer addressId = address.getId();