BooleanYesNoCellEditor.groovy 567 Bytes
Newer Older
janosch's avatar
janosch committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
package de.mpicbg.sweng.grails.jmesa

import org.jmesa.view.editor.CellEditor

/**
 * Created by IntelliJ IDEA.
 * User: janosch
 * Date: Oct 26, 2010
 * Time: 2:15:38 PM
 * To change this template use File | Settings | File Templates.
 */
class BooleanYesNoCellEditor implements CellEditor {

  private String attribute
  public BooleanYesNoCellEditor(String attribute){
    this.attribute = attribute
  }

  Object getValue(def item, String property, int rowcount) {
    if (item[this.attribute]) {
      return "Yes"
    }
    else {
      return "No"
    }
  }
}