View Javadoc
1   /*
2    * Copyright (C) 2003-2007 eXo Platform SAS.
3    *
4    * This program is free software; you can redistribute it and/or
5    * modify it under the terms of the GNU Affero General Public License
6    * as published by the Free Software Foundation; either version 3
7    * of the License, or (at your option) any later version.
8    *
9    * This program is distributed in the hope that it will be useful,
10   * but WITHOUT ANY WARRANTY; without even the implied warranty of
11   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12   * GNU General Public License for more details.
13   *
14   * You should have received a copy of the GNU General Public License
15   * along with this program; if not, see<http://www.gnu.org/licenses/>.
16   */
17  package org.exoplatform.ecm.webui.component.explorer.popup.info;
18  
19  import org.exoplatform.ecm.webui.component.explorer.UIJCRExplorer;
20  import org.exoplatform.ecm.webui.core.UIPermissionManagerBase;
21  import org.exoplatform.webui.config.annotation.ComponentConfig;
22  import org.exoplatform.webui.config.annotation.EventConfig;
23  import org.exoplatform.webui.event.Event;
24  import org.exoplatform.webui.event.EventListener;
25  
26  @ComponentConfig(template = "classpath:groovy/wcm/webui/core/UIPermissionManager.gtmpl", 
27  events = { @EventConfig(listeners = UIPermissionManager.CloseActionListener.class) })
28  public class UIPermissionManager extends UIPermissionManagerBase {
29    public UIPermissionManager() throws Exception {
30      this.addChild(UIPermissionInfo.class, null, null);
31      this.addChild(UIPermissionForm.class, null, null);
32    }
33    
34    static public class CloseActionListener extends EventListener<UIPermissionManager> {
35      public void execute(Event<UIPermissionManager> event) throws Exception {
36        UIJCRExplorer uiExplorer = event.getSource().getAncestorOfType(UIJCRExplorer.class);
37        uiExplorer.cancelAction();
38      }
39    }
40  }