Package org.apache.log4j.chainsaw.helper

Source Code of org.apache.log4j.chainsaw.helper.TableCellEditorFactory

/*
*/
package org.apache.log4j.chainsaw.helper;

import javax.swing.DefaultCellEditor;
import javax.swing.JComboBox;
import javax.swing.table.TableCellEditor;

import org.apache.log4j.Level;

/**
* @author Paul Smith <psmith@apache.org>
*
*/
public class TableCellEditorFactory
{

 
  /**
   * Creates a TableCellEditor to be used for editing boolean values
   * @return TableCellEditor
   */
  public static final TableCellEditor createBooleanTableCellEditor() {
 
    JComboBox comboBox = new JComboBox(new Boolean[] {Boolean.TRUE, Boolean.FALSE});
    return new DefaultCellEditor(comboBox);
   
  }
 
  /**
   *
   */
  private TableCellEditorFactory()
  {
  }

  /**
   * @return table cell editor
   */
  public static Object createLevelTableCellEditor()
  {
    JComboBox comboBox = new JComboBox(new Level[] {Level.TRACE, Level.DEBUG, Level.INFO, Level.WARN, Level.ERROR, Level.FATAL, Level.OFF, Level.ALL});
    return new DefaultCellEditor(comboBox);
  }

}
TOP

Related Classes of org.apache.log4j.chainsaw.helper.TableCellEditorFactory

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.