View Javadoc
1   package org.exoplatform.wcm.webui.selector.content;
2   
3   import org.exoplatform.webui.config.annotation.ComponentConfig;
4   import org.exoplatform.webui.core.UIContainer;
5   import org.exoplatform.webui.core.UIPopupWindow;
6   import org.exoplatform.webui.core.UITabPane;
7   
8   /**
9    * Author : TAN DUNG DANG
10   *          dzungdev@gmail.com
11   * Jan 20, 2009
12   */
13  
14  @ComponentConfig(
15    template = "system:/groovy/webui/core/UITabPane_New.gtmpl"
16  )
17  
18  public class UIContentSelector extends UITabPane {
19  
20    /** The Constant FOLDER_PATH_SELECTOR_POPUP_WINDOW. */
21    public static final String FOLDER_PATH_SELECTOR_POPUP_WINDOW = "FolderPathSelectorPopupWindow";
22  
23    /** The Constant CORRECT_CONTENT_SELECTOR_POPUP_WINDOW. */
24    public static final String CORRECT_CONTENT_SELECTOR_POPUP_WINDOW = "CorrectContentSelectorPopupWindow";
25  
26    public void initMetadataPopup(UIContainer uicontainer) throws Exception {
27      UIPopupWindow uiPopupWindow = this.initPopup(uicontainer, UIContentPropertySelector.WEB_CONTENT_METADATA_POPUP);
28      UIContentPropertySelector contentPropertySelector = createUIComponent(UIContentPropertySelector.class, null, null);
29      uiPopupWindow.setUIComponent(contentPropertySelector);
30      contentPropertySelector.setFieldName(UIContentSearchForm.PROPERTY);
31      // Utils.createPopupWindow(this, contentPropertySelector, UIContentPropertySelector.WEB_CONTENT_METADATA_POPUP, 500);
32      contentPropertySelector.init();
33      this.setSelectedTab(2);
34      
35      uiPopupWindow.setRendered(true);
36      uiPopupWindow.setShow(true);
37    }
38  
39    public void initNodeTypePopup(UIContainer uicontainer) throws Exception {
40      UIPopupWindow uiPopupWindow = this.initPopup(uicontainer, UIContentNodeTypeSelector.WEB_CONTENT_NODETYPE_POPUP);
41      UIContentNodeTypeSelector contentNodetypeSelector = createUIComponent(UIContentNodeTypeSelector.class, null, null);
42      uiPopupWindow.setUIComponent(contentNodetypeSelector);
43      contentNodetypeSelector.init();
44      this.setSelectedTab(2);
45      
46      uiPopupWindow.setRendered(true);
47      uiPopupWindow.setShow(true);
48    }
49    
50    private UIPopupWindow initPopup(UIContainer uiContainer, String id) throws Exception {
51      UIPopupWindow uiPopup = uiContainer.getChildById(id);
52      if (uiPopup == null) {
53        uiPopup = uiContainer.addChild(UIPopupWindow.class, null, id);
54      }
55      uiPopup.setWindowSize(500, 0);
56      uiPopup.setShow(false);
57      uiPopup.setResizable(true);
58      return uiPopup;
59    }
60  
61  }