}
}
public static class DeleteComponentActionListener extends EventListener<UIComponent> {
public void execute(Event<UIComponent> event) throws Exception {
UIComponent uiComponentTobeRemoved = event.getSource();
String id = uiComponentTobeRemoved.getId();
UIPortalApplication uiApp = Util.getUIPortalApplication();
if (uiComponentTobeRemoved.findFirstComponentOfType(UIPageBody.class) != null) {
uiApp.addMessage(new ApplicationMessage("UIPortalApplication.msg.deletePageBody", new Object[] {},
ApplicationMessage.WARNING));
return;
}
org.exoplatform.portal.webui.container.UIContainer uiParent = uiComponentTobeRemoved.getParent();
if (!canMove(uiComponentTobeRemoved, (org.exoplatform.portal.webui.container.UIContainer) uiParent)) {
/* deletion not allowed */
return;
}
UIPortalComposer portalComposer = uiApp.findFirstComponentOfType(UIPortalComposer.class);
portalComposer.setEditted(true);
UIPage uiPage = uiComponentTobeRemoved.getAncestorOfType(UIPage.class);
if (uiPage != null && uiPage.getMaximizedUIPortlet() != null) {
if (id.equals(uiPage.getMaximizedUIPortlet().getId())) {
uiPage.setMaximizedUIPortlet(null);
}
} else {