1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.exoplatform.wcm.webui.dialog;
18
19 import org.exoplatform.wcm.webui.Utils;
20 import org.exoplatform.wcm.webui.dialog.permission.UIPermissionManager;
21 import org.exoplatform.webui.config.annotation.ComponentConfig;
22 import org.exoplatform.webui.config.annotation.EventConfig;
23 import org.exoplatform.webui.core.UIPopupContainer;
24 import org.exoplatform.webui.core.UITabPane;
25 import org.exoplatform.webui.event.Event;
26 import org.exoplatform.webui.event.EventListener;
27
28
29
30
31
32
33
34 @ComponentConfig (
35 template = "system:/groovy/webui/form/ext/UITabPaneWithAction.gtmpl",
36 events = {
37 @EventConfig(listeners = UIContentDialogPreference.BackActionListener.class)
38 }
39 )
40 public class UIContentDialogPreference extends UITabPane {
41
42 public String[] getActions() {
43 return new String[] {"Back"};
44 }
45
46 public void init() throws Exception {
47 UIPermissionManager permissionManager = addChild(UIPermissionManager.class, null, null);
48 permissionManager.updateGrid();
49 setSelectedTab(permissionManager.getId());
50 }
51
52 public static class BackActionListener extends EventListener<UIContentDialogPreference> {
53
54 public void execute(Event<UIContentDialogPreference> event) throws Exception {
55 UIContentDialogPreference contentDialogPreference = event.getSource();
56 UIPopupContainer popupContainer = contentDialogPreference.getAncestorOfType(UIPopupContainer.class);
57 UIContentDialogForm contentDialogForm = popupContainer.getChild(UIContentDialogForm.class);
58 popupContainer.removeChildById(contentDialogForm.getId());
59 Utils.updatePopupWindow(contentDialogPreference, contentDialogForm, UIContentDialogForm.CONTENT_DIALOG_FORM_POPUP_WINDOW);
60 }
61 }
62 }