⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 employeetablebean.java

📁 adf-faces 甲骨文的jsf组件,功能很强.开源免费.
💻 JAVA
字号:
/*
 * Created on Mar 9, 2005
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package oracle.adfdemo.view.faces.tableDemos;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import javax.faces.event.ActionEvent;

/**
 * @author asghosh
 */
public class EmployeeTableBean implements Serializable
{
  public EmployeeTableBean()
  {
    _populate();
  }

  private List _list;

  private int _total;

  /**
   * @param _list
   *          The _list to set.
   */
  public void setList(List list)
  {
    this._list = list;
  }

  /**
   * @return Returns the _list.
   */
  public List getList()
  {
    return _list;
  }

  /**
   * @param _total
   *          The _total to set.
   */
  public void setTotal(int total)
  {
    this._total = total;
  }

  /**
   * @return Returns the _total.
   */
  public int getTotal()
  {
    return _total;
  }

  public void addRow(ActionEvent event)
  {
    EmployeeBean dataHolder = (EmployeeBean) _list.get(_list.size() - 1);
    dataHolder.setReadOnly(true);
    dataHolder = new EmployeeBean("", "");
    dataHolder.setReadOnly(false);
    _list.add(dataHolder);
  }

  public void totalRow(ActionEvent event)
  {
    _total = 0;
    for (Iterator iter = _list.iterator(); iter.hasNext();)
    {
      EmployeeBean dataHolder = (EmployeeBean) iter.next();
      if (!dataHolder.getData2().equalsIgnoreCase(""))
      {
        _total = _total + Integer.parseInt(dataHolder.getData2());
      }
    }
  }

  private void _populate()
  {
    _list = new ArrayList();
    _list.add(new EmployeeBean("22", "22"));
    _list.add(new EmployeeBean("44", "44"));
    _list.add(new EmployeeBean("44", "44"));
    _list.add(new EmployeeBean("44", "44"));
    _list.add(new EmployeeBean("44", "44"));

  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -