View Javadoc
1   /***************************************************************************
2    * Copyright (C) 2003-2009 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   **************************************************************************/
18  package org.exoplatform.ecm.webui.presentation;
19  
20  import java.util.ArrayList;
21  import java.util.List;
22  
23  import org.exoplatform.webui.application.WebuiRequestContext;
24  import org.exoplatform.webui.core.UIComponent;
25  
26  /**
27   * Created by The eXo Platform SARL
28   * Author : Hoang Van Hung
29   *          hunghvit@gmail.com
30   * Sep 18, 2009
31   */
32  public abstract class AbstractActionComponent extends UIComponent {
33  
34    private List<Class> lstComponentupdate = new ArrayList<Class>();
35  
36    public void setLstComponentupdate(List<Class> lstComponentupdate) {
37      this.lstComponentupdate = lstComponentupdate;
38    }
39  
40    public List<Class> getLstComponentupdate() {
41      return lstComponentupdate;
42    }
43  
44    public void updateAjax(WebuiRequestContext requestcontext) {
45      for (Class clazz : lstComponentupdate) {
46        requestcontext.addUIComponentToUpdateByAjax(this.getAncestorOfType((Class<UIComponent>)clazz));
47      }
48    }
49  }