1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.exoplatform.ecm.webui.component.admin.taxonomy.action;
19
20 import org.exoplatform.ecm.webui.component.admin.taxonomy.UITaxonomyManagerTrees;
21 import org.exoplatform.ecm.webui.component.admin.taxonomy.UITaxonomyTreeContainer;
22 import org.exoplatform.webui.config.annotation.ComponentConfig;
23 import org.exoplatform.webui.core.UIComponent;
24 import org.exoplatform.webui.core.UIContainer;
25 import org.exoplatform.webui.core.UIPopupWindow;
26 import org.exoplatform.webui.core.lifecycle.UIContainerLifecycle;
27
28
29
30
31
32
33
34
35 @ComponentConfig(
36 lifecycle = UIContainerLifecycle.class
37 )
38
39 public class UIActionTaxonomyManager extends UIContainer {
40
41 public UIActionTaxonomyManager() throws Exception {
42 UIActionTypeForm uiActionTypeForm = getChild(UIActionTypeForm.class);
43 if (uiActionTypeForm == null) {
44 uiActionTypeForm = addChild(UIActionTypeForm.class, null, null);
45 }
46 addChild(UIActionForm.class, null, null);
47 }
48
49 public void setDefaultConfig() throws Exception {
50 UIActionTypeForm uiActionType = getChild(UIActionTypeForm.class);
51 uiActionType.setDefaultActionType(null);
52 Class[] renderClasses = { UIActionTypeForm.class, UIActionForm.class };
53 setRenderedChildrenOfTypes(renderClasses);
54 }
55
56 public void initPopupComponent(UIComponent uiComp, String id) throws Exception {
57 UITaxonomyManagerTrees uiManagerTrees = getAncestorOfType(UITaxonomyManagerTrees.class);
58 if (uiManagerTrees != null) {
59 uiManagerTrees.removeChildById(UITaxonomyTreeContainer.POPUP_PERMISSION);
60 uiManagerTrees.removeChildById(UITaxonomyTreeContainer.POPUP_TAXONOMYHOMEPATH);
61 }
62
63 removeChildById(UIActionForm.POPUP_COMPONENT);
64 UIPopupWindow uiPopup = addChild(UIPopupWindow.class, null, id);
65 uiPopup.setShowMask(true);
66 uiPopup.setUIComponent(uiComp);
67 uiPopup.setWindowSize(640, 300);
68 uiPopup.setShow(true);
69 uiPopup.setResizable(true);
70 }
71 }