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.admin.script;
18  
19  import org.exoplatform.webui.config.annotation.ComponentConfig;
20  import org.exoplatform.webui.config.annotation.ComponentConfigs;
21  import org.exoplatform.webui.core.UIComponent;
22  import org.exoplatform.webui.core.UIContainer;
23  import org.exoplatform.webui.core.UIPopupWindow;
24  import org.exoplatform.webui.core.lifecycle.UIContainerLifecycle;
25  
26  /**
27   * Created by The eXo Platform SARL
28   * Author : Ha Quang Tan
29   *          tanhq@exoplatform.com
30   * Jan 27, 2013
31   * 2:09:18 PM
32   */
33  @ComponentConfigs( {
34    @ComponentConfig(lifecycle = UIContainerLifecycle.class) })
35  
36  public class UIScriptContainer extends UIContainer {
37  
38    public UIScriptContainer() throws Exception {
39      addChild(UIScriptList.class, null, null) ;
40    }
41  
42    public void initPopup(UIComponent uiComponent, String popupId) throws Exception {
43      removeChildById(popupId) ;    
44      UIPopupWindow uiPopup = addChild(UIPopupWindow.class, null, popupId) ;
45      uiPopup.setShowMask(true);    
46      uiPopup.setWindowSize(600,300) ;
47      uiPopup.setUIComponent(uiComponent) ;
48      uiPopup.setShow(true) ;
49      uiPopup.setResizable(true) ;
50    }
51  
52    public void update() throws Exception {
53      UIScriptList uiScriptList = getChild(UIScriptList.class);
54      uiScriptList.refresh(uiScriptList.getTemplateFilter(), uiScriptList.getUIPageIterator().getCurrentPage());
55    }  
56  }