1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.exoplatform.ecm.webui.component.explorer.popup.admin;
18
19 import org.exoplatform.ecm.webui.component.explorer.UIJCRExplorer;
20 import org.exoplatform.webui.core.UIPopupComponent;
21 import org.exoplatform.ecm.webui.tree.selectone.UIOneNodePathSelector;
22 import org.exoplatform.webui.config.annotation.ComponentConfig;
23 import org.exoplatform.webui.config.annotation.EventConfig;
24 import org.exoplatform.webui.core.UIContainer;
25 import org.exoplatform.webui.event.Event;
26 import org.exoplatform.webui.event.EventListener;
27
28
29
30
31
32
33
34
35 @ComponentConfig(
36 template = "app:/groovy/webui/component/explorer/UITabPaneWithAction.gtmpl",
37 events = @EventConfig(listeners = UIRelationManager.CloseActionListener.class)
38 )
39 public class UIRelationManager extends UIContainer implements UIPopupComponent {
40
41 final static public String[] ACTIONS = {"Close"} ;
42
43 public UIRelationManager() throws Exception {
44 addChild(UIRelationsAddedList.class, null, null) ;
45 addChild(UIOneNodePathSelector.class, null, null).setRendered(false) ;
46 }
47
48 public String[] getActions() { return ACTIONS ; }
49
50 static public class CloseActionListener extends EventListener<UIRelationManager> {
51 public void execute(Event<UIRelationManager> event) throws Exception {
52 UIJCRExplorer uiExplorer = event.getSource().getAncestorOfType(UIJCRExplorer.class) ;
53 uiExplorer.getCurrentNode().save() ;
54 uiExplorer.setIsHidePopup(false) ;
55 uiExplorer.cancelAction() ;
56 uiExplorer.updateAjax(event);
57 }
58 }
59
60 public void activate() { }
61
62 public void deActivate() { }
63 }