org.tbee.swing.table
Class ClassConciousEditorRenderer

java.lang.Object
  extended by org.tbee.swing.table.ClassConciousEditorRenderer
All Implemented Interfaces:
javax.swing.CellEditor, javax.swing.table.TableCellEditor, javax.swing.table.TableCellRenderer

public class ClassConciousEditorRenderer
extends java.lang.Object
implements javax.swing.table.TableCellRenderer, javax.swing.table.TableCellEditor

A renderer and editor that delegates rendering to the most appropriate renderer or editor for the cell's value.

Author:
Jesse Wilson

Method Summary
 void addCellEditorListener(javax.swing.event.CellEditorListener listener)
          Adds a listener to the list that's notified when the editor stops, or cancels editing.
 void cancelCellEditing()
          Tells the editor to cancel editing and not accept any partially edited value.
 java.lang.Object getCellEditorValue()
          Returns the value contained in the editor.
 java.awt.Component getTableCellEditorComponent(javax.swing.JTable table, java.lang.Object value, boolean isSelected, int row, int column)
          Returns the component used for editing the cell.
 java.awt.Component getTableCellRendererComponent(javax.swing.JTable table, java.lang.Object value, boolean isSelected, boolean hasFocus, int row, int column)
          Returns the component used for drawing the cell.
static ClassConciousEditorRenderer install(javax.swing.JTable table)
          Creates a ClassConciousRenderer for the specified JTable and installs it into the table.
 boolean isCellEditable(java.util.EventObject anEvent)
          Asks the editor if it can start editing using anEvent.
 void removeCellEditorListener(javax.swing.event.CellEditorListener listener)
          Removes a listener from the list that's notified
 boolean shouldSelectCell(java.util.EventObject anEvent)
          Returns true if the editing cell should be selected, false otherwise.
 boolean stopCellEditing()
          Tells the editor to stop editing and accept any partially edited value as the value of the editor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

install

public static ClassConciousEditorRenderer install(javax.swing.JTable table)
Creates a ClassConciousRenderer for the specified JTable and installs it into the table.


getTableCellRendererComponent

public java.awt.Component getTableCellRendererComponent(javax.swing.JTable table,
                                                        java.lang.Object value,
                                                        boolean isSelected,
                                                        boolean hasFocus,
                                                        int row,
                                                        int column)
Returns the component used for drawing the cell.

Specified by:
getTableCellRendererComponent in interface javax.swing.table.TableCellRenderer

getTableCellEditorComponent

public java.awt.Component getTableCellEditorComponent(javax.swing.JTable table,
                                                      java.lang.Object value,
                                                      boolean isSelected,
                                                      int row,
                                                      int column)
Returns the component used for editing the cell.

Specified by:
getTableCellEditorComponent in interface javax.swing.table.TableCellEditor

addCellEditorListener

public void addCellEditorListener(javax.swing.event.CellEditorListener listener)
Adds a listener to the list that's notified when the editor stops, or cancels editing.

Specified by:
addCellEditorListener in interface javax.swing.CellEditor

removeCellEditorListener

public void removeCellEditorListener(javax.swing.event.CellEditorListener listener)
Removes a listener from the list that's notified

Specified by:
removeCellEditorListener in interface javax.swing.CellEditor

cancelCellEditing

public void cancelCellEditing()
Tells the editor to cancel editing and not accept any partially edited value.

Specified by:
cancelCellEditing in interface javax.swing.CellEditor

getCellEditorValue

public java.lang.Object getCellEditorValue()
Returns the value contained in the editor.

Specified by:
getCellEditorValue in interface javax.swing.CellEditor

isCellEditable

public boolean isCellEditable(java.util.EventObject anEvent)
Asks the editor if it can start editing using anEvent.

Specified by:
isCellEditable in interface javax.swing.CellEditor

shouldSelectCell

public boolean shouldSelectCell(java.util.EventObject anEvent)
Returns true if the editing cell should be selected, false otherwise.

Specified by:
shouldSelectCell in interface javax.swing.CellEditor

stopCellEditing

public boolean stopCellEditing()
Tells the editor to stop editing and accept any partially edited value as the value of the editor.

Specified by:
stopCellEditing in interface javax.swing.CellEditor


Copyright © 2010. All Rights Reserved.