psmith      2003/12/18 19:20:31

  Added:       src/java/org/apache/log4j/chainsaw/helper
                        TableCellEditorFactory.java
  Log:
  Added a helper package, and added a helper class to assist
  with editing tables.
  
  Revision  Changes    Path
  1.1                  
jakarta-log4j/src/java/org/apache/log4j/chainsaw/helper/TableCellEditorFactory.java
  
  Index: TableCellEditorFactory.java
  ===================================================================
  /*
   */
  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 <[EMAIL PROTECTED]>
   *
   */
  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
     */
    public static Object createLevelTableCellEditor()
    {
      JComboBox comboBox = new JComboBox(new Level[] {Level.DEBUG, Level.INFO, 
Level.WARN, Level.ERROR, Level.FATAL, Level.OFF, Level.ALL});
      return new DefaultCellEditor(comboBox); 
    }
  
  }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to